From 31ae516116343defd39d5b5ee800fa25eeab7638 Mon Sep 17 00:00:00 2001 From: Richard Levitte Date: Wed, 5 Apr 2017 13:21:06 +0200 Subject: [PATCH] Act on deprecation of LONG and ZLONG, step 1 Don't compile code that still uses LONG when it's deprecated Reviewed-by: Matt Caswell Reviewed-by: Rich Salz (Merged from https://github.com/openssl/openssl/pull/3126) --- crypto/asn1/asn1_item_list.h | 4 ++++ fuzz/asn1.c | 4 ++++ test/asn1_encode_test.c | 6 ++++++ 3 files changed, 14 insertions(+) diff --git a/crypto/asn1/asn1_item_list.h b/crypto/asn1/asn1_item_list.h index b753d7198b..27608b788c 100644 --- a/crypto/asn1/asn1_item_list.h +++ b/crypto/asn1/asn1_item_list.h @@ -78,7 +78,9 @@ static ASN1_ITEM_EXP *asn1_item_list[] = { ASN1_ITEM_ref(IPAddressRange), #endif ASN1_ITEM_ref(ISSUING_DIST_POINT), +#if OPENSSL_API_COMPAT < 0x10200000L ASN1_ITEM_ref(LONG), +#endif ASN1_ITEM_ref(NAME_CONSTRAINTS), ASN1_ITEM_ref(NETSCAPE_CERT_SEQUENCE), ASN1_ITEM_ref(NETSCAPE_SPKAC), @@ -159,7 +161,9 @@ static ASN1_ITEM_EXP *asn1_item_list[] = { ASN1_ITEM_ref(X509_SIG), ASN1_ITEM_ref(X509_VAL), ASN1_ITEM_ref(X509), +#if OPENSSL_API_COMPAT < 0x10200000L ASN1_ITEM_ref(ZLONG), +#endif ASN1_ITEM_ref(INT32), ASN1_ITEM_ref(UINT32), ASN1_ITEM_ref(ZINT32), diff --git a/fuzz/asn1.c b/fuzz/asn1.c index 63d26f9804..0c6131580c 100644 --- a/fuzz/asn1.c +++ b/fuzz/asn1.c @@ -100,7 +100,9 @@ static ASN1_ITEM_EXP *item_type[] = { ASN1_ITEM_ref(IPAddressRange), #endif ASN1_ITEM_ref(ISSUING_DIST_POINT), +#if OPENSSL_API_COMPAT < 0x10200000L ASN1_ITEM_ref(LONG), +#endif ASN1_ITEM_ref(NAME_CONSTRAINTS), ASN1_ITEM_ref(NETSCAPE_CERT_SEQUENCE), ASN1_ITEM_ref(NETSCAPE_SPKAC), @@ -180,7 +182,9 @@ static ASN1_ITEM_EXP *item_type[] = { ASN1_ITEM_ref(X509_REVOKED), ASN1_ITEM_ref(X509_SIG), ASN1_ITEM_ref(X509_VAL), +#if OPENSSL_API_COMPAT < 0x10200000L ASN1_ITEM_ref(ZLONG), +#endif ASN1_ITEM_ref(INT32), ASN1_ITEM_ref(ZINT32), ASN1_ITEM_ref(UINT32), diff --git a/test/asn1_encode_test.c b/test/asn1_encode_test.c index 26eec6272a..9b3331494d 100644 --- a/test/asn1_encode_test.c +++ b/test/asn1_encode_test.c @@ -170,6 +170,7 @@ typedef struct { ENCDEC_DATA(-1, -1), \ ENCDEC_DATA(0, ASN1_LONG_UNDEF) +#if OPENSSL_API_COMPAT < 0x10200000L /***** LONG ******************************************************************/ typedef struct { @@ -255,6 +256,7 @@ static TEST_PACKAGE long_test_package_64bit = { (i2d_fn *)i2d_ASN1_LONG_DATA, (d2i_fn *)d2i_ASN1_LONG_DATA, (ifree_fn *)ASN1_LONG_DATA_free }; +#endif /***** INT32 *****************************************************************/ @@ -676,6 +678,7 @@ static int test_intern(const TEST_PACKAGE *package) return fail == 0; } +#if OPENSSL_API_COMPAT < 0x10200000L static int test_long_32bit(void) { return test_intern(&long_test_package_32bit); @@ -685,6 +688,7 @@ static int test_long_64bit(void) { return test_intern(&long_test_package_64bit); } +#endif static int test_int32(void) { @@ -708,8 +712,10 @@ static int test_uint64(void) void register_tests(void) { +#if OPENSSL_API_COMPAT < 0x10200000L ADD_TEST(test_long_32bit); ADD_TEST(test_long_64bit); +#endif ADD_TEST(test_int32); ADD_TEST(test_uint32); ADD_TEST(test_int64); -- 2.25.1