diff options
author | Stef Walter <stefw@gnome.org> | 2013-03-18 13:13:24 +0100 |
---|---|---|
committer | Stef Walter <stefw@gnome.org> | 2013-03-18 13:13:24 +0100 |
commit | a904e98b78b55e7a6213356225e45a04fdc457e1 (patch) | |
tree | e879e446a5402e59f4be13b7711e071c858edc26 /tools/extract-openssl.c | |
parent | f71baf6adf00626e73326149d55183bc62f827ae (diff) |
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
Diffstat (limited to 'tools/extract-openssl.c')
-rw-r--r-- | tools/extract-openssl.c | 8 |
1 files changed, 4 insertions, 4 deletions
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; |