summaryrefslogtreecommitdiff
path: root/lib/libcrypto/pkcs12/p12_attr.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libcrypto/pkcs12/p12_attr.c')
-rw-r--r--lib/libcrypto/pkcs12/p12_attr.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/lib/libcrypto/pkcs12/p12_attr.c b/lib/libcrypto/pkcs12/p12_attr.c
index 78d510b1009..65bfaa039ed 100644
--- a/lib/libcrypto/pkcs12/p12_attr.c
+++ b/lib/libcrypto/pkcs12/p12_attr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: p12_attr.c,v 1.11 2018/05/13 14:15:01 tb Exp $ */
+/* $OpenBSD: p12_attr.c,v 1.12 2018/08/24 20:07:41 tb Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project 1999.
*/
@@ -77,14 +77,10 @@ PKCS12_add_localkeyid(PKCS12_SAFEBAG *bag, unsigned char *name, int namelen)
int
PKCS8_add_keyusage(PKCS8_PRIV_KEY_INFO *p8, int usage)
{
- unsigned char us_val;
+ unsigned char us_val = (unsigned char)usage;
- 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;
+ return PKCS8_pkey_add1_attr_by_NID(p8, NID_key_usage, V_ASN1_BIT_STRING,
+ &us_val, 1);
}
/* Add a friendlyname to a safebag */