http://downloads.netgear.com/files/GPL/GPL_Source_V361j_DM111PSP_series_consumer_rele...
[bcm963xx.git] / userapps / opensource / openssl / crypto / rand / rand_lib.c
old mode 100755 (executable)
new mode 100644 (file)
index 513e338..88f1b56
@@ -63,6 +63,8 @@
 #ifndef OPENSSL_NO_ENGINE
 #include <openssl/engine.h>
 #endif
+#include <openssl/fips.h>
+#include <openssl/fips_rand.h>
 
 #ifndef OPENSSL_NO_ENGINE
 /* non-NULL if default_RAND_meth is ENGINE-provided */
@@ -85,6 +87,16 @@ 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