No longer use deprecated RSA generation function

This commit is contained in:
Iwan Timmer 2017-05-28 14:39:49 +02:00
parent be2b44f124
commit 6a8350caa5

View File

@ -104,7 +104,18 @@ int mkcert(X509 **x509p, EVP_PKEY **pkeyp, int bits, int serial, int years) {
x = *x509p; x = *x509p;
} }
rsa = RSA_generate_key(bits, RSA_F4, NULL, NULL); BIGNUM* bne = BN_new();
if (bne == NULL) {
abort();
goto err;
}
BN_set_word(bne, RSA_F4);
if (RSA_generate_key_ex(rsa, bits, bne, NULL) == 0) {
abort();
goto err;
}
if (!EVP_PKEY_assign_RSA(pk, rsa)) { if (!EVP_PKEY_assign_RSA(pk, rsa)) {
abort(); abort();
goto err; goto err;