summaryrefslogtreecommitdiff
path: root/tools/tests
diff options
context:
space:
mode:
authorStef Walter <stefw@gnome.org>2013-03-18 13:13:24 +0100
committerStef Walter <stefw@gnome.org>2013-03-18 13:13:24 +0100
commita904e98b78b55e7a6213356225e45a04fdc457e1 (patch)
treee879e446a5402e59f4be13b7711e071c858edc26 /tools/tests
parentf71baf6adf00626e73326149d55183bc62f827ae (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/tests')
-rw-r--r--tools/tests/test-extract.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/tools/tests/test-extract.c b/tools/tests/test-extract.c
index c7382cd..29ee986 100644
--- a/tools/tests/test-extract.c
+++ b/tools/tests/test-extract.c
@@ -218,7 +218,8 @@ static CK_ATTRIBUTE extension_eku_invalid[] = {
static void
test_info_simple_certificate (CuTest *tc)
{
- CK_ATTRIBUTE *value;
+ void *value;
+ size_t length;
CK_RV rv;
setup (tc);
@@ -237,9 +238,9 @@ test_info_simple_certificate (CuTest *tc)
CuAssertIntEquals (tc, CKO_CERTIFICATE, test.ex.klass);
CuAssertPtrNotNull (tc, test.ex.attrs);
- value = p11_attrs_find_valid (test.ex.attrs, CKA_VALUE);
+ value = p11_attrs_find_value (test.ex.attrs, CKA_VALUE, &length);
CuAssertPtrNotNull (tc, value);
- CuAssertTrue (tc, memcmp (value->pValue, test_cacert3_ca_der, value->ulValueLen) == 0);
+ CuAssertTrue (tc, memcmp (value, test_cacert3_ca_der, length) == 0);
CuAssertPtrNotNull (tc, test.ex.cert_der);
CuAssertTrue (tc, memcmp (test.ex.cert_der, test_cacert3_ca_der, test.ex.cert_len) == 0);
CuAssertPtrNotNull (tc, test.ex.cert_asn);