summaryrefslogtreecommitdiff
path: root/kexc25519s.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 /kexc25519s.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 'kexc25519s.c')
-rw-r--r--kexc25519s.c13
1 files changed, 1 insertions, 12 deletions
diff --git a/kexc25519s.c b/kexc25519s.c
index 9ff74d912..65df18c4b 100644
--- a/kexc25519s.c
+++ b/kexc25519s.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: kexc25519s.c,v 1.13 2019/01/19 21:43:56 djm Exp $ */ 1/* $OpenBSD: kexc25519s.c,v 1.14 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 * Copyright (c) 2010 Damien Miller. All rights reserved. 4 * Copyright (c) 2010 Damien Miller. All rights reserved.
@@ -121,17 +121,6 @@ input_kex_c25519_init(int type, u_int32_t seq, struct ssh *ssh)
121 hash, &hashlen)) < 0) 121 hash, &hashlen)) < 0)
122 goto out; 122 goto out;
123 123
124 /* save session id := H */
125 if (kex->session_id == NULL) {
126 kex->session_id_len = hashlen;
127 kex->session_id = malloc(kex->session_id_len);
128 if (kex->session_id == NULL) {
129 r = SSH_ERR_ALLOC_FAIL;
130 goto out;
131 }
132 memcpy(kex->session_id, hash, kex->session_id_len);
133 }
134
135 /* sign H */ 124 /* sign H */
136 if ((r = kex->sign(ssh, server_host_private, server_host_public, 125 if ((r = kex->sign(ssh, server_host_private, server_host_public,
137 &signature, &slen, hash, hashlen, kex->hostkey_alg)) < 0) 126 &signature, &slen, hash, hashlen, kex->hostkey_alg)) < 0)