From: David Benjamin Date: Fri, 18 Sep 2020 19:21:43 +0000 (-0400) Subject: Deprecate ASN1_STRING_length_set in OpenSSL 3.0. X-Git-Tag: openssl-3.0.0-alpha7~185 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=08e9684c53deab7d815be47bfdf0f324a0d10ad9;p=thirdparty%2Fopenssl.git Deprecate ASN1_STRING_length_set in OpenSSL 3.0. Fixes #12885 Reviewed-by: Kurt Roeckx GH: #12922 --- diff --git a/crypto/asn1/asn1_lib.c b/crypto/asn1/asn1_lib.c index 1331f608f42..d6160ac9796 100644 --- a/crypto/asn1/asn1_lib.c +++ b/crypto/asn1/asn1_lib.c @@ -387,10 +387,12 @@ int ASN1_STRING_length(const ASN1_STRING *x) return x->length; } +#ifndef OPENSSL_NO_DEPRECATED_3_0 void ASN1_STRING_length_set(ASN1_STRING *x, int len) { x->length = len; } +#endif int ASN1_STRING_type(const ASN1_STRING *x) { diff --git a/include/openssl/asn1.h.in b/include/openssl/asn1.h.in index c4d6f068ae1..dfb1c9cae57 100644 --- a/include/openssl/asn1.h.in +++ b/include/openssl/asn1.h.in @@ -539,7 +539,7 @@ int ASN1_STRING_cmp(const ASN1_STRING *a, const ASN1_STRING *b); int ASN1_STRING_set(ASN1_STRING *str, const void *data, int len); void ASN1_STRING_set0(ASN1_STRING *str, void *data, int len); int ASN1_STRING_length(const ASN1_STRING *x); -void ASN1_STRING_length_set(ASN1_STRING *x, int n); +DEPRECATEDIN_3_0(void ASN1_STRING_length_set(ASN1_STRING *x, int n)) int ASN1_STRING_type(const ASN1_STRING *x); DEPRECATEDIN_1_1_0(unsigned char *ASN1_STRING_data(ASN1_STRING *x)) const unsigned char *ASN1_STRING_get0_data(const ASN1_STRING *x); diff --git a/util/libcrypto.num b/util/libcrypto.num index 0be0ada89de..96fd637ba06 100644 --- a/util/libcrypto.num +++ b/util/libcrypto.num @@ -1813,7 +1813,7 @@ BIO_next 1855 3_0_0 EXIST::FUNCTION: ASN1_STRING_set_default_mask_asc 1856 3_0_0 EXIST::FUNCTION: X509_CRL_new 1857 3_0_0 EXIST::FUNCTION: i2b_PrivateKey_bio 1858 3_0_0 EXIST::FUNCTION:DSA -ASN1_STRING_length_set 1859 3_0_0 EXIST::FUNCTION: +ASN1_STRING_length_set 1859 3_0_0 EXIST::FUNCTION:DEPRECATEDIN_3_0 PEM_write_PKCS8 1860 3_0_0 EXIST::FUNCTION:STDIO PKCS7_digest_from_attributes 1861 3_0_0 EXIST::FUNCTION: EC_GROUP_set_curve_GFp 1862 3_0_0 EXIST::FUNCTION:DEPRECATEDIN_3_0,EC