req, x509: Allow printing modulus of RSA-PSS keys

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/17990)
This commit is contained in:
Tomas Mraz 2022-03-25 15:13:16 +01:00
parent 927d0566de
commit e4cdcb8bc4
2 changed files with 2 additions and 2 deletions

View File

@ -986,7 +986,7 @@ int req_main(int argc, char **argv)
goto end;
}
fprintf(stdout, "Modulus=");
if (EVP_PKEY_is_a(tpubkey, "RSA")) {
if (EVP_PKEY_is_a(tpubkey, "RSA") || EVP_PKEY_is_a(tpubkey, "RSA-PSS")) {
BIGNUM *n = NULL;
if (!EVP_PKEY_get_bn_param(tpubkey, "n", &n))

View File

@ -966,7 +966,7 @@ int x509_main(int argc, char **argv)
purpose_print(out, x, X509_PURPOSE_get0(j));
} else if (i == modulus) {
BIO_printf(out, "Modulus=");
if (EVP_PKEY_is_a(pkey, "RSA")) {
if (EVP_PKEY_is_a(pkey, "RSA") || EVP_PKEY_is_a(pkey, "RSA-PSS")) {
BIGNUM *n = NULL;
/* Every RSA key has an 'n' */