Skip to content

Commit

Permalink
add ext-info-s to KEX algorithms only in the first key exchange
Browse files Browse the repository at this point in the history
Signed-off-by: Nicola Murino <[email protected]>
  • Loading branch information
drakkan committed Mar 30, 2022
1 parent 0196e38 commit 2b41359
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ssh/handshake.go
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,11 @@ func (t *handshakeTransport) sendKexInit() error {
msg.ServerHostKeyAlgos = append(msg.ServerHostKeyAlgos, keyFormat)
}
}
msg.KexAlgos = append(msg.KexAlgos, extInfoServer)
if firstKeyExchange := t.sessionID == nil; firstKeyExchange {
msg.KexAlgos = make([]string, 0, len(t.config.KeyExchanges)+1)
msg.KexAlgos = append(msg.KexAlgos, t.config.KeyExchanges...)
msg.KexAlgos = append(msg.KexAlgos, extInfoServer)
}
} else {
msg.ServerHostKeyAlgos = t.hostKeyAlgorithms

Expand Down

0 comments on commit 2b41359

Please sign in to comment.