}
#endif
-
+#ifdef HAVE_GENERATE_EX
+ {
+ RSA *tkey;
+ BIGNUM *bn_f4;
+ if (!(tkey == RSA_new())
+ || !(bn_f4 == BN_new())
+ || !BN_set_word(bn_f4, RSA_F4)
+ || !RSA_generate_key_ex(tkey, bits, bn_f4, NULL))
+ {
+ ap_log_error(APLOG_MARK, APLOG_ERR, 0, s,
+ "Init: Failed to generate temporary "
+ "%d bit RSA private key", bits);
+ ssl_log_ssl_error(SSLLOG_MARK, APLOG_ERR, s);
+ return !OK;
+ }
+ BN_free(bn_f4);
+ mc->pTmpKeys[idx] = tkey;
+ }
+#else
if (!(mc->pTmpKeys[idx] =
RSA_generate_key(bits, RSA_F4, NULL, NULL)))
{
ssl_log_ssl_error(SSLLOG_MARK, APLOG_ERR, s);
return !OK;
}
+#endif
return OK;
}
#include <openssl/ocsp.h>
#endif
+#if (OPENSSL_VERSION_NUMBER >= 0x00908000)
+#define HAVE_GENERATE_EX
+#endif
+
/* ECC support came along in OpenSSL 1.0.0 */
#if (OPENSSL_VERSION_NUMBER < 0x10000000)
#define OPENSSL_NO_EC