summaryrefslogtreecommitdiffstats
path: root/crypto/asn1
diff options
context:
space:
mode:
authorDmitry Belyavskiy <beldmit@gmail.com>2020-01-20 14:01:02 +0100
committerDmitry Belyavskiy <beldmit@gmail.com>2020-01-24 13:09:05 +0100
commit408113c05087393cc1623a51a0e5bfe8483e302d (patch)
treee81ff6cd28e89ad5c2e5791d65642b9b7d53fd61 /crypto/asn1
parentModify DSA and DH keys to use a shared FFC_PARAMS struct (diff)
downloadopenssl-408113c05087393cc1623a51a0e5bfe8483e302d.tar.xz
openssl-408113c05087393cc1623a51a0e5bfe8483e302d.zip
New functions for PKCS8 attributes management
This commit introduces functions PKCS8_pkey_add1_attr_by_OBJ and PKCS8_pkey_add1_attr Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from https://github.com/openssl/openssl/pull/10900)
Diffstat (limited to 'crypto/asn1')
-rw-r--r--crypto/asn1/p8_pkey.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/crypto/asn1/p8_pkey.c b/crypto/asn1/p8_pkey.c
index c55353ae11..77e64a9ac1 100644
--- a/crypto/asn1/p8_pkey.c
+++ b/crypto/asn1/p8_pkey.c
@@ -78,3 +78,14 @@ int PKCS8_pkey_add1_attr_by_NID(PKCS8_PRIV_KEY_INFO *p8, int nid, int type,
return 1;
return 0;
}
+
+int PKCS8_pkey_add1_attr_by_OBJ(PKCS8_PRIV_KEY_INFO *p8, const ASN1_OBJECT *obj, int type,
+ const unsigned char *bytes, int len)
+{
+ return (X509at_add1_attr_by_OBJ(&p8->attributes, obj, type, bytes, len) != NULL);
+}
+
+int PKCS8_pkey_add1_attr(PKCS8_PRIV_KEY_INFO *p8, X509_ATTRIBUTE *attr)
+{
+ return (X509at_add1_attr(&p8->attributes, attr) != NULL);
+}