summaryrefslogtreecommitdiff
path: root/kexgexc.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 /kexgexc.c
parent7be8572b32a15d5c3dba897f252e2e04e991c307 (diff)
downloadopenssh-git-5ae3f6d314465026d028af82609c1d49ad197655.tar.gz
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 'kexgexc.c')
-rw-r--r--kexgexc.c13
1 files changed, 1 insertions, 12 deletions
diff --git a/kexgexc.c b/kexgexc.c
index dec01fd4..0425309d 100644
--- a/kexgexc.c
+++ b/kexgexc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kexgexc.c,v 1.30 2019/01/21 09:54:11 djm Exp $ */
+/* $OpenBSD: kexgexc.c,v 1.31 2019/01/21 09:55:52 djm Exp $ */
/*
* Copyright (c) 2000 Niels Provos. All rights reserved.
* Copyright (c) 2001 Markus Friedl. All rights reserved.
@@ -229,17 +229,6 @@ input_kex_dh_gex_reply(int type, u_int32_t seq, struct ssh *ssh)
hashlen, kex->hostkey_alg, ssh->compat)) != 0)
goto out;
- /* save session id */
- if (kex->session_id == NULL) {
- kex->session_id_len = hashlen;
- kex->session_id = malloc(kex->session_id_len);
- if (kex->session_id == NULL) {
- r = SSH_ERR_ALLOC_FAIL;
- goto out;
- }
- memcpy(kex->session_id, hash, kex->session_id_len);
- }
-
if ((r = kex_derive_keys_bn(ssh, hash, hashlen, shared_secret)) == 0)
r = kex_send_newkeys(ssh);
out: