summaryrefslogtreecommitdiff
path: root/kexgexc.c
diff options
context:
space:
mode:
authorColin Watson <cjwatson@debian.org>2018-04-03 08:20:28 +0100
committerColin Watson <cjwatson@debian.org>2018-04-03 08:57:25 +0100
commita0b2dce9bf518f561bbb5070c0fb0c38f49035dd (patch)
tree24298b823e93d4e6efe13f48f1512707ebd625f8 /kexgexc.c
parent9d4942dc192b6f1888c9ab73a512dd9b197b956c (diff)
parent76aa43d2298f322f0371b74462418d0461537131 (diff)
New upstream release (7.7p1)
Diffstat (limited to 'kexgexc.c')
-rw-r--r--kexgexc.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/kexgexc.c b/kexgexc.c
index cd1128752..762a9a322 100644
--- a/kexgexc.c
+++ b/kexgexc.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: kexgexc.c,v 1.25 2017/05/30 14:23:52 markus Exp $ */ 1/* $OpenBSD: kexgexc.c,v 1.27 2018/02/07 02:06:51 jsing 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.
@@ -134,10 +134,8 @@ input_kex_dh_gex_group(int type, u_int32_t seq, struct ssh *ssh)
134 ssh_dispatch_set(ssh, SSH2_MSG_KEX_DH_GEX_REPLY, &input_kex_dh_gex_reply); 134 ssh_dispatch_set(ssh, SSH2_MSG_KEX_DH_GEX_REPLY, &input_kex_dh_gex_reply);
135 r = 0; 135 r = 0;
136out: 136out:
137 if (p) 137 BN_clear_free(p);
138 BN_clear_free(p); 138 BN_clear_free(g);
139 if (g)
140 BN_clear_free(g);
141 return r; 139 return r;
142} 140}
143 141
@@ -230,7 +228,7 @@ input_kex_dh_gex_reply(int type, u_int32_t seq, struct ssh *ssh)
230 goto out; 228 goto out;
231 229
232 if ((r = sshkey_verify(server_host_key, signature, slen, hash, 230 if ((r = sshkey_verify(server_host_key, signature, slen, hash,
233 hashlen, ssh->compat)) != 0) 231 hashlen, kex->hostkey_alg, ssh->compat)) != 0)
234 goto out; 232 goto out;
235 233
236 /* save session id */ 234 /* save session id */
@@ -250,14 +248,12 @@ input_kex_dh_gex_reply(int type, u_int32_t seq, struct ssh *ssh)
250 explicit_bzero(hash, sizeof(hash)); 248 explicit_bzero(hash, sizeof(hash));
251 DH_free(kex->dh); 249 DH_free(kex->dh);
252 kex->dh = NULL; 250 kex->dh = NULL;
253 if (dh_server_pub) 251 BN_clear_free(dh_server_pub);
254 BN_clear_free(dh_server_pub);
255 if (kbuf) { 252 if (kbuf) {
256 explicit_bzero(kbuf, klen); 253 explicit_bzero(kbuf, klen);
257 free(kbuf); 254 free(kbuf);
258 } 255 }
259 if (shared_secret) 256 BN_clear_free(shared_secret);
260 BN_clear_free(shared_secret);
261 sshkey_free(server_host_key); 257 sshkey_free(server_host_key);
262 free(server_host_key_blob); 258 free(server_host_key_blob);
263 free(signature); 259 free(signature);