summaryrefslogtreecommitdiff
path: root/usr.bin/ssh/dh.c
diff options
context:
space:
mode:
authorMarkus Friedl <markus@cvs.openbsd.org>2001-12-27 19:37:24 +0000
committerMarkus Friedl <markus@cvs.openbsd.org>2001-12-27 19:37:24 +0000
commit4abf2ad9b8fcd61c0147e8a9d170f10b4f2d9943 (patch)
tree8167f9d1acc50f963fc5dd278893ff954c8690c1 /usr.bin/ssh/dh.c
parent54440b2f1a69e9a1135857d8ddbd236a16861d90 (diff)
always use BN_clear_free instead of BN_free
Diffstat (limited to 'usr.bin/ssh/dh.c')
-rw-r--r--usr.bin/ssh/dh.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/usr.bin/ssh/dh.c b/usr.bin/ssh/dh.c
index a5d6f379c6b..3e1594eae79 100644
--- a/usr.bin/ssh/dh.c
+++ b/usr.bin/ssh/dh.c
@@ -23,7 +23,7 @@
*/
#include "includes.h"
-RCSID("$OpenBSD: dh.c,v 1.18 2001/12/27 18:22:16 markus Exp $");
+RCSID("$OpenBSD: dh.c,v 1.19 2001/12/27 19:37:22 markus Exp $");
#include "xmalloc.h"
@@ -94,8 +94,8 @@ parse_prime(int linenum, char *line, struct dhgroup *dhg)
return (1);
failclean:
- BN_free(dhg->g);
- BN_free(dhg->p);
+ BN_clear_free(dhg->g);
+ BN_clear_free(dhg->p);
fail:
error("Bad prime description in line %d", linenum);
return (0);
@@ -122,8 +122,8 @@ choose_dh(int min, int wantbits, int max)
linenum++;
if (!parse_prime(linenum, line, &dhg))
continue;
- BN_free(dhg.g);
- BN_free(dhg.p);
+ BN_clear_free(dhg.g);
+ BN_clear_free(dhg.p);
if (dhg.size > max || dhg.size < min)
continue;
@@ -152,8 +152,8 @@ choose_dh(int min, int wantbits, int max)
if ((dhg.size > max || dhg.size < min) ||
dhg.size != best ||
linenum++ != which) {
- BN_free(dhg.g);
- BN_free(dhg.p);
+ BN_clear_free(dhg.g);
+ BN_clear_free(dhg.p);
continue;
}
break;
@@ -203,7 +203,7 @@ dh_gen_key(DH *dh, int need)
BN_num_bits(dh->p), 2*need);
do {
if (dh->priv_key != NULL)
- BN_free(dh->priv_key);
+ BN_clear_free(dh->priv_key);
if ((dh->priv_key = BN_new()) == NULL)
fatal("dh_gen_key: BN_new failed");
/* generate a 2*need bits random private exponent */