summaryrefslogtreecommitdiff
path: root/trust/tests/test-parser.c
diff options
context:
space:
mode:
Diffstat (limited to 'trust/tests/test-parser.c')
-rw-r--r--trust/tests/test-parser.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/trust/tests/test-parser.c b/trust/tests/test-parser.c
index c8cac03..09ec71c 100644
--- a/trust/tests/test-parser.c
+++ b/trust/tests/test-parser.c
@@ -117,6 +117,7 @@ test_parse_der_certificate (void)
{ CKA_INVALID },
};
+ p11_parser_formats (test.parser, p11_parser_format_x509, NULL);
ret = p11_parse_file (test.parser, SRCDIR "/files/cacert3.der",
P11_PARSE_FLAG_NONE);
assert_num_eq (P11_PARSE_SUCCESS, ret);
@@ -144,6 +145,7 @@ test_parse_pem_certificate (void)
{ CKA_INVALID },
};
+ p11_parser_formats (test.parser, p11_parser_format_pem, NULL);
ret = p11_parse_file (test.parser, SRCDIR "/files/cacert3.pem",
P11_PARSE_FLAG_NONE);
assert_num_eq (P11_PARSE_SUCCESS, ret);
@@ -170,6 +172,7 @@ test_parse_p11_kit_persist (void)
{ CKA_INVALID },
};
+ p11_parser_formats (test.parser, p11_parser_format_persist, NULL);
ret = p11_parse_file (test.parser, SRCDIR "/input/verisign-v1.p11-kit",
P11_PARSE_FLAG_NONE);
assert_num_eq (P11_PARSE_SUCCESS, ret);
@@ -222,6 +225,7 @@ test_parse_openssl_trusted (void)
int ret;
int i;
+ p11_parser_formats (test.parser, p11_parser_format_pem, NULL);
ret = p11_parse_file (test.parser, SRCDIR "/files/cacert3-trusted.pem",
P11_PARSE_FLAG_ANCHOR);
assert_num_eq (P11_PARSE_SUCCESS, ret);
@@ -305,6 +309,7 @@ test_parse_openssl_distrusted (void)
* OpenSSL style is to litter the blacklist in with the anchors,
* so we parse this as an anchor, but expect it to be blacklisted
*/
+ p11_parser_formats (test.parser, p11_parser_format_pem, NULL);
ret = p11_parse_file (test.parser, SRCDIR "/files/distrusted.pem",
P11_PARSE_FLAG_ANCHOR);
assert_num_eq (P11_PARSE_SUCCESS, ret);
@@ -344,6 +349,7 @@ test_parse_anchor (void)
CK_ATTRIBUTE *cert;
int ret;
+ p11_parser_formats (test.parser, p11_parser_format_x509, NULL);
ret = p11_parse_file (test.parser, SRCDIR "/files/cacert3.der",
P11_PARSE_FLAG_ANCHOR);
assert_num_eq (P11_PARSE_SUCCESS, ret);
@@ -373,6 +379,7 @@ test_parse_thawte (void)
{ CKA_INVALID },
};
+ p11_parser_formats (test.parser, p11_parser_format_pem, NULL);
ret = p11_parse_file (test.parser, SRCDIR "/files/thawte.pem",
P11_PARSE_FLAG_NONE);
assert_num_eq (P11_PARSE_SUCCESS, ret);
@@ -393,6 +400,7 @@ test_parse_invalid_file (void)
p11_message_quiet ();
+ p11_parser_formats (test.parser, p11_parser_format_x509, NULL);
ret = p11_parse_file (test.parser, "/nonexistant",
P11_PARSE_FLAG_NONE);
assert_num_eq (P11_PARSE_FAILURE, ret);
@@ -407,6 +415,7 @@ test_parse_unrecognized (void)
p11_message_quiet ();
+ p11_parser_formats (test.parser, p11_parser_format_x509, NULL);
ret = p11_parse_file (test.parser, SRCDIR "/files/unrecognized-file.txt",
P11_PARSE_FLAG_NONE);
assert_num_eq (P11_PARSE_UNRECOGNIZED, ret);
@@ -423,6 +432,7 @@ test_parse_no_asn1_cache (void)
parser = p11_parser_new (NULL);
assert_ptr_not_null (parser);
+ p11_parser_formats (parser, p11_parser_format_x509, NULL);
ret = p11_parse_file (parser, SRCDIR "/files/cacert3.der", P11_PARSE_FLAG_NONE);
assert_num_eq (P11_PARSE_SUCCESS, ret);