summaryrefslogtreecommitdiffstats
path: root/crypto/pkcs12/p12_attr.c
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2016-03-04 03:48:39 +0000
committerDr. Stephen Henson <steve@openssl.org>2016-03-07 17:11:21 +0000
commit54dbf42398e23349b59f258a3dd60387bbc5ba13 (patch)
tree4de8d56f6662ebb120d4bf15df140be8460d69b4 /crypto/pkcs12/p12_attr.c
parent1e61392296d15b1edb89e346e1f75d0235aba2e7 (diff)
Make PKCS8_PRIV_KEY_INFO opaque.
Make PKCS8_PRIV_KEY_INFO opaque. Several accessor functions already exist for this structure. Two new ones were added to handle attributes. The old handling of broken formats has been removed and the corresponding structures simplified. Reviewed-by: Rich Salz <rsalz@openssl.org>
Diffstat (limited to 'crypto/pkcs12/p12_attr.c')
-rw-r--r--crypto/pkcs12/p12_attr.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/crypto/pkcs12/p12_attr.c b/crypto/pkcs12/p12_attr.c
index fba35cd63b..994f3868d0 100644
--- a/crypto/pkcs12/p12_attr.c
+++ b/crypto/pkcs12/p12_attr.c
@@ -77,13 +77,9 @@ int PKCS12_add_localkeyid(PKCS12_SAFEBAG *bag, unsigned char *name,
int PKCS8_add_keyusage(PKCS8_PRIV_KEY_INFO *p8, int usage)
{
- unsigned char us_val;
- us_val = (unsigned char)usage;
- if (X509at_add1_attr_by_NID(&p8->attributes, NID_key_usage,
- V_ASN1_BIT_STRING, &us_val, 1))
- return 1;
- else
- return 0;
+ unsigned char us_val = (unsigned char)usage;
+ return PKCS8_pkey_add1_attr_by_NID(p8, NID_key_usage,
+ V_ASN1_BIT_STRING, &us_val, 1);
}
/* Add a friendlyname to a safebag */