From: Tomas Mraz Date: Fri, 25 Mar 2022 14:13:16 +0000 (+0100) Subject: req, x509: Allow printing modulus of RSA-PSS keys X-Git-Tag: openssl-3.2.0-alpha1~2798 X-Git-Url: https://git.openssl.org/gitweb/?a=commitdiff_plain;h=e4cdcb8bc44250aa4e0893dc4a7d64668f0fb949;p=openssl.git req, x509: Allow printing modulus of RSA-PSS keys Reviewed-by: Matt Caswell Reviewed-by: Paul Dale (Merged from https://github.com/openssl/openssl/pull/17990) --- diff --git a/apps/req.c b/apps/req.c index 7e59e673e0..04a1ccbc04 100644 --- a/apps/req.c +++ b/apps/req.c @@ -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)) diff --git a/apps/x509.c b/apps/x509.c index f62f809a9c..e13d0c37fa 100644 --- a/apps/x509.c +++ b/apps/x509.c @@ -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' */