Skip to content

Commit 0ab796e

Browse files
paulidalet8m
authored andcommitted
ctr-drbg: always use the DF for OpenSSL's DRBGs
Force the use of the derivation function when creating OpenSSL's internal DRBGs. FIPS mandates the use of a derivation function, so 3.4 cannot be validated as it stands which run counter to the indicator work that was included. Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com> Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com> Reviewed-by: Hugo Landau <hlandau@devever.net> (Merged from openssl#25511)
1 parent 4c6c697 commit 0ab796e

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

crypto/rand/rand_lib.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -642,14 +642,15 @@ EVP_RAND_CTX *ossl_rand_get0_seed_noncreating(OSSL_LIB_CTX *ctx)
642642

643643
static EVP_RAND_CTX *rand_new_drbg(OSSL_LIB_CTX *libctx, EVP_RAND_CTX *parent,
644644
unsigned int reseed_interval,
645-
time_t reseed_time_interval, int use_df)
645+
time_t reseed_time_interval)
646646
{
647647
EVP_RAND *rand;
648648
RAND_GLOBAL *dgbl = rand_get_global(libctx);
649649
EVP_RAND_CTX *ctx;
650650
OSSL_PARAM params[8], *p = params;
651651
const OSSL_PARAM *settables;
652652
char *name, *cipher;
653+
int use_df = 1;
653654

654655
if (dgbl == NULL)
655656
return NULL;
@@ -737,7 +738,7 @@ EVP_RAND_CTX *RAND_get0_primary(OSSL_LIB_CTX *ctx)
737738

738739
ret = dgbl->primary = rand_new_drbg(ctx, dgbl->seed,
739740
PRIMARY_RESEED_INTERVAL,
740-
PRIMARY_RESEED_TIME_INTERVAL, 1);
741+
PRIMARY_RESEED_TIME_INTERVAL);
741742
/*
742743
* The primary DRBG may be shared between multiple threads so we must
743744
* enable locking.
@@ -779,7 +780,7 @@ EVP_RAND_CTX *RAND_get0_public(OSSL_LIB_CTX *ctx)
779780
&& !ossl_init_thread_start(NULL, ctx, rand_delete_thread_state))
780781
return NULL;
781782
rand = rand_new_drbg(ctx, primary, SECONDARY_RESEED_INTERVAL,
782-
SECONDARY_RESEED_TIME_INTERVAL, 0);
783+
SECONDARY_RESEED_TIME_INTERVAL);
783784
CRYPTO_THREAD_set_local(&dgbl->public, rand);
784785
}
785786
return rand;
@@ -812,7 +813,7 @@ EVP_RAND_CTX *RAND_get0_private(OSSL_LIB_CTX *ctx)
812813
&& !ossl_init_thread_start(NULL, ctx, rand_delete_thread_state))
813814
return NULL;
814815
rand = rand_new_drbg(ctx, primary, SECONDARY_RESEED_INTERVAL,
815-
SECONDARY_RESEED_TIME_INTERVAL, 0);
816+
SECONDARY_RESEED_TIME_INTERVAL);
816817
CRYPTO_THREAD_set_local(&dgbl->private, rand);
817818
}
818819
return rand;

0 commit comments

Comments
 (0)