summaryrefslogtreecommitdiff
path: root/debian/patches/backport-fix-first-kex-follows.patch
blob: 0333adad115098817708ec3d4d5a89f5bcde84a9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
From ed5dcc5819cd53636938bd5c30b8c5acdd1615e1 Mon Sep 17 00:00:00 2001
From: Damien Miller <djm@mindrot.org>
Date: Tue, 15 Dec 2015 15:25:04 +0000
Subject: upstream commit

unbreak connections with peers that set first_kex_follows;
fix from Matt Johnston va bz#2515

Origin: backport, http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/usr.bin/ssh/kex.c.diff?r1=1.114&r2=1.115
Forwarded: not-needed
Bug-Ubuntu: https://bugs.launchpad.net/bugs/1526357

Patch-Name: backport-fix-first-kex-follows.patch
---
 kex.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/kex.c b/kex.c
index 39a6f98..12f3e41 100644
--- a/kex.c
+++ b/kex.c
@@ -286,11 +286,11 @@ kex_buf2prop(struct sshbuf *raw, int *first_kex_follows, char ***propp)
 		debug2("kex_parse_kexinit: %s", proposal[i]);
 	}
 	/* first kex follows / reserved */
-	if ((r = sshbuf_get_u8(b, &v)) != 0 ||
-	    (r = sshbuf_get_u32(b, &i)) != 0)
+	if ((r = sshbuf_get_u8(b, &v)) != 0 ||	/* first_kex_follows */
+	    (r = sshbuf_get_u32(b, &i)) != 0)	/* reserved */
 		goto out;
 	if (first_kex_follows != NULL)
-		*first_kex_follows = i;
+		*first_kex_follows = v;
 	debug2("kex_parse_kexinit: first_kex_follows %d ", v);
 	debug2("kex_parse_kexinit: reserved %u ", i);
 	r = 0;