diff options
author | djm@openbsd.org <djm@openbsd.org> | 2019-01-21 09:55:52 +0000 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2019-01-21 21:47:28 +1100 |
commit | 5ae3f6d314465026d028af82609c1d49ad197655 (patch) | |
tree | 6fa154f6478dd9b35d90716573420f3c517c49ab /kexdhc.c | |
parent | 7be8572b32a15d5c3dba897f252e2e04e991c307 (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 'kexdhc.c')
-rw-r--r-- | kexdhc.c | 13 |
1 files changed, 1 insertions, 12 deletions
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: kexdhc.c,v 1.25 2019/01/21 09:54:11 djm Exp $ */ | 1 | /* $OpenBSD: kexdhc.c,v 1.26 2019/01/21 09:55:52 djm Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2001 Markus Friedl. All rights reserved. | 3 | * Copyright (c) 2001 Markus Friedl. All rights reserved. |
4 | * | 4 | * |
@@ -188,17 +188,6 @@ input_kex_dh(int type, u_int32_t seq, struct ssh *ssh) | |||
188 | kex->hostkey_alg, ssh->compat)) != 0) | 188 | kex->hostkey_alg, ssh->compat)) != 0) |
189 | goto out; | 189 | goto out; |
190 | 190 | ||
191 | /* save session id */ | ||
192 | if (kex->session_id == NULL) { | ||
193 | kex->session_id_len = hashlen; | ||
194 | kex->session_id = malloc(kex->session_id_len); | ||
195 | if (kex->session_id == NULL) { | ||
196 | r = SSH_ERR_ALLOC_FAIL; | ||
197 | goto out; | ||
198 | } | ||
199 | memcpy(kex->session_id, hash, kex->session_id_len); | ||
200 | } | ||
201 | |||
202 | if ((r = kex_derive_keys_bn(ssh, hash, hashlen, shared_secret)) == 0) | 191 | if ((r = kex_derive_keys_bn(ssh, hash, hashlen, shared_secret)) == 0) |
203 | r = kex_send_newkeys(ssh); | 192 | r = kex_send_newkeys(ssh); |
204 | out: | 193 | out: |