Commit 83f2ac4a authored by Jakub Jelen's avatar Jakub Jelen Committed by Andreas Schneider
Browse files

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: default avatarJakub Jelen <jjelen@redhat.com>
Reviewed-by: default avatarAndreas Schneider <asn@cryptomilk.org>
parent 0b4c2a8e
Loading
Loading
Loading
Loading
+5 −0
Changes for src/kex.c: 5 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -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);