]> git.ipfire.org Git - thirdparty/openssl.git/commit
asn1: use ASN1_STRING accessors in crypto/cmp, crypto/ct, crypto/sm2, crypto/ts
authorHamzah M. Yamani <hamzah.yamani125@gmail.com>
Sun, 1 Mar 2026 20:21:08 +0000 (15:21 -0500)
committerNorbert Pocs <norbertp@openssl.org>
Thu, 12 Mar 2026 08:53:41 +0000 (09:53 +0100)
commit31eb4e7f9ecf0e37bc4085ab507409b7af2220bd
treece783407044c2803f6542c33a438652368991e20
parent5f1ca4105b65cd344d9c6357dabc7147578aae77
asn1: use ASN1_STRING accessors in crypto/cmp, crypto/ct, crypto/sm2, crypto/ts

Replace direct ASN1_STRING struct member access (->data, ->length) with
public accessor functions ASN1_STRING_get0_data() and ASN1_STRING_length()
in consumer code across four subsystems.

Also fix i2d_SCT_LIST() in crypto/ct/ct_oct.c to heap-allocate
ASN1_OCTET_STRING via ASN1_OCTET_STRING_new() and ASN1_STRING_set0()
rather than stack-allocating it, since the struct is now opaque.

Removes #include <crypto/asn1.h> from all modified files except
crypto/cmp/cmp_protect.c, which retains it for ossl_X509_ALGOR_from_nid().

Reviewed-by: Matt Caswell <matt@openssl.foundation>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
MergeDate: Thu Mar 12 08:53:50 2026
(Merged from https://github.com/openssl/openssl/pull/30223)
crypto/cmp/cmp_protect.c
crypto/ct/ct_oct.c
crypto/sm2/sm2_crypt.c
crypto/ts/ts_asn1.c
crypto/ts/ts_rsp_sign.c
crypto/ts/ts_rsp_verify.c