summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordjm@openbsd.org <djm@openbsd.org>2019-09-05 09:25:13 +0000
committerDamien Miller <djm@mindrot.org>2019-09-05 20:07:12 +1000
commit0ea332497b2b2fc3995f72f6bafe9d664c0195b3 (patch)
treec90af7aafa491750f4e8ef5708ae8638a6f59a66
parentf23d91f9fa7f6f42e70404e000fac88aebfe3076 (diff)
upstream: only send ext_info for KEX_INITIAL; bz#2929 ok dtucker
OpenBSD-Commit-ID: 00f5c6062f6863769f5447c6346f78c05d2e4a63
-rw-r--r--kex.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/kex.c b/kex.c
index 34808b5c3..ff88dd7e3 100644
--- a/kex.c
+++ b/kex.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: kex.c,v 1.150 2019/01/21 12:08:13 djm Exp $ */ 1/* $OpenBSD: kex.c,v 1.151 2019/09/05 09:25:13 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 *
@@ -409,6 +409,7 @@ kex_send_ext_info(struct ssh *ssh)
409 int r; 409 int r;
410 char *algs; 410 char *algs;
411 411
412 debug("Sending SSH2_MSG_EXT_INFO");
412 if ((algs = sshkey_alg_list(0, 1, 1, ',')) == NULL) 413 if ((algs = sshkey_alg_list(0, 1, 1, ',')) == NULL)
413 return SSH_ERR_ALLOC_FAIL; 414 return SSH_ERR_ALLOC_FAIL;
414 /* XXX filter algs list by allowed pubkey/hostbased types */ 415 /* XXX filter algs list by allowed pubkey/hostbased types */
@@ -435,11 +436,11 @@ kex_send_newkeys(struct ssh *ssh)
435 (r = sshpkt_send(ssh)) != 0) 436 (r = sshpkt_send(ssh)) != 0)
436 return r; 437 return r;
437 debug("SSH2_MSG_NEWKEYS sent"); 438 debug("SSH2_MSG_NEWKEYS sent");
438 debug("expecting SSH2_MSG_NEWKEYS");
439 ssh_dispatch_set(ssh, SSH2_MSG_NEWKEYS, &kex_input_newkeys); 439 ssh_dispatch_set(ssh, SSH2_MSG_NEWKEYS, &kex_input_newkeys);
440 if (ssh->kex->ext_info_c) 440 if (ssh->kex->ext_info_c && (ssh->kex->flags & KEX_INITIAL) != 0)
441 if ((r = kex_send_ext_info(ssh)) != 0) 441 if ((r = kex_send_ext_info(ssh)) != 0)
442 return r; 442 return r;
443 debug("expecting SSH2_MSG_NEWKEYS");
443 return 0; 444 return 0;
444} 445}
445 446