summaryrefslogtreecommitdiff
path: root/kexgexs.c
diff options
context:
space:
mode:
authordjm@openbsd.org <djm@openbsd.org>2019-01-21 09:55:52 +0000
committerDamien Miller <djm@mindrot.org>2019-01-21 21:47:28 +1100
commit5ae3f6d314465026d028af82609c1d49ad197655 (patch)
tree6fa154f6478dd9b35d90716573420f3c517c49ab /kexgexs.c
parent7be8572b32a15d5c3dba897f252e2e04e991c307 (diff)
upstream: save the derived session id in kex_derive_keys() rather
than making each kex method implementation do it. from markus@ ok djm@ OpenBSD-Commit-ID: d61ade9c8d1e13f665f8663c552abff8c8a30673
Diffstat (limited to 'kexgexs.c')
-rw-r--r--kexgexs.c13
1 files changed, 1 insertions, 12 deletions
diff --git a/kexgexs.c b/kexgexs.c
index 2a8997302..4ffbb1918 100644
--- a/kexgexs.c
+++ b/kexgexs.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: kexgexs.c,v 1.38 2019/01/21 09:54:11 djm Exp $ */ 1/* $OpenBSD: kexgexs.c,v 1.39 2019/01/21 09:55:52 djm Exp $ */
2/* 2/*
3 * Copyright (c) 2000 Niels Provos. All rights reserved. 3 * Copyright (c) 2000 Niels Provos. All rights reserved.
4 * Copyright (c) 2001 Markus Friedl. All rights reserved. 4 * Copyright (c) 2001 Markus Friedl. All rights reserved.
@@ -207,17 +207,6 @@ input_kex_dh_gex_init(int type, u_int32_t seq, struct ssh *ssh)
207 hash, &hashlen)) != 0) 207 hash, &hashlen)) != 0)
208 goto out; 208 goto out;
209 209
210 /* save session id := H */
211 if (kex->session_id == NULL) {
212 kex->session_id_len = hashlen;
213 kex->session_id = malloc(kex->session_id_len);
214 if (kex->session_id == NULL) {
215 r = SSH_ERR_ALLOC_FAIL;
216 goto out;
217 }
218 memcpy(kex->session_id, hash, kex->session_id_len);
219 }
220
221 /* sign H */ 210 /* sign H */
222 if ((r = kex->sign(ssh, server_host_private, server_host_public, 211 if ((r = kex->sign(ssh, server_host_private, server_host_public,
223 &signature, &slen, hash, hashlen, kex->hostkey_alg)) < 0) 212 &signature, &slen, hash, hashlen, kex->hostkey_alg)) < 0)