summaryrefslogtreecommitdiff
path: root/trust/tests/test-data.c
diff options
context:
space:
mode:
authorStef Walter <stefw@gnome.org>2013-01-03 11:07:47 +0100
committerStef Walter <stefw@gnome.org>2013-02-05 14:54:53 +0100
commit8b02ff64b30311a4730b60dd72590435f56fb3a2 (patch)
tree20afcc494e8fd9032f9c3a94b27a316848b8728f /trust/tests/test-data.c
parent18bb2582c32f4373f7ed85894fb490f2733cb03b (diff)
Fill in certificate authority and trust data correctly
* Fill in CKA_CERTIFICATE_CATEGORY properly for authorities based on the presence of BasicConstraints and/or v1 certificates * Fill in CKA_TRUSTED and CKA_X_DISTRUSTED based on whether the parser is running for anchors or blacklist * In addition support the concept of blacklisted certificates mixed in with the anchors (without any purposes) since that's what exists in the real world. * We do this after the various hooks have had a chance to mess with the certificate extensions and such.
Diffstat (limited to 'trust/tests/test-data.c')
-rw-r--r--trust/tests/test-data.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/trust/tests/test-data.c b/trust/tests/test-data.c
index a3d5373..f159926 100644
--- a/trust/tests/test-data.c
+++ b/trust/tests/test-data.c
@@ -74,7 +74,7 @@ test_check_cacert3_ca_msg (CuTest *cu,
const char *label)
{
CK_CERTIFICATE_TYPE x509 = CKC_X_509;
- CK_ULONG category = 0; /* TODO: Implement */
+ CK_ULONG category = 2; /* authority */
CK_ATTRIBUTE expected[] = {
{ CKA_CERTIFICATE_TYPE, &x509, sizeof (x509) },
@@ -94,6 +94,22 @@ test_check_cacert3_ca_msg (CuTest *cu,
}
void
+test_check_id_msg (CuTest *cu,
+ const char *file,
+ int line,
+ CK_ATTRIBUTE *expected,
+ CK_ATTRIBUTE *attr)
+{
+ CK_ATTRIBUTE *one;
+ CK_ATTRIBUTE *two;
+
+ one = p11_attrs_find (expected, CKA_ID);
+ two = p11_attrs_find (attr, CKA_ID);
+
+ test_check_attr_msg (cu, file, line, one, two);
+}
+
+void
test_check_attrs_msg (CuTest *cu,
const char *file,
int line,