Files
Bob Beck 68c0321e90 Provide ASN1_STRING_new_not_owned()
This function provides the ability to construct an ASN1_STRING
containing data that is not owned by the constructed ASN1_STRING. The
resulting ASN1_STRING, when freed, will not free the data, and it is
the caller's resposibility to ensure that the data lives past the
lifetime of any returned ASN1_STRING.

Why? you may ask? Many places where ->data and ->length were used
directly in the past before the opaquification of ASN1_STRING were
for this purpose, whether used for actual static data, or to turn
bytes created by and in control of the caller into an ASN1_STRING
for temporary use as an input. This function makes this easier
to do without making copies.

The function deliberately does not allow the creation of a BIT_STRING
as this would require also always providing unused bits, which is
annoying and unnecessary for almost all potential use cases.

For: https://github.com/openssl/openssl/issues/29861
For: https://github.com/openssl/openssl/issues/30162

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
MergeDate: Wed Jun  3 11:42:49 2026
(Merged from https://github.com/openssl/openssl/pull/30964)
2026-06-03 13:41:32 +02:00
..
2026-05-26 16:28:30 +02:00
2026-03-10 14:37:52 +00:00
2025-09-02 13:05:45 +00:00
2025-12-04 07:32:18 -05:00
2025-09-02 13:05:45 +00:00
2026-02-17 09:09:01 -05:00
2026-03-27 17:52:06 +01:00
2025-03-12 13:35:59 +00:00
2024-04-09 13:43:26 +02:00
2026-03-10 14:37:52 +00:00
2022-12-08 07:01:33 +01:00
2025-12-04 07:32:18 -05:00