Skip to content

Commit 260ecea

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) (cherry picked from commit 0ab796e)
1 parent 9d71a66 commit 260ecea

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;
@@ -763,7 +764,7 @@ EVP_RAND_CTX *RAND_get0_primary(OSSL_LIB_CTX *ctx)
763764
ERR_pop_to_mark();
764765
}
765766
ret = rand_new_drbg(ctx, dgbl->seed, PRIMARY_RESEED_INTERVAL,
766-
PRIMARY_RESEED_TIME_INTERVAL, 1);
767+
PRIMARY_RESEED_TIME_INTERVAL);
767768
#endif
768769

769770
/*
@@ -808,7 +809,7 @@ EVP_RAND_CTX *RAND_get0_public(OSSL_LIB_CTX *ctx)
808809
&& !ossl_init_thread_start(NULL, ctx, rand_delete_thread_state))
809810
return NULL;
810811
rand = rand_new_drbg(ctx, primary, SECONDARY_RESEED_INTERVAL,
811-
SECONDARY_RESEED_TIME_INTERVAL, 0);
812+
SECONDARY_RESEED_TIME_INTERVAL);
812813
CRYPTO_THREAD_set_local(&dgbl->public, rand);
813814
}
814815
return rand;
@@ -841,7 +842,7 @@ EVP_RAND_CTX *RAND_get0_private(OSSL_LIB_CTX *ctx)
841842
&& !ossl_init_thread_start(NULL, ctx, rand_delete_thread_state))
842843
return NULL;
843844
rand = rand_new_drbg(ctx, primary, SECONDARY_RESEED_INTERVAL,
844-
SECONDARY_RESEED_TIME_INTERVAL, 0);
845+
SECONDARY_RESEED_TIME_INTERVAL);
845846
CRYPTO_THREAD_set_local(&dgbl->private, rand);
846847
}
847848
return rand;

0 commit comments

Comments
 (0)