summaryrefslogtreecommitdiff
path: root/kex.c
diff options
context:
space:
mode:
Diffstat (limited to 'kex.c')
-rw-r--r--kex.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/kex.c b/kex.c
index 25f9f66f6..3823a9544 100644
--- a/kex.c
+++ b/kex.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: kex.c,v 1.141 2018/07/09 13:37:10 sf Exp $ */ 1/* $OpenBSD: kex.c,v 1.142 2018/12/07 03:39:40 djm Exp $ */
2/* 2/*
3 * Copyright (c) 2000, 2001 Markus Friedl. All rights reserved. 3 * Copyright (c) 2000, 2001 Markus Friedl. All rights reserved.
4 * 4 *
@@ -487,6 +487,7 @@ kex_input_newkeys(int type, u_int32_t seq, struct ssh *ssh)
487 if ((r = ssh_set_newkeys(ssh, MODE_IN)) != 0) 487 if ((r = ssh_set_newkeys(ssh, MODE_IN)) != 0)
488 return r; 488 return r;
489 kex->done = 1; 489 kex->done = 1;
490 kex->flags &= ~KEX_INITIAL;
490 sshbuf_reset(kex->peer); 491 sshbuf_reset(kex->peer);
491 /* sshbuf_reset(kex->my); */ 492 /* sshbuf_reset(kex->my); */
492 kex->flags &= ~KEX_INIT_SENT; 493 kex->flags &= ~KEX_INIT_SENT;
@@ -594,6 +595,7 @@ kex_new(struct ssh *ssh, char *proposal[PROPOSAL_MAX], struct kex **kexp)
594 if ((r = kex_prop2buf(kex->my, proposal)) != 0) 595 if ((r = kex_prop2buf(kex->my, proposal)) != 0)
595 goto out; 596 goto out;
596 kex->done = 0; 597 kex->done = 0;
598 kex->flags = KEX_INITIAL;
597 kex_reset_dispatch(ssh); 599 kex_reset_dispatch(ssh);
598 ssh_dispatch_set(ssh, SSH2_MSG_KEXINIT, &kex_input_kexinit); 600 ssh_dispatch_set(ssh, SSH2_MSG_KEXINIT, &kex_input_kexinit);
599 r = 0; 601 r = 0;
@@ -839,7 +841,7 @@ kex_choose_conf(struct ssh *ssh)
839 } 841 }
840 842
841 /* Check whether client supports ext_info_c */ 843 /* Check whether client supports ext_info_c */
842 if (kex->server) { 844 if (kex->server && (kex->flags & KEX_INITIAL)) {
843 char *ext; 845 char *ext;
844 846
845 ext = match_list("ext-info-c", peer[PROPOSAL_KEX_ALGS], NULL); 847 ext = match_list("ext-info-c", peer[PROPOSAL_KEX_ALGS], NULL);