diff options
author | Damien Miller <djm@mindrot.org> | 2002-01-22 23:10:33 +1100 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2002-01-22 23:10:33 +1100 |
commit | 9ef95ddcaf41b2c66bc3c1efc1d71b2fe568e01a (patch) | |
tree | b7621a6d83f94b1b4a46d8eddacd5066ecaa5d64 /dh.c | |
parent | 040b64f60a4bbcc0da4521847e0526132b3aaac1 (diff) |
- markus@cvs.openbsd.org 2001/12/27 19:37:23
[dh.c kexdh.c kexgex.c]
always use BN_clear_free instead of BN_free
Diffstat (limited to 'dh.c')
-rw-r--r-- | dh.c | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -23,7 +23,7 @@ | |||
23 | */ | 23 | */ |
24 | 24 | ||
25 | #include "includes.h" | 25 | #include "includes.h" |
26 | RCSID("$OpenBSD: dh.c,v 1.18 2001/12/27 18:22:16 markus Exp $"); | 26 | RCSID("$OpenBSD: dh.c,v 1.19 2001/12/27 19:37:22 markus Exp $"); |
27 | 27 | ||
28 | #include "xmalloc.h" | 28 | #include "xmalloc.h" |
29 | 29 | ||
@@ -94,8 +94,8 @@ parse_prime(int linenum, char *line, struct dhgroup *dhg) | |||
94 | return (1); | 94 | return (1); |
95 | 95 | ||
96 | failclean: | 96 | failclean: |
97 | BN_free(dhg->g); | 97 | BN_clear_free(dhg->g); |
98 | BN_free(dhg->p); | 98 | BN_clear_free(dhg->p); |
99 | fail: | 99 | fail: |
100 | error("Bad prime description in line %d", linenum); | 100 | error("Bad prime description in line %d", linenum); |
101 | return (0); | 101 | return (0); |
@@ -122,8 +122,8 @@ choose_dh(int min, int wantbits, int max) | |||
122 | linenum++; | 122 | linenum++; |
123 | if (!parse_prime(linenum, line, &dhg)) | 123 | if (!parse_prime(linenum, line, &dhg)) |
124 | continue; | 124 | continue; |
125 | BN_free(dhg.g); | 125 | BN_clear_free(dhg.g); |
126 | BN_free(dhg.p); | 126 | BN_clear_free(dhg.p); |
127 | 127 | ||
128 | if (dhg.size > max || dhg.size < min) | 128 | if (dhg.size > max || dhg.size < min) |
129 | continue; | 129 | continue; |
@@ -152,8 +152,8 @@ choose_dh(int min, int wantbits, int max) | |||
152 | if ((dhg.size > max || dhg.size < min) || | 152 | if ((dhg.size > max || dhg.size < min) || |
153 | dhg.size != best || | 153 | dhg.size != best || |
154 | linenum++ != which) { | 154 | linenum++ != which) { |
155 | BN_free(dhg.g); | 155 | BN_clear_free(dhg.g); |
156 | BN_free(dhg.p); | 156 | BN_clear_free(dhg.p); |
157 | continue; | 157 | continue; |
158 | } | 158 | } |
159 | break; | 159 | break; |
@@ -203,7 +203,7 @@ dh_gen_key(DH *dh, int need) | |||
203 | BN_num_bits(dh->p), 2*need); | 203 | BN_num_bits(dh->p), 2*need); |
204 | do { | 204 | do { |
205 | if (dh->priv_key != NULL) | 205 | if (dh->priv_key != NULL) |
206 | BN_free(dh->priv_key); | 206 | BN_clear_free(dh->priv_key); |
207 | if ((dh->priv_key = BN_new()) == NULL) | 207 | if ((dh->priv_key = BN_new()) == NULL) |
208 | fatal("dh_gen_key: BN_new failed"); | 208 | fatal("dh_gen_key: BN_new failed"); |
209 | /* generate a 2*need bits random private exponent */ | 209 | /* generate a 2*need bits random private exponent */ |