summaryrefslogtreecommitdiff
path: root/crypto/openssl/crypto/rand/md_rand.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/openssl/crypto/rand/md_rand.c')
-rw-r--r--crypto/openssl/crypto/rand/md_rand.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/crypto/openssl/crypto/rand/md_rand.c b/crypto/openssl/crypto/rand/md_rand.c
index eeffc0df4cb3..c84968df88fe 100644
--- a/crypto/openssl/crypto/rand/md_rand.c
+++ b/crypto/openssl/crypto/rand/md_rand.c
@@ -126,6 +126,7 @@
#include <openssl/crypto.h>
#include <openssl/err.h>
+#include <openssl/fips.h>
#ifdef BN_DEBUG
# define PREDICT
@@ -332,6 +333,14 @@ static int ssleay_rand_bytes(unsigned char *buf, int num)
#endif
int do_stir_pool = 0;
+#ifdef OPENSSL_FIPS
+ if(FIPS_mode())
+ {
+ FIPSerr(FIPS_F_SSLEAY_RAND_BYTES,FIPS_R_NON_FIPS_METHOD);
+ return 0;
+ }
+#endif
+
#ifdef PREDICT
if (rand_predictable)
{