diff options
Diffstat (limited to 'src/lib/libcrypto/o_fips.c')
-rw-r--r-- | src/lib/libcrypto/o_fips.c | 22 |
1 files changed, 0 insertions, 22 deletions
diff --git a/src/lib/libcrypto/o_fips.c b/src/lib/libcrypto/o_fips.c index 9c185cfb18..43312ae23f 100644 --- a/src/lib/libcrypto/o_fips.c +++ b/src/lib/libcrypto/o_fips.c | |||
@@ -56,42 +56,20 @@ | |||
56 | */ | 56 | */ |
57 | 57 | ||
58 | #include "cryptlib.h" | 58 | #include "cryptlib.h" |
59 | #ifdef OPENSSL_FIPS | ||
60 | #include <openssl/fips.h> | ||
61 | #include <openssl/fips_rand.h> | ||
62 | #include <openssl/rand.h> | ||
63 | #endif | ||
64 | 59 | ||
65 | int | 60 | int |
66 | FIPS_mode(void) | 61 | FIPS_mode(void) |
67 | { | 62 | { |
68 | OPENSSL_init(); | 63 | OPENSSL_init(); |
69 | #ifdef OPENSSL_FIPS | ||
70 | return FIPS_module_mode(); | ||
71 | #else | ||
72 | return 0; | 64 | return 0; |
73 | #endif | ||
74 | } | 65 | } |
75 | 66 | ||
76 | int | 67 | int |
77 | FIPS_mode_set(int r) | 68 | FIPS_mode_set(int r) |
78 | { | 69 | { |
79 | OPENSSL_init(); | 70 | OPENSSL_init(); |
80 | #ifdef OPENSSL_FIPS | ||
81 | #ifndef FIPS_AUTH_USER_PASS | ||
82 | #define FIPS_AUTH_USER_PASS "Default FIPS Crypto User Password" | ||
83 | #endif | ||
84 | if (!FIPS_module_mode_set(r, FIPS_AUTH_USER_PASS)) | ||
85 | return 0; | ||
86 | if (r) | ||
87 | RAND_set_rand_method(FIPS_rand_get_method()); | ||
88 | else | ||
89 | RAND_set_rand_method(NULL); | ||
90 | return 1; | ||
91 | #else | ||
92 | if (r == 0) | 71 | if (r == 0) |
93 | return 1; | 72 | return 1; |
94 | CRYPTOerr(CRYPTO_F_FIPS_MODE_SET, CRYPTO_R_FIPS_MODE_NOT_SUPPORTED); | 73 | CRYPTOerr(CRYPTO_F_FIPS_MODE_SET, CRYPTO_R_FIPS_MODE_NOT_SUPPORTED); |
95 | return 0; | 74 | return 0; |
96 | #endif | ||
97 | } | 75 | } |