From 83f2ac4abb7a36f774ede89fa860d7971a65566c Mon Sep 17 00:00:00 2001 From: Jakub Jelen Date: Thu, 15 Nov 2018 10:22:19 +0100 Subject: [PATCH] kex: Do not negotiate extensions during rekey The RFC 8308 clearly says, that the additional ext-info-c should be added only to the first SSH_MSG_KEXINIT. Signed-off-by: Jakub Jelen Reviewed-by: Andreas Schneider --- src/kex.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/kex.c b/src/kex.c index 8bb19db0..c3f84eff 100644 --- a/src/kex.c +++ b/src/kex.c @@ -742,6 +742,11 @@ int ssh_set_client_kex(ssh_session session) } } + /* For rekeying, skip the extension negotiation */ + if (session->session_state == SSH_SESSION_STATE_AUTHENTICATED) { + return SSH_OK; + } + /* Here we append ext-info-c to the list of kex algorithms */ kex = client->methods[SSH_KEX]; len = strlen(kex);