summaryrefslogtreecommitdiffstats
path: root/crypto/bn
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2002-11-29 11:30:45 +0000
committerRichard Levitte <levitte@openssl.org>2002-11-29 11:30:45 +0000
commit43d601641f3476962c580c3b0490874a6e79d260 (patch)
treec9b4b7cc1f30dfdb419930e45aabf8a46e43a460 /crypto/bn
parent55f78baf32f213301a0e8d6c6e7f40bd3b9857b1 (diff)
A few more memset()s converted to OPENSSL_cleanse().
I *think* I got them all covered by now, bu please, if you find any more, tell me and I'll correct it. PR: 343
Diffstat (limited to 'crypto/bn')
-rw-r--r--crypto/bn/bn_lib.c4
-rw-r--r--crypto/bn/bn_rand.c2
2 files changed, 3 insertions, 3 deletions
diff --git a/crypto/bn/bn_lib.c b/crypto/bn/bn_lib.c
index fc610e0438..bbcc62d831 100644
--- a/crypto/bn/bn_lib.c
+++ b/crypto/bn/bn_lib.c
@@ -263,12 +263,12 @@ void BN_clear_free(BIGNUM *a)
if (a == NULL) return;
if (a->d != NULL)
{
- memset(a->d,0,a->dmax*sizeof(a->d[0]));
+ OPENSSL_cleanse(a->d,a->dmax*sizeof(a->d[0]));
if (!(BN_get_flags(a,BN_FLG_STATIC_DATA)))
OPENSSL_free(a->d);
}
i=BN_get_flags(a,BN_FLG_MALLOCED);
- memset(a,0,sizeof(BIGNUM));
+ OPENSSL_cleanse(a,sizeof(BIGNUM));
if (i)
OPENSSL_free(a);
}
diff --git a/crypto/bn/bn_rand.c b/crypto/bn/bn_rand.c
index e6705f7025..480817a4b6 100644
--- a/crypto/bn/bn_rand.c
+++ b/crypto/bn/bn_rand.c
@@ -201,7 +201,7 @@ static int bnrand(int pseudorand, BIGNUM *rnd, int bits, int top, int bottom)
err:
if (buf != NULL)
{
- memset(buf,0,bytes);
+ OPENSSL_cleanse(buf,bytes);
OPENSSL_free(buf);
}
return(ret);