summaryrefslogtreecommitdiffstats
path: root/test/drbgtest.c
diff options
context:
space:
mode:
authorPauli <paul.dale@oracle.com>2019-04-30 05:43:19 +0200
committerPauli <paul.dale@oracle.com>2019-04-30 05:43:19 +0200
commit8094a6945873f492fe40c88b966b86629bc6c6d7 (patch)
tree37d6dbdcd190b7a79fb7bd7b7549ac6a3eb876af /test/drbgtest.c
parentCollapse ssl3_state_st (s3) into ssl_st (diff)
downloadopenssl-8094a6945873f492fe40c88b966b86629bc6c6d7.tar.xz
openssl-8094a6945873f492fe40c88b966b86629bc6c6d7.zip
Squashed commit of the following:
Digest stored entropy for CRNG test. Via the FIPS lab, NIST confirmed: The CMVP had a chance to discuss this inquiry and we agree that hashing the NDRNG block does meet the spirit and letter of AS09.42. However, the CMVP did have a few questions: what hash algorithm would be used in this application? Is it approved? Is it CAVs tested? SHA256 is being used here and it will be both approved and CAVs tested. This means that no raw entropy needs to be kept between RNG seedings, preventing a potential attack vector aganst the randomness source and the DRBG chains. It also means the block of secure memory allocated for this purpose is no longer required. Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com> (Merged from https://github.com/openssl/openssl/pull/8790)
Diffstat (limited to 'test/drbgtest.c')
-rw-r--r--test/drbgtest.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/test/drbgtest.c b/test/drbgtest.c
index bf4c723c77..42af048699 100644
--- a/test/drbgtest.c
+++ b/test/drbgtest.c
@@ -1249,7 +1249,8 @@ static const size_t crngt_num_cases = 6;
static size_t crngt_case, crngt_idx;
-static int crngt_entropy_cb(unsigned char *buf)
+static int crngt_entropy_cb(unsigned char *buf, unsigned char *md,
+ unsigned int *md_size)
{
size_t i, z;
@@ -1261,7 +1262,7 @@ static int crngt_entropy_cb(unsigned char *buf)
z--;
for (i = 0; i < CRNGT_BUFSIZ; i++)
buf[i] = (unsigned char)(i + 'A' + z);
- return 1;
+ return EVP_Digest(buf, CRNGT_BUFSIZ, md, md_size, EVP_sha256(), NULL);
}
static int test_crngt(int n)