diff options
Diffstat (limited to 'src/lib/libcrypto/rand/md_rand.c')
| -rw-r--r-- | src/lib/libcrypto/rand/md_rand.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/lib/libcrypto/rand/md_rand.c b/src/lib/libcrypto/rand/md_rand.c index eeffc0df4c..c84968df88 100644 --- a/src/lib/libcrypto/rand/md_rand.c +++ b/src/lib/libcrypto/rand/md_rand.c | |||
| @@ -126,6 +126,7 @@ | |||
| 126 | 126 | ||
| 127 | #include <openssl/crypto.h> | 127 | #include <openssl/crypto.h> |
| 128 | #include <openssl/err.h> | 128 | #include <openssl/err.h> |
| 129 | #include <openssl/fips.h> | ||
| 129 | 130 | ||
| 130 | #ifdef BN_DEBUG | 131 | #ifdef BN_DEBUG |
| 131 | # define PREDICT | 132 | # define PREDICT |
| @@ -332,6 +333,14 @@ static int ssleay_rand_bytes(unsigned char *buf, int num) | |||
| 332 | #endif | 333 | #endif |
| 333 | int do_stir_pool = 0; | 334 | int do_stir_pool = 0; |
| 334 | 335 | ||
| 336 | #ifdef OPENSSL_FIPS | ||
| 337 | if(FIPS_mode()) | ||
| 338 | { | ||
| 339 | FIPSerr(FIPS_F_SSLEAY_RAND_BYTES,FIPS_R_NON_FIPS_METHOD); | ||
| 340 | return 0; | ||
| 341 | } | ||
| 342 | #endif | ||
| 343 | |||
| 335 | #ifdef PREDICT | 344 | #ifdef PREDICT |
| 336 | if (rand_predictable) | 345 | if (rand_predictable) |
| 337 | { | 346 | { |
