mirror of
https://github.com/PowerShell/openssh-portable.git
synced 2025-07-06 13:34:50 +02:00
upstream: only consider the ext-info-c extension during the initial
KEX. It shouldn't be sent in subsequent ones, but if it is present we should ignore it. This prevents sshd from sending a SSH_MSG_EXT_INFO for REKEX for buggy these clients. Reported by Jakub Jelen via bz2929; ok dtucker@ OpenBSD-Commit-ID: 91564118547f7807030ec537480303e2371902f9
This commit is contained in:
parent
63bba57a32
commit
a6a0788cbb
6
kex.c
6
kex.c
@ -1,4 +1,4 @@
|
|||||||
/* $OpenBSD: kex.c,v 1.141 2018/07/09 13:37:10 sf Exp $ */
|
/* $OpenBSD: kex.c,v 1.142 2018/12/07 03:39:40 djm Exp $ */
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2000, 2001 Markus Friedl. All rights reserved.
|
* Copyright (c) 2000, 2001 Markus Friedl. All rights reserved.
|
||||||
*
|
*
|
||||||
@ -487,6 +487,7 @@ kex_input_newkeys(int type, u_int32_t seq, struct ssh *ssh)
|
|||||||
if ((r = ssh_set_newkeys(ssh, MODE_IN)) != 0)
|
if ((r = ssh_set_newkeys(ssh, MODE_IN)) != 0)
|
||||||
return r;
|
return r;
|
||||||
kex->done = 1;
|
kex->done = 1;
|
||||||
|
kex->flags &= ~KEX_INITIAL;
|
||||||
sshbuf_reset(kex->peer);
|
sshbuf_reset(kex->peer);
|
||||||
/* sshbuf_reset(kex->my); */
|
/* sshbuf_reset(kex->my); */
|
||||||
kex->flags &= ~KEX_INIT_SENT;
|
kex->flags &= ~KEX_INIT_SENT;
|
||||||
@ -594,6 +595,7 @@ kex_new(struct ssh *ssh, char *proposal[PROPOSAL_MAX], struct kex **kexp)
|
|||||||
if ((r = kex_prop2buf(kex->my, proposal)) != 0)
|
if ((r = kex_prop2buf(kex->my, proposal)) != 0)
|
||||||
goto out;
|
goto out;
|
||||||
kex->done = 0;
|
kex->done = 0;
|
||||||
|
kex->flags = KEX_INITIAL;
|
||||||
kex_reset_dispatch(ssh);
|
kex_reset_dispatch(ssh);
|
||||||
ssh_dispatch_set(ssh, SSH2_MSG_KEXINIT, &kex_input_kexinit);
|
ssh_dispatch_set(ssh, SSH2_MSG_KEXINIT, &kex_input_kexinit);
|
||||||
r = 0;
|
r = 0;
|
||||||
@ -839,7 +841,7 @@ kex_choose_conf(struct ssh *ssh)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Check whether client supports ext_info_c */
|
/* Check whether client supports ext_info_c */
|
||||||
if (kex->server) {
|
if (kex->server && (kex->flags & KEX_INITIAL)) {
|
||||||
char *ext;
|
char *ext;
|
||||||
|
|
||||||
ext = match_list("ext-info-c", peer[PROPOSAL_KEX_ALGS], NULL);
|
ext = match_list("ext-info-c", peer[PROPOSAL_KEX_ALGS], NULL);
|
||||||
|
3
kex.h
3
kex.h
@ -1,4 +1,4 @@
|
|||||||
/* $OpenBSD: kex.h,v 1.91 2018/07/11 18:53:29 markus Exp $ */
|
/* $OpenBSD: kex.h,v 1.92 2018/12/07 03:39:40 djm Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2000, 2001 Markus Friedl. All rights reserved.
|
* Copyright (c) 2000, 2001 Markus Friedl. All rights reserved.
|
||||||
@ -104,6 +104,7 @@ enum kex_exchange {
|
|||||||
};
|
};
|
||||||
|
|
||||||
#define KEX_INIT_SENT 0x0001
|
#define KEX_INIT_SENT 0x0001
|
||||||
|
#define KEX_INITIAL 0x0002
|
||||||
|
|
||||||
struct sshenc {
|
struct sshenc {
|
||||||
char *name;
|
char *name;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user