]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Removed ASN1_STRING_data()
authorBob Beck <beck@openssl.org>
Fri, 14 Nov 2025 18:49:17 +0000 (11:49 -0700)
committerTomas Mraz <tomas@openssl.org>
Mon, 24 Nov 2025 18:18:18 +0000 (19:18 +0100)
This has been deprecated since 1.1.0 and is in the way for
improvements that could make ASN1_STRING opaque. (#29177)

Reviewed-by: Paul Dale <paul.dale@oracle.com>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Norbert Pocs <norbertp@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/29149)

CHANGES.md
crypto/asn1/asn1_lib.c
doc/man3/ASN1_STRING_length.pod
include/openssl/asn1.h.in
util/libcrypto.num

index a57ed8ab7fe4bbcf3564da03ac313b64754b13ec..9efb5315a69fd2ea4055effd55e94b4324c4431a 100644 (file)
@@ -32,6 +32,10 @@ OpenSSL 4.0
 
 ### Changes between 3.6 and 4.0 [xx XXX xxxx]
 
+ * The deprecated function ASN1_STRING_data has been removed.
+
+   *Bob Beck*
+
  * various function parameters have been constified,
    in particular for X509-related functions.
 
index 34db3b4ca726b774996896f4c9e49b2a6ceee5b0..cb50a3507249b3d93cfc4e5f2d114bc66f87392a 100644 (file)
@@ -424,13 +424,6 @@ const unsigned char *ASN1_STRING_get0_data(const ASN1_STRING *x)
     return x->data;
 }
 
-#ifndef OPENSSL_NO_DEPRECATED_1_1_0
-unsigned char *ASN1_STRING_data(ASN1_STRING *x)
-{
-    return x->data;
-}
-#endif
-
 /* |max_len| excludes NUL terminator and may be 0 to indicate no restriction */
 char *ossl_sk_ASN1_UTF8STRING2text(STACK_OF(ASN1_UTF8STRING) *text,
                                    const char *sep, size_t max_len)
index 8354cea8bdcd9595eb6ad54e13689f2d83840878..47cacb253a0c8ba50fcd8247b2b45faeac54820c 100644 (file)
@@ -3,7 +3,7 @@
 =head1 NAME
 
 ASN1_STRING_dup, ASN1_STRING_cmp, ASN1_STRING_set, ASN1_STRING_length,
-ASN1_STRING_type, ASN1_STRING_get0_data, ASN1_STRING_data,
+ASN1_STRING_type, ASN1_STRING_get0_data,
 ASN1_STRING_to_UTF8 - ASN1_STRING utility functions
 
 =head1 SYNOPSIS
@@ -12,7 +12,6 @@ ASN1_STRING_to_UTF8 - ASN1_STRING utility functions
 
  int ASN1_STRING_length(ASN1_STRING *x);
  const unsigned char *ASN1_STRING_get0_data(const ASN1_STRING *x);
- unsigned char *ASN1_STRING_data(ASN1_STRING *x);
 
  ASN1_STRING *ASN1_STRING_dup(const ASN1_STRING *a);
 
@@ -34,10 +33,6 @@ ASN1_STRING_get0_data() returns an internal pointer to the data of I<x>.
 Since this is an internal pointer it should B<not> be freed or
 modified in any way. I<x> B<MUST NOT> be NULL.
 
-ASN1_STRING_data() is similar to ASN1_STRING_get0_data() except the
-returned value is not constant. This function is deprecated:
-applications should use ASN1_STRING_get0_data() instead.
-
 ASN1_STRING_dup() returns a copy of the structure I<a>.
 
 ASN1_STRING_cmp() compares I<a> and I<b> returning 0 if the two
@@ -68,11 +63,12 @@ These functions should B<not> be used to examine or modify B<ASN1_INTEGER>
 or B<ASN1_ENUMERATED> types: the relevant B<INTEGER> or B<ENUMERATED>
 utility functions should be used instead.
 
-In general it cannot be assumed that the data returned by ASN1_STRING_data()
-is null terminated or does not contain embedded nulls. The actual format
-of the data will depend on the actual string type itself: for example
-for an IA5String the data will be ASCII, for a BMPString two bytes per
-character in big endian format, and for a UTF8String it will be in UTF8 format.
+In general it cannot be assumed that the data returned by
+ASN1_STRING_get0_data() is null terminated or does not contain
+embedded nulls. The actual format of the data will depend on the
+actual string type itself: for example for an IA5String the data will
+be ASCII, for a BMPString two bytes per character in big endian
+format, and for a UTF8String it will be in UTF8 format.
 
 Similar care should be take to ensure the data is in the correct format
 when calling ASN1_STRING_set().
@@ -81,7 +77,7 @@ when calling ASN1_STRING_set().
 
 ASN1_STRING_length() returns the length of the content of I<x>.
 
-ASN1_STRING_get0_data() and ASN1_STRING_data() return an internal pointer to
+ASN1_STRING_get0_data() returns an internal pointer to
 the data of I<x>.
 
 ASN1_STRING_dup() returns a valid B<ASN1_STRING> structure or NULL if an
index b39929a0662a64351488aada7e0d9957631191c1..e25fd1c9c3aeae64a0d6bdab50f19e0bba177a3e 100644 (file)
@@ -585,9 +585,6 @@ int ASN1_STRING_length(const ASN1_STRING *x);
 OSSL_DEPRECATEDIN_3_0 void ASN1_STRING_length_set(ASN1_STRING *x, int n);
 # endif
 int ASN1_STRING_type(const ASN1_STRING *x);
-# ifndef OPENSSL_NO_DEPRECATED_1_1_0
-OSSL_DEPRECATEDIN_1_1_0 unsigned char *ASN1_STRING_data(ASN1_STRING *x);
-# endif
 const unsigned char *ASN1_STRING_get0_data(const ASN1_STRING *x);
 
 DECLARE_ASN1_FUNCTIONS(ASN1_BIT_STRING)
index 9f351914e1dd855c7134120109294a9d85a389b8..bbdf9af66e05f9b5f57ddd795df1a20ae6d999ed 100644 (file)
@@ -2827,7 +2827,6 @@ ASN1_STRING_set0                        ? 4_0_0   EXIST::FUNCTION:
 ASN1_STRING_length                      ?      4_0_0   EXIST::FUNCTION:
 ASN1_STRING_length_set                  ?      4_0_0   EXIST::FUNCTION:DEPRECATEDIN_3_0
 ASN1_STRING_type                        ?      4_0_0   EXIST::FUNCTION:
-ASN1_STRING_data                        ?      4_0_0   EXIST::FUNCTION:DEPRECATEDIN_1_1_0
 ASN1_STRING_get0_data                   ?      4_0_0   EXIST::FUNCTION:
 d2i_ASN1_BIT_STRING                     ?      4_0_0   EXIST::FUNCTION:
 i2d_ASN1_BIT_STRING                     ?      4_0_0   EXIST::FUNCTION: