summaryrefslogtreecommitdiffstats
path: root/crypto/pem
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 /crypto/pem
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 'crypto/pem')
-rw-r--r--crypto/pem/pem_all.c8
-rw-r--r--crypto/pem/pem_local.h3
2 files changed, 8 insertions, 3 deletions
diff --git a/crypto/pem/pem_all.c b/crypto/pem/pem_all.c
index 8d5b25156c..ea758f04be 100644
--- a/crypto/pem/pem_all.c
+++ b/crypto/pem/pem_all.c
@@ -45,7 +45,8 @@ IMPLEMENT_PEM_rw(PKCS7, PKCS7, PEM_STRING_PKCS7, PKCS7)
IMPLEMENT_PEM_rw(NETSCAPE_CERT_SEQUENCE, NETSCAPE_CERT_SEQUENCE,
PEM_STRING_X509, NETSCAPE_CERT_SEQUENCE)
-#ifndef OPENSSL_NO_RSA
+#ifndef OPENSSL_NO_DEPRECATED_3_0
+# ifndef OPENSSL_NO_RSA
/*
* We treat RSA or DSA private keys as a special case. For private keys we
* read in an EVP_PKEY structure with PEM_read_bio_PrivateKey() and extract
@@ -76,7 +77,7 @@ RSA *PEM_read_bio_RSAPrivateKey(BIO *bp, RSA **rsa, pem_password_cb *cb,
return pkey_get_rsa(pktmp, rsa);
}
-# ifndef OPENSSL_NO_STDIO
+# ifndef OPENSSL_NO_STDIO
RSA *PEM_read_RSAPrivateKey(FILE *fp, RSA **rsa, pem_password_cb *cb, void *u)
{
@@ -85,11 +86,12 @@ RSA *PEM_read_RSAPrivateKey(FILE *fp, RSA **rsa, pem_password_cb *cb, void *u)
return pkey_get_rsa(pktmp, rsa);
}
-# endif
+# endif
IMPLEMENT_PEM_write_cb(RSAPrivateKey, RSA, PEM_STRING_RSA, RSAPrivateKey)
IMPLEMENT_PEM_rw(RSAPublicKey, RSA, PEM_STRING_RSA_PUBLIC, RSAPublicKey)
IMPLEMENT_PEM_rw(RSA_PUBKEY, RSA, PEM_STRING_PUBLIC, RSA_PUBKEY)
+# endif
#endif
#ifndef OPENSSL_NO_DSA
static DSA *pkey_get_dsa(EVP_PKEY *key, DSA **dsa)
diff --git a/crypto/pem/pem_local.h b/crypto/pem/pem_local.h
index 10761b03d3..7de2a71045 100644
--- a/crypto/pem/pem_local.h
+++ b/crypto/pem/pem_local.h
@@ -39,6 +39,9 @@
# define PEM_STRUCTURE_PrivateKey "pkcs8"
# define PEM_STRUCTURE_Parameters "type-specific"
+# define PEM_STRUCTURE_RSAPrivateKey "type-specific"
+# define PEM_STRUCTURE_RSAPublicKey "type-specific"
+
/* Alternative IMPLEMENT macros for provided encoders */
# define IMPLEMENT_PEM_provided_write_body_vars(type, asn1) \