diff options
author | Graham Woodward <graham.woodward@ibm.com> | 2022-08-19 08:46:47 +0100 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2022-09-23 17:40:02 +0100 |
commit | e869c867c1c405de3b6538586f17b67937556a4b (patch) | |
tree | 21feab85e639e54c1e2a8a6d1a68a807f2e7dae4 /crypto/pkcs12/p12_attr.c | |
parent | ecc920b3277311e859282b6d400ba8566d7ea8c1 (diff) |
Allow PKCS12 export to set arbitrary bag attributes
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19025)
Diffstat (limited to 'crypto/pkcs12/p12_attr.c')
-rw-r--r-- | crypto/pkcs12/p12_attr.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/crypto/pkcs12/p12_attr.c b/crypto/pkcs12/p12_attr.c index 568a32a55e..d9b2db9aaf 100644 --- a/crypto/pkcs12/p12_attr.c +++ b/crypto/pkcs12/p12_attr.c @@ -119,3 +119,11 @@ PKCS12_SAFEBAG_get0_attrs(const PKCS12_SAFEBAG *bag) { return bag->attrib; } + +void PKCS12_SAFEBAG_set0_attrs(PKCS12_SAFEBAG *bag, const STACK_OF(X509_ATTRIBUTE) *attrs) +{ + if (bag->attrib != attrs) + sk_X509_ATTRIBUTE_free(bag->attrib); + + bag->attrib = (STACK_OF(X509_ATTRIBUTE*))attrs; +} |