summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authortb <>2026-08-23 05:10:18 +0000
committertb <>2026-08-23 05:10:18 +0000
commit14389d69d556ad01385b487c8d920b5d6608e4b5 (patch)
tree1bfbe36c6f1d7a795907dba83baf05cb05b829d0 /src/lib
parent64afffacaee270dc57d21788b3d20128661cfc5d (diff)
downloadopenbsd-14389d69d556ad01385b487c8d920b5d6608e4b5.tar.gz
openbsd-14389d69d556ad01385b487c8d920b5d6608e4b5.tar.bz2
openbsd-14389d69d556ad01385b487c8d920b5d6608e4b5.zip
Make deprecation of ASN1_STRING_data(3) more prominent
The function has been deprecated for a long time: OpenSSL did so when adding ASN1_STRING_get0_data in 1.1.0. beck removed it from OpenSSL 4. The reason is that it returns a modifiable "string" and you should not be modifying an ASN1_STRING this way. You should be using one of the clumsy, inconvenient accessors. schwarze merged the deprecation when adding documentation for ASN1_STRING_get0_data() in 2018. Make this a bit more obvious: move function to the end of the documented functions in this page, and mark it deprecated in the SYNOPSIS, too. I'm aware that deprecation does not work. I was hopeful to be able to remove the function in the last cycle, but that did not happen and it might not happen in this cycle either. It will happen at some point, though. Prompted by a question by brad
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/libcrypto/man/ASN1_STRING_length.341
1 files changed, 22 insertions, 19 deletions
diff --git a/src/lib/libcrypto/man/ASN1_STRING_length.3 b/src/lib/libcrypto/man/ASN1_STRING_length.3
index 922ae89ac6..96eb50e193 100644
--- a/src/lib/libcrypto/man/ASN1_STRING_length.3
+++ b/src/lib/libcrypto/man/ASN1_STRING_length.3
@@ -1,4 +1,4 @@
1.\" $OpenBSD: ASN1_STRING_length.3,v 1.31 2025/06/08 22:37:23 schwarze Exp $ 1.\" $OpenBSD: ASN1_STRING_length.3,v 1.32 2026/08/23 05:10:18 tb Exp $
2.\" full merge up to: OpenSSL 24a535ea Sep 22 13:14:20 2020 +0100 2.\" full merge up to: OpenSSL 24a535ea Sep 22 13:14:20 2020 +0100
3.\" 3.\"
4.\" This file is a derived work. 4.\" This file is a derived work.
@@ -66,13 +66,12 @@
66.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 66.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
67.\" OF THE POSSIBILITY OF SUCH DAMAGE. 67.\" OF THE POSSIBILITY OF SUCH DAMAGE.
68.\" 68.\"
69.Dd $Mdocdate: June 8 2025 $ 69.Dd $Mdocdate: August 23 2026 $
70.Dt ASN1_STRING_LENGTH 3 70.Dt ASN1_STRING_LENGTH 3
71.Os 71.Os
72.Sh NAME 72.Sh NAME
73.Nm ASN1_STRING_cmp , 73.Nm ASN1_STRING_cmp ,
74.Nm ASN1_OCTET_STRING_cmp , 74.Nm ASN1_OCTET_STRING_cmp ,
75.Nm ASN1_STRING_data ,
76.Nm ASN1_STRING_dup , 75.Nm ASN1_STRING_dup ,
77.Nm ASN1_OCTET_STRING_dup , 76.Nm ASN1_OCTET_STRING_dup ,
78.Nm ASN1_STRING_get0_data , 77.Nm ASN1_STRING_get0_data ,
@@ -83,7 +82,8 @@
83.Nm ASN1_OCTET_STRING_set , 82.Nm ASN1_OCTET_STRING_set ,
84.Nm ASN1_STRING_copy , 83.Nm ASN1_STRING_copy ,
85.Nm ASN1_STRING_to_UTF8 , 84.Nm ASN1_STRING_to_UTF8 ,
86.Nm ASN1_STRING_type 85.Nm ASN1_STRING_type ,
86.Nm ASN1_STRING_data
87.Nd ASN1_STRING utility functions 87.Nd ASN1_STRING utility functions
88.Sh SYNOPSIS 88.Sh SYNOPSIS
89.Lb libcrypto 89.Lb libcrypto
@@ -98,10 +98,6 @@
98.Fa "const ASN1_OCTET_STRING *a" 98.Fa "const ASN1_OCTET_STRING *a"
99.Fa "const ASN1_OCTET_STRING *b" 99.Fa "const ASN1_OCTET_STRING *b"
100.Fc 100.Fc
101.Ft unsigned char *
102.Fo ASN1_STRING_data
103.Fa "ASN1_STRING *x"
104.Fc
105.Ft ASN1_STRING * 101.Ft ASN1_STRING *
106.Fo ASN1_STRING_dup 102.Fo ASN1_STRING_dup
107.Fa "const ASN1_STRING *a" 103.Fa "const ASN1_STRING *a"
@@ -155,6 +151,13 @@
155.Fo ASN1_STRING_type 151.Fo ASN1_STRING_type
156.Fa "const ASN1_STRING *x" 152.Fa "const ASN1_STRING *x"
157.Fc 153.Fc
154.Pp
155Deprecated:
156.Pp
157.Ft unsigned char *
158.Fo ASN1_STRING_data
159.Fa "ASN1_STRING *x"
160.Fc
158.Sh DESCRIPTION 161.Sh DESCRIPTION
159These functions manipulate 162These functions manipulate
160.Vt ASN1_STRING 163.Vt ASN1_STRING
@@ -171,15 +174,6 @@ does exactly the same as
171.Fn ASN1_STRING_cmp 174.Fn ASN1_STRING_cmp
172without providing any type safety. 175without providing any type safety.
173.Pp 176.Pp
174.Fn ASN1_STRING_data
175is similar to
176.Fn ASN1_STRING_get0_data
177except that the returned value is not constant.
178This function is deprecated.
179Applications should use
180.Fn ASN1_STRING_get0_data
181instead.
182.Pp
183.Fn ASN1_STRING_dup 177.Fn ASN1_STRING_dup
184allocates a new 178allocates a new
185.Vt ASN1_STRING 179.Vt ASN1_STRING
@@ -283,6 +277,15 @@ is set in the return value,
283.Fa x 277.Fa x
284is an ASN.1 INTEGER or ENUMERATED object with a negative value. 278is an ASN.1 INTEGER or ENUMERATED object with a negative value.
285.Pp 279.Pp
280.Fn ASN1_STRING_data
281is similar to
282.Fn ASN1_STRING_get0_data
283except that the returned value is not constant.
284This function is deprecated.
285Applications should use
286.Fn ASN1_STRING_get0_data
287instead.
288.Pp
286Almost all ASN.1 types are represented as 289Almost all ASN.1 types are represented as
287.Vt ASN1_STRING 290.Vt ASN1_STRING
288structures. 291structures.
@@ -341,9 +344,9 @@ In contrast to
341.Xr strcmp 3 , 344.Xr strcmp 3 ,
342the sign of the return value does not indicate lexicographical ordering. 345the sign of the return value does not indicate lexicographical ordering.
343.Pp 346.Pp
344.Fn ASN1_STRING_data
345and
346.Fn ASN1_STRING_get0_data 347.Fn ASN1_STRING_get0_data
348and
349.Fn ASN1_STRING_data
347return an internal pointer to the data of 350return an internal pointer to the data of
348.Fa x . 351.Fa x .
349.Pp 352.Pp