EVP: fix keygen for EVP_PKEY_RSA_PSS
authorDaniel Bevenius <daniel.bevenius@gmail.com>
Fri, 9 Oct 2020 04:07:43 +0000 (06:07 +0200)
committerTomas Mraz <tomas@openssl.org>
Thu, 28 Jan 2021 15:25:16 +0000 (16:25 +0100)
commite947a0642db111bb34547b5f7d48e13163492ca5
treea5e71dbadff8d328df119f0c2f12fc8dcbcfa61f
parentd744934b756bc71344818a2cb60b13dd89954afb
EVP: fix keygen for EVP_PKEY_RSA_PSS

This commit attempts to fix the an issue when generating a key of type
EVP_PKEY_RSA_PSS. Currently, EVP_PKEY_CTX_set_rsa_keygen_bits will
return -1 if the key id is not of type EVP_PKEY_RSA. This commit adds
EVP_PKEY_RSA_PSS to also be accepted.

The macro EVP_PKEY_CTX_set_rsa_pss_keygen_md si converted into a
function and it is now called in legacy_ctrl_to_param.

Fixes #12384

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/13099)
crypto/evp/pmeth_lib.c
crypto/rsa/rsa_lib.c
doc/man3/EVP_PKEY_CTX_set_rsa_pss_keygen_md.pod
include/openssl/core_names.h
include/openssl/rsa.h
test/evp_extra_test.c
util/libcrypto.num