diff options
| author | djm <> | 2012-10-13 21:23:50 +0000 |
|---|---|---|
| committer | djm <> | 2012-10-13 21:23:50 +0000 |
| commit | 228cae30b117c2493f69ad3c195341cd6ec8d430 (patch) | |
| tree | 29ff00b10d52c0978077c4fd83c33b065bade73e /src/lib/libcrypto/dsa/dsa_key.c | |
| parent | 731838c66b52c0ae5888333005b74115a620aa96 (diff) | |
| download | openbsd-228cae30b117c2493f69ad3c195341cd6ec8d430.tar.gz openbsd-228cae30b117c2493f69ad3c195341cd6ec8d430.tar.bz2 openbsd-228cae30b117c2493f69ad3c195341cd6ec8d430.zip | |
import OpenSSL-1.0.1c
Diffstat (limited to 'src/lib/libcrypto/dsa/dsa_key.c')
| -rw-r--r-- | src/lib/libcrypto/dsa/dsa_key.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/lib/libcrypto/dsa/dsa_key.c b/src/lib/libcrypto/dsa/dsa_key.c index c4aa86bc6d..9cf669b921 100644 --- a/src/lib/libcrypto/dsa/dsa_key.c +++ b/src/lib/libcrypto/dsa/dsa_key.c | |||
| @@ -64,12 +64,28 @@ | |||
| 64 | #include <openssl/dsa.h> | 64 | #include <openssl/dsa.h> |
| 65 | #include <openssl/rand.h> | 65 | #include <openssl/rand.h> |
| 66 | 66 | ||
| 67 | #ifdef OPENSSL_FIPS | ||
| 68 | #include <openssl/fips.h> | ||
| 69 | #endif | ||
| 70 | |||
| 67 | static int dsa_builtin_keygen(DSA *dsa); | 71 | static int dsa_builtin_keygen(DSA *dsa); |
| 68 | 72 | ||
| 69 | int DSA_generate_key(DSA *dsa) | 73 | int DSA_generate_key(DSA *dsa) |
| 70 | { | 74 | { |
| 75 | #ifdef OPENSSL_FIPS | ||
| 76 | if (FIPS_mode() && !(dsa->meth->flags & DSA_FLAG_FIPS_METHOD) | ||
| 77 | && !(dsa->flags & DSA_FLAG_NON_FIPS_ALLOW)) | ||
| 78 | { | ||
| 79 | DSAerr(DSA_F_DSA_GENERATE_KEY, DSA_R_NON_FIPS_DSA_METHOD); | ||
| 80 | return 0; | ||
| 81 | } | ||
| 82 | #endif | ||
| 71 | if(dsa->meth->dsa_keygen) | 83 | if(dsa->meth->dsa_keygen) |
| 72 | return dsa->meth->dsa_keygen(dsa); | 84 | return dsa->meth->dsa_keygen(dsa); |
| 85 | #ifdef OPENSSL_FIPS | ||
| 86 | if (FIPS_mode()) | ||
| 87 | return FIPS_dsa_generate_key(dsa); | ||
| 88 | #endif | ||
| 73 | return dsa_builtin_keygen(dsa); | 89 | return dsa_builtin_keygen(dsa); |
| 74 | } | 90 | } |
| 75 | 91 | ||
