Act on deprecation of LONG and ZLONG, step 1
authorRichard Levitte <levitte@openssl.org>
Wed, 5 Apr 2017 11:21:06 +0000 (13:21 +0200)
committerRichard Levitte <levitte@openssl.org>
Mon, 10 Apr 2017 10:11:00 +0000 (12:11 +0200)
Don't compile code that still uses LONG when it's deprecated

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3126)

crypto/asn1/asn1_item_list.h
fuzz/asn1.c
test/asn1_encode_test.c

index b753d71..27608b7 100644 (file)
@@ -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),
index 63d26f9..0c61315 100644 (file)
@@ -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),
index 26eec62..9b33314 100644 (file)
@@ -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);