From 8b02ff64b30311a4730b60dd72590435f56fb3a2 Mon Sep 17 00:00:00 2001 From: Stef Walter Date: Thu, 3 Jan 2013 11:07:47 +0100 Subject: 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. --- trust/tests/test-data.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'trust/tests/test-data.c') 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, -- cgit v1.1