diff options
-rw-r--r-- | engines/e_loader_attic.c | 8 | ||||
-rw-r--r-- | providers/decoders.inc | 6 | ||||
-rw-r--r-- | providers/implementations/encode_decode/build.info | 5 | ||||
-rw-r--r-- | providers/implementations/encode_decode/decode_ms2key.c | 16 | ||||
-rw-r--r-- | test/endecode_test.c | 53 |
5 files changed, 20 insertions, 68 deletions
diff --git a/engines/e_loader_attic.c b/engines/e_loader_attic.c index 936faa98b3..586a21df41 100644 --- a/engines/e_loader_attic.c +++ b/engines/e_loader_attic.c @@ -1338,9 +1338,6 @@ static int file_read_pem(BIO *bp, char **pem_name, char **pem_header, static OSSL_STORE_INFO *file_try_read_msblob(BIO *bp, int *matchcount) { -#ifdef OPENSSL_NO_DSA - return NULL; -#else OSSL_STORE_INFO *result = NULL; int ispub = -1; @@ -1372,16 +1369,12 @@ static OSSL_STORE_INFO *file_try_read_msblob(BIO *bp, int *matchcount) } return result; -#endif } static OSSL_STORE_INFO *file_try_read_PVK(BIO *bp, const UI_METHOD *ui_method, void *ui_data, const char *uri, int *matchcount) { -#if defined(OPENSSL_NO_DSA) || defined(OPENSSL_NO_RC4) - return NULL; -#else OSSL_STORE_INFO *result = NULL; { @@ -1411,7 +1404,6 @@ static OSSL_STORE_INFO *file_try_read_PVK(BIO *bp, const UI_METHOD *ui_method, } return result; -#endif } static int file_read_asn1(BIO *bp, unsigned char **data, long *len) diff --git a/providers/decoders.inc b/providers/decoders.inc index a9119cad79..c9f0dea638 100644 --- a/providers/decoders.inc +++ b/providers/decoders.inc @@ -50,9 +50,7 @@ DECODER_w_structure("DSA", der, SubjectPublicKeyInfo, dsa, yes), DECODER_w_structure("DSA", der, type_specific, dsa, yes), DECODER_w_structure("DSA", der, DSA, dsa, yes), DECODER("DSA", msblob, dsa, yes), -# ifndef OPENSSL_NO_RC4 DECODER("DSA", pvk, dsa, yes), -# endif #endif #ifndef OPENSSL_NO_EC DECODER_w_structure("EC", der, PKCS8, ec, yes), @@ -74,11 +72,7 @@ DECODER_w_structure("RSA", der, type_specific_keypair, rsa, yes), DECODER_w_structure("RSA", der, RSA, rsa, yes), DECODER_w_structure("RSA-PSS", der, PKCS8, rsapss, yes), DECODER_w_structure("RSA-PSS", der, SubjectPublicKeyInfo, rsapss, yes), -#ifndef OPENSSL_NO_DSA DECODER("RSA", msblob, rsa, yes), -# ifndef OPENSSL_NO_RC4 DECODER("RSA", pvk, rsa, yes), -# endif -#endif DECODER("DER", pem, der, yes), diff --git a/providers/implementations/encode_decode/build.info b/providers/implementations/encode_decode/build.info index 97e2264418..0188589a61 100644 --- a/providers/implementations/encode_decode/build.info +++ b/providers/implementations/encode_decode/build.info @@ -12,10 +12,7 @@ $EC_GOAL=../../libimplementations.a SOURCE[$ENCODER_GOAL]=endecoder_common.c -SOURCE[$DECODER_GOAL]=decode_der2key.c decode_pem2der.c -IF[{- !$disabled{dsa} -}] - SOURCE[$DECODER_GOAL]=decode_ms2key.c -ENDIF +SOURCE[$DECODER_GOAL]=decode_der2key.c decode_pem2der.c decode_ms2key.c SOURCE[$DECODER_GOAL]=encode_key2any.c encode_key2text.c DEPEND[encode_key2any.o]=../../common/include/prov/der_rsa.h diff --git a/providers/implementations/encode_decode/decode_ms2key.c b/providers/implementations/encode_decode/decode_ms2key.c index 573f9c9a56..339b347fa0 100644 --- a/providers/implementations/encode_decode/decode_ms2key.c +++ b/providers/implementations/encode_decode/decode_ms2key.c @@ -28,7 +28,6 @@ #include "prov/implementations.h" #include "endecoder_local.h" -#ifndef OPENSSL_NO_DSA static EVP_PKEY *read_msblob(PROV_CTX *provctx, OSSL_CORE_BIO *cin, int *ispub) { BIO *in = bio_new_from_core_bio(provctx, cin); @@ -38,7 +37,6 @@ static EVP_PKEY *read_msblob(PROV_CTX *provctx, OSSL_CORE_BIO *cin, int *ispub) return pkey; } -# ifndef OPENSSL_NO_RC4 static EVP_PKEY *read_pvk(PROV_CTX *provctx, OSSL_CORE_BIO *cin, OSSL_PASSPHRASE_CALLBACK *pw_cb, void *pw_cbarg) { @@ -56,19 +54,13 @@ static EVP_PKEY *read_pvk(PROV_CTX *provctx, OSSL_CORE_BIO *cin, return pkey; } -# endif -#endif static OSSL_FUNC_decoder_freectx_fn ms2key_freectx; static OSSL_FUNC_decoder_gettable_params_fn ms2key_gettable_params; static OSSL_FUNC_decoder_get_params_fn msblob2key_get_params; -#ifndef OPENSSL_NO_RC4 static OSSL_FUNC_decoder_get_params_fn pvk2key_get_params; -#endif static OSSL_FUNC_decoder_decode_fn msblob2key_decode; -#ifndef OPENSSL_NO_RC4 static OSSL_FUNC_decoder_decode_fn pvk2key_decode; -#endif static OSSL_FUNC_decoder_export_object_fn ms2key_export_object; typedef void *(extract_key_fn)(EVP_PKEY *); @@ -134,7 +126,6 @@ static int msblob2key_get_params(OSSL_PARAM params[]) return 1; } -#ifndef OPENSSL_NO_RC4 static int pvk2key_get_params(OSSL_PARAM params[]) { OSSL_PARAM *p; @@ -145,7 +136,6 @@ static int pvk2key_get_params(OSSL_PARAM params[]) return 1; } -#endif static int ms2key_post(struct ms2key_ctx_st *ctx, EVP_PKEY *pkey, OSSL_CALLBACK *data_cb, void *data_cbarg) @@ -207,7 +197,6 @@ static int msblob2key_decode(void *vctx, OSSL_CORE_BIO *cin, int selection, return ok; } -#ifndef OPENSSL_NO_RC4 static int pvk2key_decode(void *vctx, OSSL_CORE_BIO *cin, int selection, OSSL_CALLBACK *data_cb, void *data_cbarg, OSSL_PASSPHRASE_CALLBACK *pw_cb, void *pw_cbarg) @@ -223,7 +212,6 @@ static int pvk2key_decode(void *vctx, OSSL_CORE_BIO *cin, int selection, EVP_PKEY_free(pkey); return ok; } -#endif static int ms2key_export_object(void *vctx, const void *reference, size_t reference_sz, @@ -278,12 +266,8 @@ static int ms2key_export_object(void *vctx, #ifndef OPENSSL_NO_DSA IMPLEMENT_TYPE("DSA", DSA, dsa, EVP_PKEY_get1_DSA, DSA_free); IMPLEMENT_MS(msblob, dsa); -# ifndef OPENSSL_NO_RC4 IMPLEMENT_MS(pvk, dsa); -# endif #endif IMPLEMENT_TYPE("RSA", RSA, rsa, EVP_PKEY_get1_RSA, RSA_free); IMPLEMENT_MS(msblob, rsa); -#ifndef OPENSSL_NO_RC4 IMPLEMENT_MS(pvk, rsa); -#endif diff --git a/test/endecode_test.c b/test/endecode_test.c index 76b32a8aa9..6e67dd1835 100644 --- a/test/endecode_test.c +++ b/test/endecode_test.c @@ -333,7 +333,6 @@ static int encode_EVP_PKEY_legacy_PEM(void **encoded, long *encoded_len, return ok; } -#ifndef OPENSSL_NO_DSA static int encode_EVP_PKEY_MSBLOB(void **encoded, long *encoded_len, void *object, int selection, ossl_unused const char *output_type, @@ -371,7 +370,6 @@ static int encode_EVP_PKEY_MSBLOB(void **encoded, long *encoded_len, return ok; } -# ifndef OPENSSL_NO_RC4 static pem_password_cb pass_pw; static int pass_pw(char *buf, int size, int rwflag, void *userdata) { @@ -410,8 +408,6 @@ static int encode_EVP_PKEY_PVK(void **encoded, long *encoded_len, BIO_free(mem_ser); return ok; } -# endif -#endif static int test_text(const void *data1, size_t data1_len, const void *data2, size_t data2_len) @@ -598,7 +594,6 @@ static int test_unprotected_via_legacy_PEM(const char *type, EVP_PKEY *key) dump_pem, 0); } -#ifndef OPENSSL_NO_DSA static int check_MSBLOB(const char *type, const void *data, size_t data_len) { const unsigned char *datap = data; @@ -620,7 +615,6 @@ static int test_unprotected_via_MSBLOB(const char *type, EVP_PKEY *key) dump_der, 0); } -# ifndef OPENSSL_NO_RC4 static int check_PVK(const char *type, const void *data, size_t data_len) { const unsigned char *in = data; @@ -640,8 +634,6 @@ static int test_unprotected_via_PVK(const char *type, EVP_PKEY *key) test_mem, check_PVK, dump_der, 0); } -# endif -#endif static const char *pass_cipher = "AES-256-CBC"; static const char *pass = "the holy handgrenade of antioch"; @@ -713,7 +705,7 @@ static int test_protected_via_legacy_PEM(const char *type, EVP_PKEY *key) dump_pem, 0); } -#if !defined(OPENSSL_NO_DSA) && !defined(OPENSSL_NO_RC4) +#ifndef OPENSSL_NO_RC4 static int test_protected_via_PVK(const char *type, EVP_PKEY *key) { return test_encode_decode(type, key, @@ -765,7 +757,6 @@ static int test_public_via_PEM(const char *type, EVP_PKEY *key) test_text, check_public_PEM, dump_pem, 0); } -#ifndef OPENSSL_NO_DSA static int check_public_MSBLOB(const char *type, const void *data, size_t data_len) { @@ -785,7 +776,6 @@ static int test_public_via_MSBLOB(const char *type, EVP_PKEY *key) encode_EVP_PKEY_MSBLOB, decode_EVP_PKEY_prov, test_mem, check_public_MSBLOB, dump_der, 0); } -#endif #define KEYS(KEYTYPE) \ static EVP_PKEY *key_##KEYTYPE = NULL @@ -868,12 +858,11 @@ static int test_public_via_MSBLOB(const char *type, EVP_PKEY *key) test_protected_via_legacy_PEM(KEYTYPEstr, key_##KEYTYPE); \ } -#define ADD_TEST_SUITE_LEGACY(KEYTYPE) \ - ADD_TEST(test_unprotected_##KEYTYPE##_via_legacy_PEM); \ +#define ADD_TEST_SUITE_LEGACY(KEYTYPE) \ + ADD_TEST(test_unprotected_##KEYTYPE##_via_legacy_PEM); \ ADD_TEST(test_protected_##KEYTYPE##_via_legacy_PEM) -#ifndef OPENSSL_NO_DSA -# define IMPLEMENT_TEST_SUITE_MSBLOB(KEYTYPE, KEYTYPEstr) \ +#define IMPLEMENT_TEST_SUITE_MSBLOB(KEYTYPE, KEYTYPEstr) \ static int test_unprotected_##KEYTYPE##_via_MSBLOB(void) \ { \ return test_unprotected_via_MSBLOB(KEYTYPEstr, key_##KEYTYPE); \ @@ -883,12 +872,12 @@ static int test_public_via_MSBLOB(const char *type, EVP_PKEY *key) return test_public_via_MSBLOB(KEYTYPEstr, key_##KEYTYPE); \ } -# define ADD_TEST_SUITE_MSBLOB(KEYTYPE) \ - ADD_TEST(test_unprotected_##KEYTYPE##_via_MSBLOB); \ +#define ADD_TEST_SUITE_MSBLOB(KEYTYPE) \ + ADD_TEST(test_unprotected_##KEYTYPE##_via_MSBLOB); \ ADD_TEST(test_public_##KEYTYPE##_via_MSBLOB) -# ifndef OPENSSL_NO_RC4 -# define IMPLEMENT_TEST_SUITE_PVK(KEYTYPE, KEYTYPEstr) \ +#ifndef OPENSSL_NO_RC4 +# define IMPLEMENT_TEST_SUITE_PVK(KEYTYPE, KEYTYPEstr) \ static int test_unprotected_##KEYTYPE##_via_PVK(void) \ { \ return test_unprotected_via_PVK(KEYTYPEstr, key_##KEYTYPE); \ @@ -898,10 +887,18 @@ static int test_public_via_MSBLOB(const char *type, EVP_PKEY *key) return test_protected_via_PVK(KEYTYPEstr, key_##KEYTYPE); \ } -# define ADD_TEST_SUITE_PVK(KEYTYPE) \ - ADD_TEST(test_unprotected_##KEYTYPE##_via_PVK); \ +# define ADD_TEST_SUITE_PVK(KEYTYPE) \ + ADD_TEST(test_unprotected_##KEYTYPE##_via_PVK); \ ADD_TEST(test_protected_##KEYTYPE##_via_PVK) -# endif +#else +# define IMPLEMENT_TEST_SUITE_PVK(KEYTYPE, KEYTYPEstr) \ + static int test_unprotected_##KEYTYPE##_via_PVK(void) \ + { \ + return test_unprotected_via_PVK(KEYTYPEstr, key_##KEYTYPE); \ + } + +# define ADD_TEST_SUITE_PVK(KEYTYPE) \ + ADD_TEST(test_unprotected_##KEYTYPE##_via_PVK) #endif #ifndef OPENSSL_NO_DH @@ -922,9 +919,7 @@ IMPLEMENT_TEST_SUITE(DSA, "DSA") IMPLEMENT_TEST_SUITE_PARAMS(DSA, "DSA") IMPLEMENT_TEST_SUITE_LEGACY(DSA, "DSA") IMPLEMENT_TEST_SUITE_MSBLOB(DSA, "DSA") -# ifndef OPENSSL_NO_RC4 IMPLEMENT_TEST_SUITE_PVK(DSA, "DSA") -# endif #endif #ifndef OPENSSL_NO_EC DOMAIN_KEYS(EC); @@ -967,12 +962,8 @@ IMPLEMENT_TEST_SUITE(RSA_PSS, "RSA-PSS") * RSA-PSS has no support for PEM_write_bio_PrivateKey_traditional(), * so no legacy tests. */ -#ifndef OPENSSL_NO_DSA IMPLEMENT_TEST_SUITE_MSBLOB(RSA, "RSA") -# ifndef OPENSSL_NO_RC4 IMPLEMENT_TEST_SUITE_PVK(RSA, "RSA") -# endif -#endif #ifndef OPENSSL_NO_EC /* Explicit parameters that match a named curve */ @@ -1252,9 +1243,7 @@ int setup_tests(void) ADD_TEST_SUITE_PARAMS(DSA); ADD_TEST_SUITE_LEGACY(DSA); ADD_TEST_SUITE_MSBLOB(DSA); -# ifndef OPENSSL_NO_RC4 ADD_TEST_SUITE_PVK(DSA); -# endif #endif #ifndef OPENSSL_NO_EC ADD_TEST_SUITE(EC); @@ -1286,12 +1275,8 @@ int setup_tests(void) * RSA-PSS has no support for PEM_write_bio_PrivateKey_traditional(), * so no legacy tests. */ -#ifndef OPENSSL_NO_DSA ADD_TEST_SUITE_MSBLOB(RSA); -# ifndef OPENSSL_NO_RC4 ADD_TEST_SUITE_PVK(RSA); -# endif -#endif } return 1; |