diff options
author | 2012-10-13 21:25:05 +0000 | |
---|---|---|
committer | 2012-10-13 21:25:05 +0000 | |
commit | 5cdd308e23c573f20580c33373ebbd6aaf46ca93 (patch) | |
tree | 8c9c6577606b3e2a4f852b80db635caddf559533 /lib/libcrypto/dsa/dsa_key.c | |
parent | import OpenSSL-1.0.1c (diff) | |
download | wireguard-openbsd-5cdd308e23c573f20580c33373ebbd6aaf46ca93.tar.xz wireguard-openbsd-5cdd308e23c573f20580c33373ebbd6aaf46ca93.zip |
resolve conflicts
Diffstat (limited to 'lib/libcrypto/dsa/dsa_key.c')
-rw-r--r-- | lib/libcrypto/dsa/dsa_key.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/libcrypto/dsa/dsa_key.c b/lib/libcrypto/dsa/dsa_key.c index c4aa86bc6dc..9cf669b921a 100644 --- a/lib/libcrypto/dsa/dsa_key.c +++ b/lib/libcrypto/dsa/dsa_key.c @@ -64,12 +64,28 @@ #include <openssl/dsa.h> #include <openssl/rand.h> +#ifdef OPENSSL_FIPS +#include <openssl/fips.h> +#endif + static int dsa_builtin_keygen(DSA *dsa); int DSA_generate_key(DSA *dsa) { +#ifdef OPENSSL_FIPS + if (FIPS_mode() && !(dsa->meth->flags & DSA_FLAG_FIPS_METHOD) + && !(dsa->flags & DSA_FLAG_NON_FIPS_ALLOW)) + { + DSAerr(DSA_F_DSA_GENERATE_KEY, DSA_R_NON_FIPS_DSA_METHOD); + return 0; + } +#endif if(dsa->meth->dsa_keygen) return dsa->meth->dsa_keygen(dsa); +#ifdef OPENSSL_FIPS + if (FIPS_mode()) + return FIPS_dsa_generate_key(dsa); +#endif return dsa_builtin_keygen(dsa); } |