summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/rand/rand_lib.c
diff options
context:
space:
mode:
authordjm <>2006-06-27 05:05:42 +0000
committerdjm <>2006-06-27 05:05:42 +0000
commitf6198d4d0ab97685dc56be2d48715ed39fcc74b9 (patch)
tree6e28360095ed5ba5ef1760a419c43eef4ef6946b /src/lib/libcrypto/rand/rand_lib.c
parent0ff0f9d99c40072de315264b0f602bd639e7f662 (diff)
downloadopenbsd-f6198d4d0ab97685dc56be2d48715ed39fcc74b9.tar.gz
openbsd-f6198d4d0ab97685dc56be2d48715ed39fcc74b9.tar.bz2
openbsd-f6198d4d0ab97685dc56be2d48715ed39fcc74b9.zip
import of openssl-0.9.7j
Diffstat (limited to 'src/lib/libcrypto/rand/rand_lib.c')
-rw-r--r--src/lib/libcrypto/rand/rand_lib.c26
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
88const RAND_METHOD *RAND_get_rand_method(void) 88const 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