@@ -647,16 +647,20 @@ func (t *handshakeTransport) enterKeyExchange(otherInitPacket []byte) error {
647647
648648 // On the server side, after the first SSH_MSG_NEWKEYS, send a SSH_MSG_EXT_INFO
649649 // message with the server-sig-algs extension if the client supports it. See
650- // RFC 8308, Sections 2.4 and 3.1.
650+ // RFC 8308, Sections 2.4 and 3.1, and [PROTOCOL], Section 1.9 .
651651 if ! isClient && firstKeyExchange && contains (clientInit .KexAlgos , "ext-info-c" ) {
652652 extInfo := & extInfoMsg {
653- NumExtensions : 1 ,
654- Payload : make ([]byte , 0 , 4 + 15 + 4 + len (supportedPubKeyAuthAlgosList )),
653+ NumExtensions : 2 ,
654+ Payload : make ([]byte , 0 , 4 + 15 + 4 + len (supportedPubKeyAuthAlgosList )+ 4 + 16 + 4 + 1 ),
655655 }
656656 extInfo .Payload = appendInt (extInfo .Payload , len ("server-sig-algs" ))
657657 extInfo .Payload = append (extInfo .Payload , "server-sig-algs" ... )
658658 extInfo .Payload = appendInt (extInfo .Payload , len (supportedPubKeyAuthAlgosList ))
659659 extInfo .Payload = append (extInfo .Payload , supportedPubKeyAuthAlgosList ... )
660+ extInfo .
Payload = appendInt (
extInfo .
Payload ,
len (
"[email protected] " ))
661+ extInfo .
Payload = append (
extInfo .
Payload ,
"[email protected] " ... )
662+ extInfo .Payload = appendInt (extInfo .Payload , 1 )
663+ extInfo .Payload = append (extInfo .Payload , "0" ... )
660664 if err := t .conn .writePacket (Marshal (extInfo )); err != nil {
661665 return err
662666 }
0 commit comments