diff options
Diffstat (limited to 'src/lib/libcrypto/dsa/dsa_lib.c')
-rw-r--r-- | src/lib/libcrypto/dsa/dsa_lib.c | 22 |
1 files changed, 2 insertions, 20 deletions
diff --git a/src/lib/libcrypto/dsa/dsa_lib.c b/src/lib/libcrypto/dsa/dsa_lib.c index 96d8d0c4b4..e9b75902db 100644 --- a/src/lib/libcrypto/dsa/dsa_lib.c +++ b/src/lib/libcrypto/dsa/dsa_lib.c | |||
@@ -70,10 +70,6 @@ | |||
70 | #include <openssl/dh.h> | 70 | #include <openssl/dh.h> |
71 | #endif | 71 | #endif |
72 | 72 | ||
73 | #ifdef OPENSSL_FIPS | ||
74 | #include <openssl/fips.h> | ||
75 | #endif | ||
76 | |||
77 | const char DSA_version[]="DSA" OPENSSL_VERSION_PTEXT; | 73 | const char DSA_version[]="DSA" OPENSSL_VERSION_PTEXT; |
78 | 74 | ||
79 | static const DSA_METHOD *default_DSA_method = NULL; | 75 | static const DSA_METHOD *default_DSA_method = NULL; |
@@ -86,16 +82,7 @@ void DSA_set_default_method(const DSA_METHOD *meth) | |||
86 | const DSA_METHOD *DSA_get_default_method(void) | 82 | const DSA_METHOD *DSA_get_default_method(void) |
87 | { | 83 | { |
88 | if(!default_DSA_method) | 84 | if(!default_DSA_method) |
89 | { | ||
90 | #ifdef OPENSSL_FIPS | ||
91 | if (FIPS_mode()) | ||
92 | return FIPS_dsa_openssl(); | ||
93 | else | ||
94 | return DSA_OpenSSL(); | ||
95 | #else | ||
96 | default_DSA_method = DSA_OpenSSL(); | 85 | default_DSA_method = DSA_OpenSSL(); |
97 | #endif | ||
98 | } | ||
99 | return default_DSA_method; | 86 | return default_DSA_method; |
100 | } | 87 | } |
101 | 88 | ||
@@ -176,7 +163,7 @@ DSA *DSA_new_method(ENGINE *engine) | |||
176 | ret->method_mont_p=NULL; | 163 | ret->method_mont_p=NULL; |
177 | 164 | ||
178 | ret->references=1; | 165 | ret->references=1; |
179 | ret->flags=ret->meth->flags & ~DSA_FLAG_NON_FIPS_ALLOW; | 166 | ret->flags=ret->meth->flags; |
180 | CRYPTO_new_ex_data(CRYPTO_EX_INDEX_DSA, ret, &ret->ex_data); | 167 | CRYPTO_new_ex_data(CRYPTO_EX_INDEX_DSA, ret, &ret->ex_data); |
181 | if ((ret->meth->init != NULL) && !ret->meth->init(ret)) | 168 | if ((ret->meth->init != NULL) && !ret->meth->init(ret)) |
182 | { | 169 | { |
@@ -289,8 +276,7 @@ void *DSA_get_ex_data(DSA *d, int idx) | |||
289 | DH *DSA_dup_DH(const DSA *r) | 276 | DH *DSA_dup_DH(const DSA *r) |
290 | { | 277 | { |
291 | /* DSA has p, q, g, optional pub_key, optional priv_key. | 278 | /* DSA has p, q, g, optional pub_key, optional priv_key. |
292 | * DH has p, optional length, g, optional pub_key, optional priv_key, | 279 | * DH has p, optional length, g, optional pub_key, optional priv_key. |
293 | * optional q. | ||
294 | */ | 280 | */ |
295 | 281 | ||
296 | DH *ret = NULL; | 282 | DH *ret = NULL; |
@@ -304,11 +290,7 @@ DH *DSA_dup_DH(const DSA *r) | |||
304 | if ((ret->p = BN_dup(r->p)) == NULL) | 290 | if ((ret->p = BN_dup(r->p)) == NULL) |
305 | goto err; | 291 | goto err; |
306 | if (r->q != NULL) | 292 | if (r->q != NULL) |
307 | { | ||
308 | ret->length = BN_num_bits(r->q); | 293 | ret->length = BN_num_bits(r->q); |
309 | if ((ret->q = BN_dup(r->q)) == NULL) | ||
310 | goto err; | ||
311 | } | ||
312 | if (r->g != NULL) | 294 | if (r->g != NULL) |
313 | if ((ret->g = BN_dup(r->g)) == NULL) | 295 | if ((ret->g = BN_dup(r->g)) == NULL) |
314 | goto err; | 296 | goto err; |