summaryrefslogtreecommitdiff
path: root/trust/tests/test-module.c
diff options
context:
space:
mode:
authorStef Walter <stefw@gnome.org>2013-01-02 16:52:59 +0100
committerStef Walter <stefw@gnome.org>2013-02-05 14:54:53 +0100
commit3b482acc47ba971406db526ebddf589ad1a8f16e (patch)
treec78cf201fa5e855e4cc864f30e8bece4840f11a6 /trust/tests/test-module.c
parente46c74aef6eee7da3cdfb17077905811b9e04a61 (diff)
Better debugging and checks for attribute values
Diffstat (limited to 'trust/tests/test-module.c')
-rw-r--r--trust/tests/test-module.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/trust/tests/test-module.c b/trust/tests/test-module.c
index 64857a7..0278fd3 100644
--- a/trust/tests/test-module.c
+++ b/trust/tests/test-module.c
@@ -153,7 +153,7 @@ check_trust_object_equiv (CuTest *cu,
rv = test.module->C_GetAttributeValue (test.session, trust, equiv, 6);
CuAssertTrue (cu, rv == CKR_OK);
- CuAssertTrue (cu, p11_attrs_match (cert, equiv));
+ test_check_attrs (cu, equiv, cert);
}
static void
@@ -220,7 +220,6 @@ check_certificate (CuTest *cu,
unsigned char serial[128];
unsigned char id[128];
CK_CERTIFICATE_TYPE type;
- CK_BBOOL val;
CK_BYTE check[3];
CK_DATE start;
CK_DATE end;
@@ -256,12 +255,18 @@ check_certificate (CuTest *cu,
/* If this is the cacert3 certificate, check its values */
if (memcmp (value, test_cacert3_ca_der, sizeof (test_cacert3_ca_der)) == 0) {
CK_BBOOL trusted;
+ CK_BBOOL vtrue = CK_TRUE;
CK_ATTRIBUTE anchor[] = {
{ CKA_TRUSTED, &trusted, sizeof (trusted) },
{ CKA_INVALID, },
};
+ CK_ATTRIBUTE check[] = {
+ { CKA_TRUSTED, &vtrue, sizeof (vtrue) },
+ { CKA_INVALID, },
+ };
+
test_check_cacert3_ca (cu, attrs, NULL);
/* Get anchor specific attributes */
@@ -269,9 +274,7 @@ check_certificate (CuTest *cu,
CuAssertTrue (cu, rv == CKR_OK);
/* It lives in the trusted directory */
- if (!p11_attrs_find_bool (anchor, CKA_TRUSTED, &val))
- CuFail (cu, "missing CKA_TRUSTED");
- CuAssertIntEquals (cu, CK_TRUE, val);
+ test_check_attrs (cu, check, anchor);
/* Other certificates, we can't check the values */
} else {