summaryrefslogtreecommitdiffstats
path: root/crypto
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2020-12-17 21:37:15 +0100
committerRichard Levitte <levitte@openssl.org>2020-12-20 12:19:42 +0100
commit3a1ee3c1993c588a22cb80f1d0eb6237f83a1560 (patch)
tree3e915497790f85855ef9730b2d36bc97a688a9f4 /crypto
parente3577adddf6bc4f0d9d202621a2c576d982d6f0a (diff)
Drop OPENSSL_NO_RSA everywhere
The configuration option 'no-rsa' was dropped with OpenSSL 1.1.0, so this is simply a cleanup of the remains. Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> (Merged from https://github.com/openssl/openssl/pull/13700)
Diffstat (limited to 'crypto')
-rw-r--r--crypto/asn1/asn1_item_list.h4
-rw-r--r--crypto/asn1/d2i_pu.c2
-rw-r--r--crypto/asn1/i2d_evp.c2
-rw-r--r--crypto/asn1/standard_methods.h4
-rw-r--r--crypto/engine/eng_fat.c4
-rw-r--r--crypto/engine/eng_list.c2
-rw-r--r--crypto/engine/eng_openssl.c2
-rw-r--r--crypto/err/err_all.c2
-rw-r--r--crypto/evp/p_dec.c4
-rw-r--r--crypto/evp/p_enc.c4
-rw-r--r--crypto/evp/pmeth_lib.c4
-rw-r--r--crypto/pem/pem_all.c8
-rw-r--r--crypto/pem/pem_info.c7
-rw-r--r--crypto/x509/x_all.c7
-rw-r--r--crypto/x509/x_pubkey.c2
15 files changed, 6 insertions, 52 deletions
diff --git a/crypto/asn1/asn1_item_list.h b/crypto/asn1/asn1_item_list.h
index b5a8661bd4..01d9076350 100644
--- a/crypto/asn1/asn1_item_list.h
+++ b/crypto/asn1/asn1_item_list.h
@@ -134,13 +134,11 @@ static ASN1_ITEM_EXP *asn1_item_list[] = {
ASN1_ITEM_ref(POLICY_MAPPING),
ASN1_ITEM_ref(PROXY_CERT_INFO_EXTENSION),
ASN1_ITEM_ref(PROXY_POLICY),
-#ifndef OPENSSL_NO_RSA
-# ifndef OPENSSL_NO_DEPRECATED_3_0
+#ifndef OPENSSL_NO_DEPRECATED_3_0
ASN1_ITEM_ref(RSAPrivateKey),
ASN1_ITEM_ref(RSAPublicKey),
ASN1_ITEM_ref(RSA_OAEP_PARAMS),
ASN1_ITEM_ref(RSA_PSS_PARAMS),
-# endif
#endif
#ifndef OPENSSL_NO_SCRYPT
ASN1_ITEM_ref(SCRYPT_PARAMS),
diff --git a/crypto/asn1/d2i_pu.c b/crypto/asn1/d2i_pu.c
index 6b3506e314..b6c7da772c 100644
--- a/crypto/asn1/d2i_pu.c
+++ b/crypto/asn1/d2i_pu.c
@@ -44,14 +44,12 @@ EVP_PKEY *d2i_PublicKey(int type, EVP_PKEY **a, const unsigned char **pp,
}
switch (EVP_PKEY_id(ret)) {
-#ifndef OPENSSL_NO_RSA
case EVP_PKEY_RSA:
if ((ret->pkey.rsa = d2i_RSAPublicKey(NULL, pp, length)) == NULL) {
ERR_raise(ERR_LIB_ASN1, ERR_R_ASN1_LIB);
goto err;
}
break;
-#endif
#ifndef OPENSSL_NO_DSA
case EVP_PKEY_DSA:
/* TMP UGLY CAST */
diff --git a/crypto/asn1/i2d_evp.c b/crypto/asn1/i2d_evp.c
index 3df49a1701..599c512901 100644
--- a/crypto/asn1/i2d_evp.c
+++ b/crypto/asn1/i2d_evp.c
@@ -107,10 +107,8 @@ int i2d_PublicKey(const EVP_PKEY *a, unsigned char **pp)
return i2d_provided(a, EVP_PKEY_PUBLIC_KEY, output_structures, pp);
}
switch (EVP_PKEY_id(a)) {
-#ifndef OPENSSL_NO_RSA
case EVP_PKEY_RSA:
return i2d_RSAPublicKey(EVP_PKEY_get0_RSA(a), pp);
-#endif
#ifndef OPENSSL_NO_DSA
case EVP_PKEY_DSA:
return i2d_DSAPublicKey(EVP_PKEY_get0_DSA(a), pp);
diff --git a/crypto/asn1/standard_methods.h b/crypto/asn1/standard_methods.h
index 59fa726991..7d225b308a 100644
--- a/crypto/asn1/standard_methods.h
+++ b/crypto/asn1/standard_methods.h
@@ -13,10 +13,8 @@
* is used to search it.
*/
static const EVP_PKEY_ASN1_METHOD *standard_methods[] = {
-#ifndef OPENSSL_NO_RSA
&rsa_asn1_meths[0],
&rsa_asn1_meths[1],
-#endif
#ifndef OPENSSL_NO_DH
&dh_asn1_meth,
#endif
@@ -30,9 +28,7 @@ static const EVP_PKEY_ASN1_METHOD *standard_methods[] = {
#ifndef OPENSSL_NO_EC
&eckey_asn1_meth,
#endif
-#ifndef OPENSSL_NO_RSA
&rsa_pss_asn1_meth,
-#endif
#ifndef OPENSSL_NO_DH
&dhx_asn1_meth,
#endif
diff --git a/crypto/engine/eng_fat.c b/crypto/engine/eng_fat.c
index 78537057b7..0cf27715c5 100644
--- a/crypto/engine/eng_fat.c
+++ b/crypto/engine/eng_fat.c
@@ -20,10 +20,8 @@ int ENGINE_set_default(ENGINE *e, unsigned int flags)
return 0;
if ((flags & ENGINE_METHOD_DIGESTS) && !ENGINE_set_default_digests(e))
return 0;
-#ifndef OPENSSL_NO_RSA
if ((flags & ENGINE_METHOD_RSA) && !ENGINE_set_default_RSA(e))
return 0;
-#endif
#ifndef OPENSSL_NO_DSA
if ((flags & ENGINE_METHOD_DSA) && !ENGINE_set_default_DSA(e))
return 0;
@@ -96,9 +94,7 @@ int ENGINE_register_complete(ENGINE *e)
{
ENGINE_register_ciphers(e);
ENGINE_register_digests(e);
-#ifndef OPENSSL_NO_RSA
ENGINE_register_RSA(e);
-#endif
#ifndef OPENSSL_NO_DSA
ENGINE_register_DSA(e);
#endif
diff --git a/crypto/engine/eng_list.c b/crypto/engine/eng_list.c
index de3475fe22..be08804665 100644
--- a/crypto/engine/eng_list.c
+++ b/crypto/engine/eng_list.c
@@ -250,9 +250,7 @@ static void engine_cpy(ENGINE *dest, const ENGINE *src)
{
dest->id = src->id;
dest->name = src->name;
-#ifndef OPENSSL_NO_RSA
dest->rsa_meth = src->rsa_meth;
-#endif
#ifndef OPENSSL_NO_DSA
dest->dsa_meth = src->dsa_meth;
#endif
diff --git a/crypto/engine/eng_openssl.c b/crypto/engine/eng_openssl.c
index 4214ebdfda..3ca95abc13 100644
--- a/crypto/engine/eng_openssl.c
+++ b/crypto/engine/eng_openssl.c
@@ -98,9 +98,7 @@ static int bind_helper(ENGINE *e)
|| !ENGINE_set_name(e, engine_openssl_name)
|| !ENGINE_set_destroy_function(e, openssl_destroy)
#ifndef TEST_ENG_OPENSSL_NO_ALGORITHMS
-# ifndef OPENSSL_NO_RSA
|| !ENGINE_set_RSA(e, RSA_get_default_method())
-# endif
# ifndef OPENSSL_NO_DSA
|| !ENGINE_set_DSA(e, DSA_get_default_method())
# endif
diff --git a/crypto/err/err_all.c b/crypto/err/err_all.c
index e90928edef..1d26c19d90 100644
--- a/crypto/err/err_all.c
+++ b/crypto/err/err_all.c
@@ -51,9 +51,7 @@ int err_load_crypto_strings_int(void)
#ifndef OPENSSL_NO_ERR
|| err_load_ERR_strings_int() == 0 /* include error strings for SYSerr */
|| err_load_BN_strings_int() == 0
-# ifndef OPENSSL_NO_RSA
|| err_load_RSA_strings_int() == 0
-# endif
# ifndef OPENSSL_NO_DH
|| err_load_DH_strings_int() == 0
# endif
diff --git a/crypto/evp/p_dec.c b/crypto/evp/p_dec.c
index c71e88d9b0..6ac344e394 100644
--- a/crypto/evp/p_dec.c
+++ b/crypto/evp/p_dec.c
@@ -22,11 +22,8 @@ int EVP_PKEY_decrypt_old(unsigned char *key, const unsigned char *ek, int ekl,
{
int ret = -1;
-#ifndef OPENSSL_NO_RSA
if (EVP_PKEY_id(priv) != EVP_PKEY_RSA) {
-#endif
ERR_raise(ERR_LIB_EVP, EVP_R_PUBLIC_KEY_NOT_RSA);
-#ifndef OPENSSL_NO_RSA
goto err;
}
@@ -34,6 +31,5 @@ int EVP_PKEY_decrypt_old(unsigned char *key, const unsigned char *ek, int ekl,
RSA_private_decrypt(ekl, ek, key, EVP_PKEY_get0_RSA(priv),
RSA_PKCS1_PADDING);
err:
-#endif
return ret;
}
diff --git a/crypto/evp/p_enc.c b/crypto/evp/p_enc.c
index 4847c752ed..bdc490d884 100644
--- a/crypto/evp/p_enc.c
+++ b/crypto/evp/p_enc.c
@@ -22,17 +22,13 @@ int EVP_PKEY_encrypt_old(unsigned char *ek, const unsigned char *key,
{
int ret = 0;
-#ifndef OPENSSL_NO_RSA
if (EVP_PKEY_id(pubk) != EVP_PKEY_RSA) {
-#endif
ERR_raise(ERR_LIB_EVP, EVP_R_PUBLIC_KEY_NOT_RSA);
-#ifndef OPENSSL_NO_RSA
goto err;
}
ret =
RSA_public_encrypt(key_len, key, ek, EVP_PKEY_get0_RSA(pubk),
RSA_PKCS1_PADDING);
err:
-#endif
return ret;
}
diff --git a/crypto/evp/pmeth_lib.c b/crypto/evp/pmeth_lib.c
index 8fc309dc99..7c2e648209 100644
--- a/crypto/evp/pmeth_lib.c
+++ b/crypto/evp/pmeth_lib.c
@@ -49,9 +49,7 @@ static STACK_OF(EVP_PKEY_METHOD) *app_pkey_methods = NULL;
/* This array needs to be in order of NIDs */
static pmeth_fn standard_methods[] = {
-# ifndef OPENSSL_NO_RSA
ossl_rsa_pkey_method,
-# endif
# ifndef OPENSSL_NO_DH
dh_pkey_method,
# endif
@@ -61,9 +59,7 @@ static pmeth_fn standard_methods[] = {
# ifndef OPENSSL_NO_EC
ec_pkey_method,
# endif
-# ifndef OPENSSL_NO_RSA
ossl_rsa_pss_pkey_method,
-# endif
# ifndef OPENSSL_NO_DH
dhx_pkey_method,
# endif
diff --git a/crypto/pem/pem_all.c b/crypto/pem/pem_all.c
index ea758f04be..5f73f93ce8 100644
--- a/crypto/pem/pem_all.c
+++ b/crypto/pem/pem_all.c
@@ -25,9 +25,7 @@
#include <openssl/dh.h>
#include "pem_local.h"
-#ifndef OPENSSL_NO_RSA
static RSA *pkey_get_rsa(EVP_PKEY *key, RSA **rsa);
-#endif
#ifndef OPENSSL_NO_DSA
static DSA *pkey_get_dsa(EVP_PKEY *key, DSA **dsa);
#endif
@@ -46,7 +44,6 @@ 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_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
@@ -77,7 +74,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)
{
@@ -86,12 +83,11 @@ 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_info.c b/crypto/pem/pem_info.c
index 7537e5a31f..3911fdc5ee 100644
--- a/crypto/pem/pem_info.c
+++ b/crypto/pem/pem_info.c
@@ -124,9 +124,7 @@ STACK_OF(X509_INFO)
goto start;
}
pp = &(xi->crl);
- } else
-#ifndef OPENSSL_NO_RSA
- if (strcmp(name, PEM_STRING_RSA) == 0) {
+ } else if (strcmp(name, PEM_STRING_RSA) == 0) {
d2i = (D2I_OF(void)) d2i_RSAPrivateKey;
if (xi->x_pkey != NULL) {
if (!sk_X509_INFO_push(ret, xi))
@@ -147,7 +145,6 @@ STACK_OF(X509_INFO)
if ((int)strlen(header) > 10) /* assume encrypted */
raw = 1;
} else
-#endif
#ifndef OPENSSL_NO_DSA
if (strcmp(name, PEM_STRING_DSA) == 0) {
d2i = (D2I_OF(void)) d2i_DSAPrivateKey;
@@ -335,13 +332,11 @@ int PEM_X509_INFO_write_bio(BIO *bp, const X509_INFO *xi, EVP_CIPHER *enc,
goto err;
} else {
/* Add DSA/DH */
-#ifndef OPENSSL_NO_RSA
/* normal optionally encrypted stuff */
if (PEM_write_bio_RSAPrivateKey(bp,
EVP_PKEY_get0_RSA(xi->x_pkey->dec_pkey),
enc, kstr, klen, cb, u) <= 0)
goto err;
-#endif
}
}
diff --git a/crypto/x509/x_all.c b/crypto/x509/x_all.c
index 96dda91a95..680a1cf48c 100644
--- a/crypto/x509/x_all.c
+++ b/crypto/x509/x_all.c
@@ -226,9 +226,7 @@ int i2d_X509_REQ_bio(BIO *bp, const X509_REQ *req)
return ASN1_item_i2d_bio(ASN1_ITEM_rptr(X509_REQ), bp, req);
}
-#ifndef OPENSSL_NO_RSA
-
-# ifndef OPENSSL_NO_STDIO
+#ifndef OPENSSL_NO_STDIO
RSA *d2i_RSAPrivateKey_fp(FILE *fp, RSA **rsa)
{
return ASN1_item_d2i_fp(ASN1_ITEM_rptr(RSAPrivateKey), fp, rsa);
@@ -260,7 +258,7 @@ int i2d_RSA_PUBKEY_fp(FILE *fp, const RSA *rsa)
{
return ASN1_i2d_fp((I2D_OF(void))i2d_RSA_PUBKEY, fp, rsa);
}
-# endif
+#endif
RSA *d2i_RSAPrivateKey_bio(BIO *bp, RSA **rsa)
{
@@ -291,7 +289,6 @@ int i2d_RSA_PUBKEY_bio(BIO *bp, const RSA *rsa)
{
return ASN1_i2d_bio_of(RSA, i2d_RSA_PUBKEY, bp, rsa);
}
-#endif
#ifndef OPENSSL_NO_DSA
# ifndef OPENSSL_NO_STDIO
diff --git a/crypto/x509/x_pubkey.c b/crypto/x509/x_pubkey.c
index f2caa0b834..a9beef682b 100644
--- a/crypto/x509/x_pubkey.c
+++ b/crypto/x509/x_pubkey.c
@@ -360,7 +360,6 @@ int i2d_PUBKEY(const EVP_PKEY *a, unsigned char **pp)
/*
* The following are equivalents but which return RSA and DSA keys
*/
-#ifndef OPENSSL_NO_RSA
RSA *d2i_RSA_PUBKEY(RSA **a, const unsigned char **pp, long length)
{
EVP_PKEY *pkey;
@@ -400,7 +399,6 @@ int i2d_RSA_PUBKEY(const RSA *a, unsigned char **pp)
EVP_PKEY_free(pktmp);
return ret;
}
-#endif
#ifndef OPENSSL_NO_DSA
DSA *d2i_DSA_PUBKEY(DSA **a, const unsigned char **pp, long length)