From a904e98b78b55e7a6213356225e45a04fdc457e1 Mon Sep 17 00:00:00 2001 From: Stef Walter Date: Mon, 18 Mar 2013 13:13:24 +0100 Subject: Refine looking up of attributes in arrays There was a class of bugs for looking up invalid or empty attributes in the internal PKCS#11 attribute arrays. * Refine what p11_attrs_find_valid() treats as valid * Rename p11_attrs_is_empty() to p11_attrs_terminator() for clarity --- tools/extract-openssl.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'tools/extract-openssl.c') diff --git a/tools/extract-openssl.c b/tools/extract-openssl.c index 13a1e05..bc7427a 100644 --- a/tools/extract-openssl.c +++ b/tools/extract-openssl.c @@ -107,16 +107,16 @@ load_usage_ext (p11_extract_info *ex, { CK_ATTRIBUTE attr = { CKA_OBJECT_ID, (void *)ext_oid, p11_oid_length (ext_oid) }; - CK_ATTRIBUTE *value; + void *value; + size_t length; - value = p11_attrs_find_valid (p11_dict_get (ex->stapled, &attr), CKA_VALUE); + value = p11_attrs_find_value (p11_dict_get (ex->stapled, &attr), CKA_VALUE, &length); if (value == NULL) { *oids = NULL; return true; } - *oids = p11_x509_parse_extended_key_usage (ex->asn1_defs, value->pValue, - value->ulValueLen); + *oids = p11_x509_parse_extended_key_usage (ex->asn1_defs, value, length); return_val_if_fail (*oids != NULL, false); return true; -- cgit v1.1