summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/bn/bn_lib.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/bn/bn_lib.c')
-rw-r--r--src/lib/libcrypto/bn/bn_lib.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/lib/libcrypto/bn/bn_lib.c b/src/lib/libcrypto/bn/bn_lib.c
index f2736e31c3..8aeeb5304f 100644
--- a/src/lib/libcrypto/bn/bn_lib.c
+++ b/src/lib/libcrypto/bn/bn_lib.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_lib.c,v 1.37 2017/01/29 17:49:22 beck Exp $ */ 1/* $OpenBSD: bn_lib.c,v 1.38 2017/05/02 03:59:44 deraadt Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -220,10 +220,8 @@ BN_clear_free(BIGNUM *a)
220 if (a == NULL) 220 if (a == NULL)
221 return; 221 return;
222 bn_check_top(a); 222 bn_check_top(a);
223 if (a->d != NULL && !(BN_get_flags(a, BN_FLG_STATIC_DATA))) { 223 if (a->d != NULL && !(BN_get_flags(a, BN_FLG_STATIC_DATA)))
224 explicit_bzero(a->d, a->dmax * sizeof(a->d[0])); 224 freezero(a->d, a->dmax * sizeof(a->d[0]));
225 free(a->d);
226 }
227 i = BN_get_flags(a, BN_FLG_MALLOCED); 225 i = BN_get_flags(a, BN_FLG_MALLOCED);
228 explicit_bzero(a, sizeof(BIGNUM)); 226 explicit_bzero(a, sizeof(BIGNUM));
229 if (i) 227 if (i)
@@ -393,10 +391,8 @@ bn_expand2(BIGNUM *b, int words)
393 BN_ULONG *a = bn_expand_internal(b, words); 391 BN_ULONG *a = bn_expand_internal(b, words);
394 if (!a) 392 if (!a)
395 return NULL; 393 return NULL;
396 if (b->d) { 394 if (b->d)
397 explicit_bzero(b->d, b->dmax * sizeof(b->d[0])); 395 freezero(b->d, b->dmax * sizeof(b->d[0]));
398 free(b->d);
399 }
400 b->d = a; 396 b->d = a;
401 b->dmax = words; 397 b->dmax = words;
402 } 398 }