summaryrefslogtreecommitdiffstats
path: root/lib/libcrypto/rsa/rsa_saos.c
diff options
context:
space:
mode:
authorbeck <beck@openbsd.org>2017-04-28 22:46:40 +0000
committerbeck <beck@openbsd.org>2017-04-28 22:46:40 +0000
commit0a005823a4567ef0752140d8fe858ff08cd589b3 (patch)
treef3f330ffdd35a123bdc77b171859ec7e59b451a4 /lib/libcrypto/rsa/rsa_saos.c
parent*** empty log message *** (diff)
downloadwireguard-openbsd-0a005823a4567ef0752140d8fe858ff08cd589b3.tar.xz
wireguard-openbsd-0a005823a4567ef0752140d8fe858ff08cd589b3.zip
revert previous accidental commit
Diffstat (limited to 'lib/libcrypto/rsa/rsa_saos.c')
-rw-r--r--lib/libcrypto/rsa/rsa_saos.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/libcrypto/rsa/rsa_saos.c b/lib/libcrypto/rsa/rsa_saos.c
index 50522b972a0..10184b6c184 100644
--- a/lib/libcrypto/rsa/rsa_saos.c
+++ b/lib/libcrypto/rsa/rsa_saos.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rsa_saos.c,v 1.21 2017/04/28 22:38:51 beck Exp $ */
+/* $OpenBSD: rsa_saos.c,v 1.22 2017/04/28 22:46:40 beck Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -96,8 +96,8 @@ RSA_sign_ASN1_OCTET_STRING(int type, const unsigned char *m, unsigned int m_len,
else
*siglen = i;
- freezero(s, (unsigned int)j + 1);
-
+ explicit_bzero(s, (unsigned int)j + 1);
+ free(s);
return ret;
}
@@ -137,7 +137,9 @@ RSA_verify_ASN1_OCTET_STRING(int dtype, const unsigned char *m,
ret = 1;
err:
ASN1_OCTET_STRING_free(sig);
- freezero(s, siglen);
-
+ if (s != NULL) {
+ explicit_bzero(s, (unsigned int)siglen);
+ free(s);
+ }
return ret;
}