diff options
author | Theo Buehler <tb@cvs.openbsd.org> | 2024-08-22 12:22:43 +0000 |
---|---|---|
committer | Theo Buehler <tb@cvs.openbsd.org> | 2024-08-22 12:22:43 +0000 |
commit | 92aeef1628fbd9787157b59e970d8b2f957c52aa (patch) | |
tree | cb9b892faca1ab61b8a57725dfa1427de954631b /lib/libcrypto/pkcs12 | |
parent | 9195d917ec4e30fc665c33c5c8ed30ac33cc161d (diff) |
Remove copy_bag_attr()
It is no longer possible to set an attribute on an EVP_PKEY, so this
code is dead.
ok miod
Diffstat (limited to 'lib/libcrypto/pkcs12')
-rw-r--r-- | lib/libcrypto/pkcs12/p12_crt.c | 34 |
1 files changed, 1 insertions, 33 deletions
diff --git a/lib/libcrypto/pkcs12/p12_crt.c b/lib/libcrypto/pkcs12/p12_crt.c index 55fb7fd6380..502ccecd254 100644 --- a/lib/libcrypto/pkcs12/p12_crt.c +++ b/lib/libcrypto/pkcs12/p12_crt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: p12_crt.c,v 1.25 2024/07/15 15:43:25 tb Exp $ */ +/* $OpenBSD: p12_crt.c,v 1.26 2024/08/22 12:22:42 tb Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project. */ @@ -69,33 +69,6 @@ static int pkcs12_add_bag(STACK_OF(PKCS12_SAFEBAG) **pbags, PKCS12_SAFEBAG *bag); -static int -copy_bag_attr(PKCS12_SAFEBAG *bag, EVP_PKEY *pkey, int nid) -{ - X509_ATTRIBUTE *attr = NULL; - const ASN1_OBJECT *obj; - int i; - - if ((obj = OBJ_nid2obj(nid)) == NULL) { - /* XXX - this seems wrong but preserves behavior. */ - return 1; - } - - for (i = 0; i < sk_X509_ATTRIBUTE_num(pkey->attributes); i++) { - attr = sk_X509_ATTRIBUTE_value(pkey->attributes, i); - if (OBJ_cmp(attr->object, obj) == 0) - break; - attr = NULL; - } - - if (attr == NULL) - return 1; - - if (!X509at_add1_attr(&bag->attrib, attr)) - return 0; - return 1; -} - PKCS12 * PKCS12_create(const char *pass, const char *name, EVP_PKEY *pkey, X509 *cert, STACK_OF(X509) *ca, int nid_key, int nid_cert, int iter, int mac_iter, @@ -158,11 +131,6 @@ PKCS12_create(const char *pass, const char *name, EVP_PKEY *pkey, X509 *cert, if (!bag) goto err; - if (!copy_bag_attr(bag, pkey, NID_ms_csp_name)) - goto err; - if (!copy_bag_attr(bag, pkey, NID_LocalKeySet)) - goto err; - if (name && !PKCS12_add_friendlyname(bag, name, -1)) goto err; if (keyidlen && !PKCS12_add_localkeyid(bag, keyid, keyidlen)) |