projects
/
oweals
/
openssl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
78632b6
)
Add entropy sanity check
author
Dr. Stephen Henson
<steve@openssl.org>
Sat, 5 Aug 2017 11:04:10 +0000
(12:04 +0100)
committer
Dr. Stephen Henson
<steve@openssl.org>
Sat, 5 Aug 2017 11:04:10 +0000
(12:04 +0100)
Reviewed-by: Kurt Roeckx <kurt@roeckx.be>
(Merged from https://github.com/openssl/openssl/pull/4092)
crypto/rand/drbg_rand.c
patch
|
blob
|
history
diff --git
a/crypto/rand/drbg_rand.c
b/crypto/rand/drbg_rand.c
index 06f8affeb8282a6c2c3821e02fd1d5d1bb5d2fa7..934679e315a565814c59ca2ba524767be0f1d883 100644
(file)
--- a/
crypto/rand/drbg_rand.c
+++ b/
crypto/rand/drbg_rand.c
@@
-243,6
+243,9
@@
int ctr_instantiate(RAND_DRBG *drbg,
{
RAND_DRBG_CTR *ctr = &drbg->ctr;
+ if (ent == NULL)
+ return 0;
+
memset(ctr->K, 0, sizeof(ctr->K));
memset(ctr->V, 0, sizeof(ctr->V));
AES_set_encrypt_key(ctr->K, drbg->strength, &ctr->ks);
@@
-254,6
+257,8
@@
int ctr_reseed(RAND_DRBG *drbg,
const unsigned char *ent, size_t entlen,
const unsigned char *adin, size_t adinlen)
{
+ if (ent == NULL)
+ return 0;
ctr_update(drbg, ent, entlen, adin, adinlen, NULL, 0);
return 1;
}