diff options
Diffstat (limited to 'src/lib/libcrypto/rand/rand_lib.c')
| -rw-r--r-- | src/lib/libcrypto/rand/rand_lib.c | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/src/lib/libcrypto/rand/rand_lib.c b/src/lib/libcrypto/rand/rand_lib.c index 88f1b56d91..a21bde79de 100644 --- a/src/lib/libcrypto/rand/rand_lib.c +++ b/src/lib/libcrypto/rand/rand_lib.c | |||
| @@ -87,16 +87,6 @@ int RAND_set_rand_method(const RAND_METHOD *meth) | |||
| 87 | 87 | ||
| 88 | const RAND_METHOD *RAND_get_rand_method(void) | 88 | const RAND_METHOD *RAND_get_rand_method(void) |
| 89 | { | 89 | { |
| 90 | #ifdef OPENSSL_FIPS | ||
| 91 | if(FIPS_mode() | ||
| 92 | && default_RAND_meth != FIPS_rand_check()) | ||
| 93 | { | ||
| 94 | RANDerr(RAND_F_RAND_GET_RAND_METHOD,RAND_R_NON_FIPS_METHOD); | ||
| 95 | return 0; | ||
| 96 | } | ||
| 97 | #endif | ||
| 98 | |||
| 99 | |||
| 100 | if (!default_RAND_meth) | 90 | if (!default_RAND_meth) |
| 101 | { | 91 | { |
| 102 | #ifndef OPENSSL_NO_ENGINE | 92 | #ifndef OPENSSL_NO_ENGINE |
| @@ -114,8 +104,22 @@ const RAND_METHOD *RAND_get_rand_method(void) | |||
| 114 | funct_ref = e; | 104 | funct_ref = e; |
| 115 | else | 105 | else |
| 116 | #endif | 106 | #endif |
| 117 | default_RAND_meth = RAND_SSLeay(); | 107 | #ifdef OPENSSL_FIPS |
| 108 | if(FIPS_mode()) | ||
| 109 | default_RAND_meth=FIPS_rand_method(); | ||
| 110 | else | ||
| 111 | #endif | ||
| 112 | default_RAND_meth = RAND_SSLeay(); | ||
| 118 | } | 113 | } |
| 114 | |||
| 115 | #ifdef OPENSSL_FIPS | ||
| 116 | if(FIPS_mode() | ||
| 117 | && default_RAND_meth != FIPS_rand_check()) | ||
| 118 | { | ||
| 119 | RANDerr(RAND_F_RAND_GET_RAND_METHOD,RAND_R_NON_FIPS_METHOD); | ||
| 120 | return 0; | ||
| 121 | } | ||
| 122 | #endif | ||
| 119 | return default_RAND_meth; | 123 | return default_RAND_meth; |
| 120 | } | 124 | } |
| 121 | 125 | ||
