diff options
author | markus@openbsd.org <markus@openbsd.org> | 2016-10-10 19:28:48 +0000 |
---|---|---|
committer | Colin Watson <cjwatson@debian.org> | 2016-10-24 11:12:15 +0100 |
commit | b139635512b1af75e82252c0c71ac66e08b78774 (patch) | |
tree | 1440fe1b02a88224a5f077ec8d4905ae5ead96ec /kex.c | |
parent | 4c914ccd85bbf391c4dc61b85e3c178fef465e3f (diff) |
upstream commit
Unregister the KEXINIT handler after message has been
received. Otherwise an unauthenticated peer can repeat the KEXINIT and cause
allocation of up to 128MB -- until the connection is closed. Reported by
shilei-c at 360.cn
Upstream-ID: 43649ae12a27ef94290db16d1a98294588b75c05
Origin: https://anongit.mindrot.org/openssh.git/commit/?id=ec165c392ca54317dbe3064a8c200de6531e89ad
Bug-Debian: https://bugs.debian.org/841884
Bug-Fedora: https://bugzilla.redhat.com/show_bug.cgi?id=1384860
Last-Update: 2016-10-24
Patch-Name: unregister-kexinit.patch
Diffstat (limited to 'kex.c')
-rw-r--r-- | kex.c | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -488,6 +488,7 @@ kex_input_kexinit(int type, u_int32_t seq, void *ctxt) | |||
488 | if (kex == NULL) | 488 | if (kex == NULL) |
489 | return SSH_ERR_INVALID_ARGUMENT; | 489 | return SSH_ERR_INVALID_ARGUMENT; |
490 | 490 | ||
491 | ssh_dispatch_set(ssh, SSH2_MSG_KEXINIT, NULL); | ||
491 | ptr = sshpkt_ptr(ssh, &dlen); | 492 | ptr = sshpkt_ptr(ssh, &dlen); |
492 | if ((r = sshbuf_put(kex->peer, ptr, dlen)) != 0) | 493 | if ((r = sshbuf_put(kex->peer, ptr, dlen)) != 0) |
493 | return r; | 494 | return r; |