use X9.31 keygen by default in FIPS mode
authorDr. Stephen Henson <steve@openssl.org>
Wed, 29 Jul 2015 15:16:02 +0000 (16:16 +0100)
committerDr. Stephen Henson <steve@openssl.org>
Thu, 30 Jul 2015 13:34:45 +0000 (14:34 +0100)
Reviewed-by: Matt Caswell <matt@openssl.org>
crypto/rsa/rsa_gen.c

index 2465fbdebf190b7349717b738f94b7e9fc3c250e..7f7dca39fd089b645f87e4d3a2879ff5e03d2e6e 100644 (file)
@@ -69,6 +69,8 @@
 #include <openssl/rsa.h>
 #ifdef OPENSSL_FIPS
 # include <openssl/fips.h>
+extern int FIPS_rsa_x931_generate_key_ex(RSA *rsa, int bits, BIGNUM *e,
+                                         BN_GENCB *cb);
 #endif
 
 static int rsa_builtin_keygen(RSA *rsa, int bits, BIGNUM *e_value,
@@ -94,7 +96,7 @@ int RSA_generate_key_ex(RSA *rsa, int bits, BIGNUM *e_value, BN_GENCB *cb)
         return rsa->meth->rsa_keygen(rsa, bits, e_value, cb);
 #ifdef OPENSSL_FIPS
     if (FIPS_mode())
-        return FIPS_rsa_generate_key_ex(rsa, bits, e_value, cb);
+        return FIPS_rsa_x931_generate_key_ex(rsa, bits, e_value, cb);
 #endif
     return rsa_builtin_keygen(rsa, bits, e_value, cb);
 }