[openssl/openssl] 0c841c: Make X509_ATTRIBUTE accessor functions const-correct

0 views
Skip to first unread message

kovan

unread,
Feb 13, 2026, 9:47:37 AMFeb 13
to openssl...@openssl.org
Branch: refs/heads/master
Home: https://github.com/openssl/openssl
Commit: 0c841cd5aac5c9ee0c135689e131cd58c3fcea5d
https://github.com/openssl/openssl/commit/0c841cd5aac5c9ee0c135689e131cd58c3fcea5d
Author: kovan <xau...@gmail.com>
Date: 2026-02-13 (Fri, 13 Feb 2026)

Changed paths:
M apps/pkcs12.c
M crypto/pkcs12/p12_attr.c
M crypto/pkcs12/p12_sbag.c
M crypto/x509/t_acert.c
M crypto/x509/t_req.c
M crypto/x509/v3_aaa.c
M crypto/x509/v3_sda.c
M crypto/x509/x509_att.c
M crypto/x509/x509_req.c
M demos/cms/cms_ver.c
M doc/man3/PKCS12_SAFEBAG_get0_attrs.pod
M doc/man3/X509_ATTRIBUTE.pod
M include/openssl/pkcs12.h.in
M include/openssl/x509.h.in
M test/helpers/pkcs12.c

Log Message:
-----------
Make X509_ATTRIBUTE accessor functions const-correct

The X509_ATTRIBUTE accessor functions were not const-correct, preventing
callers from usefully interacting with a const X509_ATTRIBUTE pointer.

Update the following functions to accept const X509_ATTRIBUTE * and
return const pointers where appropriate:

- X509_ATTRIBUTE_get0_object: returns const ASN1_OBJECT *
- X509_ATTRIBUTE_get0_type: returns const ASN1_TYPE *
- X509_ATTRIBUTE_get0_data: returns const void *

Also update dependent PKCS12 functions:
- PKCS12_get_attr_gen: returns const ASN1_TYPE *
- PKCS12_get_attr: returns const ASN1_TYPE * (deprecated)
- PKCS8_get_attr: returns const ASN1_TYPE *

Update all callers to use const pointers for the return values.

Fixes #29811

Co-Authored-By: Claude Opus 4.5 <nor...@anthropic.com>

Reviewed-by: Frederik Wedel-Heinen <fwh.o...@gmail.com>
Reviewed-by: Dmitry Belyavskiy <bel...@gmail.com>
Reviewed-by: David von Oheimb <david.vo...@siemens.com>
Reviewed-by: Tim Hudson <t...@openssl.org>
MergeDate: Fri Feb 13 14:46:26 2026
(Merged from https://github.com/openssl/openssl/pull/29813)


Commit: d24535c973bfb89c5bdc23452bbf7d49ae2361a1
https://github.com/openssl/openssl/commit/d24535c973bfb89c5bdc23452bbf7d49ae2361a1
Author: John Smith <xau...@gmail.com>
Date: 2026-02-13 (Fri, 13 Feb 2026)

Changed paths:
M crypto/cms/cms_att.c
M crypto/cms/cms_ess.c
M crypto/cms/cms_local.h
M crypto/cms/cms_sd.c
M crypto/pkcs7/pk7_attr.c
M crypto/pkcs7/pk7_doit.c
M crypto/pkcs7/pk7_smime.c
M crypto/ts/ts_rsp_verify.c
M crypto/x509/x509_att.c
M include/openssl/cms.h.in
M include/openssl/pkcs7.h.in
M include/openssl/x509.h.in

Log Message:
-----------
Propagate const-correctness to PKCS7, CMS, and X509 attribute functions

Following the const-correctness changes to X509_ATTRIBUTE accessor
functions, update all dependent functions to also return const pointers:

PKCS7 functions:
- PKCS7_get_attribute: returns const ASN1_TYPE *
- PKCS7_get_signed_attribute: returns const ASN1_TYPE *
- PKCS7_digest_from_attributes: returns const ASN1_OCTET_STRING *

X509 functions:
- X509at_get0_data_by_OBJ: returns const void *

CMS functions:
- CMS_signed_get0_data_by_OBJ: returns const void *
- CMS_unsigned_get0_data_by_OBJ: returns const void *

Update all callers to use const-qualified pointers for return values.

Co-Authored-By: Claude Opus 4.5 <nor...@anthropic.com>

Reviewed-by: Frederik Wedel-Heinen <fwh.o...@gmail.com>
Reviewed-by: Dmitry Belyavskiy <bel...@gmail.com>
Reviewed-by: David von Oheimb <david.vo...@siemens.com>
Reviewed-by: Tim Hudson <t...@openssl.org>
MergeDate: Fri Feb 13 14:46:28 2026
(Merged from https://github.com/openssl/openssl/pull/29813)


Commit: 4cf52a2feda838b99a9255417844fbd20420159d
https://github.com/openssl/openssl/commit/4cf52a2feda838b99a9255417844fbd20420159d
Author: kovan <xau...@gmail.com>
Date: 2026-02-13 (Fri, 13 Feb 2026)

Changed paths:
M CHANGES.md

Log Message:
-----------
doc: add CHANGES.md entry for const-correct X509_ATTRIBUTE functions

Co-Authored-By: Claude Opus 4.5 <nor...@anthropic.com>

Reviewed-by: Frederik Wedel-Heinen <fwh.o...@gmail.com>
Reviewed-by: Dmitry Belyavskiy <bel...@gmail.com>
Reviewed-by: David von Oheimb <david.vo...@siemens.com>
Reviewed-by: Tim Hudson <t...@openssl.org>
MergeDate: Fri Feb 13 14:46:30 2026
(Merged from https://github.com/openssl/openssl/pull/29813)


Compare: https://github.com/openssl/openssl/compare/4eb8a222c9ec...4cf52a2feda8

To unsubscribe from these emails, change your notification settings at https://github.com/openssl/openssl/settings/notifications
Reply all
Reply to author
Forward
0 new messages