summaryrefslogtreecommitdiffstats
path: root/apps/x509.c
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2020-10-04 16:34:31 +0200
committerRichard Levitte <levitte@openssl.org>2020-11-18 23:38:34 +0100
commitd7e498ac55f12bc2f4e7f948cbb8de2e3eeafc74 (patch)
tree755ca6bcbcd3b85d0371713d754b26f4a9d70250 /apps/x509.c
parentb24d6c335d3beb431f8f9847623d4db39ae1f96b (diff)
Deprecate RSA harder
This deprecates all functions that deal with the types RSA and RSA_METHOD Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/13096)
Diffstat (limited to 'apps/x509.c')
-rw-r--r--apps/x509.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/apps/x509.c b/apps/x509.c
index 0d0d93edc0..ad627f4558 100644
--- a/apps/x509.c
+++ b/apps/x509.c
@@ -757,10 +757,13 @@ int x509_main(int argc, char **argv)
}
BIO_printf(out, "Modulus=");
#ifndef OPENSSL_NO_RSA
- if (EVP_PKEY_id(pkey) == EVP_PKEY_RSA) {
- const BIGNUM *n;
- RSA_get0_key(EVP_PKEY_get0_RSA(pkey), &n, NULL, NULL);
+ if (EVP_PKEY_is_a(pkey, "RSA")) {
+ BIGNUM *n;
+
+ /* Every RSA key has an 'n' */
+ EVP_PKEY_get_bn_param(pkey, "n", &n);
BN_print(out, n);
+ BN_free(n);
} else
#endif
#ifndef OPENSSL_NO_DSA