summaryrefslogtreecommitdiff
path: root/kexgexc.c
diff options
context:
space:
mode:
authorjsing@openbsd.org <jsing@openbsd.org>2018-02-07 02:06:50 +0000
committerDarren Tucker <dtucker@dtucker.net>2018-02-08 09:26:27 +1100
commit7cd31632e3a6607170ed0c9ed413a7ded5b9b377 (patch)
tree2acf74a8e668468768bdf9fe1b48d2289b3299bb /kexgexc.c
parent3c000d57d46882eb736c6563edfc4995915c24a2 (diff)
upstream commit
Remove all guards for calls to OpenSSL free functions - all of these functions handle NULL, from at least OpenSSL 1.0.1g onwards. Prompted by dtucker@ asking about guards for RSA_free(), when looking at openssh-portable pr#84 on github. ok deraadt@ dtucker@ OpenBSD-Commit-ID: 954f1c51b94297d0ae1f749271e184141e0cadae
Diffstat (limited to 'kexgexc.c')
-rw-r--r--kexgexc.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/kexgexc.c b/kexgexc.c
index 6f8cf48a..762a9a32 100644
--- a/kexgexc.c
+++ b/kexgexc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kexgexc.c,v 1.26 2017/12/18 02:25:15 djm Exp $ */
+/* $OpenBSD: kexgexc.c,v 1.27 2018/02/07 02:06:51 jsing Exp $ */
/*
* Copyright (c) 2000 Niels Provos. All rights reserved.
* 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)
ssh_dispatch_set(ssh, SSH2_MSG_KEX_DH_GEX_REPLY, &input_kex_dh_gex_reply);
r = 0;
out:
- if (p)
- BN_clear_free(p);
- if (g)
- BN_clear_free(g);
+ BN_clear_free(p);
+ BN_clear_free(g);
return r;
}
@@ -250,14 +248,12 @@ input_kex_dh_gex_reply(int type, u_int32_t seq, struct ssh *ssh)
explicit_bzero(hash, sizeof(hash));
DH_free(kex->dh);
kex->dh = NULL;
- if (dh_server_pub)
- BN_clear_free(dh_server_pub);
+ BN_clear_free(dh_server_pub);
if (kbuf) {
explicit_bzero(kbuf, klen);
free(kbuf);
}
- if (shared_secret)
- BN_clear_free(shared_secret);
+ BN_clear_free(shared_secret);
sshkey_free(server_host_key);
free(server_host_key_blob);
free(signature);