Default sensibly when in FIPS mode.
This commit is contained in:
parent
e85e5ca5ec
commit
7450139b8b
@ -87,16 +87,6 @@ int RAND_set_rand_method(const RAND_METHOD *meth)
|
||||
|
||||
const RAND_METHOD *RAND_get_rand_method(void)
|
||||
{
|
||||
#ifdef OPENSSL_FIPS
|
||||
if(FIPS_mode()
|
||||
&& default_RAND_meth != FIPS_rand_check())
|
||||
{
|
||||
RANDerr(RAND_F_RAND_GET_RAND_METHOD,RAND_R_NON_FIPS_METHOD);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
if (!default_RAND_meth)
|
||||
{
|
||||
#ifndef OPENSSL_NO_ENGINE
|
||||
@ -113,9 +103,23 @@ const RAND_METHOD *RAND_get_rand_method(void)
|
||||
if(e)
|
||||
funct_ref = e;
|
||||
else
|
||||
#endif
|
||||
#ifdef OPENSSL_FIPS
|
||||
if(FIPS_mode())
|
||||
default_RAND_meth=FIPS_rand_method();
|
||||
else
|
||||
#endif
|
||||
default_RAND_meth = RAND_SSLeay();
|
||||
}
|
||||
|
||||
#ifdef OPENSSL_FIPS
|
||||
if(FIPS_mode()
|
||||
&& default_RAND_meth != FIPS_rand_check())
|
||||
{
|
||||
RANDerr(RAND_F_RAND_GET_RAND_METHOD,RAND_R_NON_FIPS_METHOD);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
return default_RAND_meth;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user