diff options
author | djm <> | 2005-04-29 05:37:34 +0000 |
---|---|---|
committer | djm <> | 2005-04-29 05:37:34 +0000 |
commit | a95585a25ab25668b931a78b7543f707a3354db8 (patch) | |
tree | f9e9febf7ac0c8f5d6df761fe70fd613aac06203 /src/lib/libcrypto/rand/rand_lib.c | |
parent | 58c08aa241f168c84ce7cc3052454ea59a44eada (diff) | |
download | openbsd-a95585a25ab25668b931a78b7543f707a3354db8.tar.gz openbsd-a95585a25ab25668b931a78b7543f707a3354db8.tar.bz2 openbsd-a95585a25ab25668b931a78b7543f707a3354db8.zip |
import of openssl-0.9.7g; tested on platforms from alpha to zaurus, ok deraadt@
Diffstat (limited to 'src/lib/libcrypto/rand/rand_lib.c')
-rw-r--r-- | src/lib/libcrypto/rand/rand_lib.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/lib/libcrypto/rand/rand_lib.c b/src/lib/libcrypto/rand/rand_lib.c index 513e338985..88f1b56d91 100644 --- a/src/lib/libcrypto/rand/rand_lib.c +++ b/src/lib/libcrypto/rand/rand_lib.c | |||
@@ -63,6 +63,8 @@ | |||
63 | #ifndef OPENSSL_NO_ENGINE | 63 | #ifndef OPENSSL_NO_ENGINE |
64 | #include <openssl/engine.h> | 64 | #include <openssl/engine.h> |
65 | #endif | 65 | #endif |
66 | #include <openssl/fips.h> | ||
67 | #include <openssl/fips_rand.h> | ||
66 | 68 | ||
67 | #ifndef OPENSSL_NO_ENGINE | 69 | #ifndef OPENSSL_NO_ENGINE |
68 | /* non-NULL if default_RAND_meth is ENGINE-provided */ | 70 | /* non-NULL if default_RAND_meth is ENGINE-provided */ |
@@ -85,6 +87,16 @@ int RAND_set_rand_method(const RAND_METHOD *meth) | |||
85 | 87 | ||
86 | const RAND_METHOD *RAND_get_rand_method(void) | 88 | const RAND_METHOD *RAND_get_rand_method(void) |
87 | { | 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 | |||
88 | if (!default_RAND_meth) | 100 | if (!default_RAND_meth) |
89 | { | 101 | { |
90 | #ifndef OPENSSL_NO_ENGINE | 102 | #ifndef OPENSSL_NO_ENGINE |