summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjsing <jsing@openbsd.org>2018-05-12 17:31:41 +0000
committerjsing <jsing@openbsd.org>2018-05-12 17:31:41 +0000
commitedf3a05cb38e4243d43ce6a299db4be82f09a542 (patch)
treef26186c39c02d77e780069a2a2be87730b5a34a6
parentIf we fail to decode an EC point format extension, send a decode_error (diff)
downloadwireguard-openbsd-edf3a05cb38e4243d43ce6a299db4be82f09a542.tar.xz
wireguard-openbsd-edf3a05cb38e4243d43ce6a299db4be82f09a542.zip
Use explicit_bzero() rather than memset() when clearing a BIGNUM.
ok bcook@ tb@
-rw-r--r--lib/libcrypto/bn/bn_lib.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libcrypto/bn/bn_lib.c b/lib/libcrypto/bn/bn_lib.c
index ffb5ee7c2eb..c480ae8b9db 100644
--- a/lib/libcrypto/bn/bn_lib.c
+++ b/lib/libcrypto/bn/bn_lib.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bn_lib.c,v 1.39 2018/02/20 17:13:14 jsing Exp $ */
+/* $OpenBSD: bn_lib.c,v 1.40 2018/05/12 17:31:41 jsing Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -529,7 +529,7 @@ BN_clear(BIGNUM *a)
{
bn_check_top(a);
if (a->d != NULL)
- memset(a->d, 0, a->dmax * sizeof(a->d[0]));
+ explicit_bzero(a->d, a->dmax * sizeof(a->d[0]));
a->top = 0;
a->neg = 0;
}