req, x509: Allow printing modulus of RSA-PSS keys
authorTomas Mraz <tomas@openssl.org>
Fri, 25 Mar 2022 14:13:16 +0000 (15:13 +0100)
committerTomas Mraz <tomas@openssl.org>
Fri, 1 Apr 2022 07:37:05 +0000 (09:37 +0200)
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/17990)

apps/req.c
apps/x509.c

index 7e59e673e0296e71bece72870db7d78aa50dab1f..04a1ccbc043a8e8ac40cbf4e5c5d160486e96e60 100644 (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))
index f62f809a9c03598204fd7fba78d736acbcefe8bb..e13d0c37fae14c84749ecfa163a501349a1ade13 100644 (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' */