diff options
Diffstat (limited to 'src/lib/libcrypto/rsa/rsa_gen.c')
| -rw-r--r-- | src/lib/libcrypto/rsa/rsa_gen.c | 15 |
1 files changed, 0 insertions, 15 deletions
diff --git a/src/lib/libcrypto/rsa/rsa_gen.c b/src/lib/libcrypto/rsa/rsa_gen.c index 42290cce66..767f7ab682 100644 --- a/src/lib/libcrypto/rsa/rsa_gen.c +++ b/src/lib/libcrypto/rsa/rsa_gen.c | |||
| @@ -67,9 +67,6 @@ | |||
| 67 | #include "cryptlib.h" | 67 | #include "cryptlib.h" |
| 68 | #include <openssl/bn.h> | 68 | #include <openssl/bn.h> |
| 69 | #include <openssl/rsa.h> | 69 | #include <openssl/rsa.h> |
| 70 | #ifdef OPENSSL_FIPS | ||
| 71 | #include <openssl/fips.h> | ||
| 72 | #endif | ||
| 73 | 70 | ||
| 74 | static int rsa_builtin_keygen(RSA *rsa, int bits, BIGNUM *e_value, BN_GENCB *cb); | 71 | static int rsa_builtin_keygen(RSA *rsa, int bits, BIGNUM *e_value, BN_GENCB *cb); |
| 75 | 72 | ||
| @@ -80,20 +77,8 @@ static int rsa_builtin_keygen(RSA *rsa, int bits, BIGNUM *e_value, BN_GENCB *cb) | |||
| 80 | * now just because key-generation is part of RSA_METHOD. */ | 77 | * now just because key-generation is part of RSA_METHOD. */ |
| 81 | int RSA_generate_key_ex(RSA *rsa, int bits, BIGNUM *e_value, BN_GENCB *cb) | 78 | int RSA_generate_key_ex(RSA *rsa, int bits, BIGNUM *e_value, BN_GENCB *cb) |
| 82 | { | 79 | { |
| 83 | #ifdef OPENSSL_FIPS | ||
| 84 | if (FIPS_mode() && !(rsa->meth->flags & RSA_FLAG_FIPS_METHOD) | ||
| 85 | && !(rsa->flags & RSA_FLAG_NON_FIPS_ALLOW)) | ||
| 86 | { | ||
| 87 | RSAerr(RSA_F_RSA_GENERATE_KEY_EX, RSA_R_NON_FIPS_RSA_METHOD); | ||
| 88 | return 0; | ||
| 89 | } | ||
| 90 | #endif | ||
| 91 | if(rsa->meth->rsa_keygen) | 80 | if(rsa->meth->rsa_keygen) |
| 92 | return rsa->meth->rsa_keygen(rsa, bits, e_value, cb); | 81 | return rsa->meth->rsa_keygen(rsa, bits, e_value, cb); |
| 93 | #ifdef OPENSSL_FIPS | ||
| 94 | if (FIPS_mode()) | ||
| 95 | return FIPS_rsa_generate_key_ex(rsa, bits, e_value, cb); | ||
| 96 | #endif | ||
| 97 | return rsa_builtin_keygen(rsa, bits, e_value, cb); | 82 | return rsa_builtin_keygen(rsa, bits, e_value, cb); |
| 98 | } | 83 | } |
| 99 | 84 | ||
