mirror of
https://github.com/openssl/openssl.git
synced 2026-06-06 20:18:09 +00:00
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)