diff options
Diffstat (limited to 'trust/tests')
-rw-r--r-- | trust/tests/frob-cert.c | 2 | ||||
-rw-r--r-- | trust/tests/test-module.c | 4 | ||||
-rw-r--r-- | trust/tests/test-parser.c | 20 | ||||
-rw-r--r-- | trust/tests/test-token.c | 12 |
4 files changed, 20 insertions, 18 deletions
diff --git a/trust/tests/frob-cert.c b/trust/tests/frob-cert.c index 71018bd..c1bc45c 100644 --- a/trust/tests/frob-cert.c +++ b/trust/tests/frob-cert.c @@ -106,7 +106,7 @@ main (int argc, ret = asn1_create_element (definitions, argv[1], &cert); err_if_fail (ret, "Certificate"); - map = p11_mmap_open (argv[3], &data, &size); + map = p11_mmap_open (argv[3], NULL, &data, &size); if (map == NULL) { fprintf (stderr, "couldn't open file: %s\n", argv[3]); return 1; diff --git a/trust/tests/test-module.c b/trust/tests/test-module.c index 5920076..c272a88 100644 --- a/trust/tests/test-module.c +++ b/trust/tests/test-module.c @@ -1108,7 +1108,7 @@ test_create_and_write (void) /* The expected file name */ path = p11_path_build (test.directory, "yay.p11-kit", NULL); p11_parser_formats (test.parser, p11_parser_format_persist, NULL); - ret = p11_parse_file (test.parser, path, 0); + ret = p11_parse_file (test.parser, path, NULL, 0); assert_num_eq (ret, P11_PARSE_SUCCESS); free (path); @@ -1164,7 +1164,7 @@ test_modify_and_write (void) /* The expected file name */ path = p11_path_build (test.directory, "yay.p11-kit", NULL); - ret = p11_parse_file (test.parser, path, 0); + ret = p11_parse_file (test.parser, path, NULL, 0); assert_num_eq (ret, P11_PARSE_SUCCESS); free (path); diff --git a/trust/tests/test-parser.c b/trust/tests/test-parser.c index 09ec71c..871973b 100644 --- a/trust/tests/test-parser.c +++ b/trust/tests/test-parser.c @@ -118,7 +118,7 @@ test_parse_der_certificate (void) }; p11_parser_formats (test.parser, p11_parser_format_x509, NULL); - ret = p11_parse_file (test.parser, SRCDIR "/files/cacert3.der", + ret = p11_parse_file (test.parser, SRCDIR "/files/cacert3.der", NULL, P11_PARSE_FLAG_NONE); assert_num_eq (P11_PARSE_SUCCESS, ret); @@ -146,7 +146,7 @@ test_parse_pem_certificate (void) }; p11_parser_formats (test.parser, p11_parser_format_pem, NULL); - ret = p11_parse_file (test.parser, SRCDIR "/files/cacert3.pem", + ret = p11_parse_file (test.parser, SRCDIR "/files/cacert3.pem", NULL, P11_PARSE_FLAG_NONE); assert_num_eq (P11_PARSE_SUCCESS, ret); @@ -173,7 +173,7 @@ test_parse_p11_kit_persist (void) }; p11_parser_formats (test.parser, p11_parser_format_persist, NULL); - ret = p11_parse_file (test.parser, SRCDIR "/input/verisign-v1.p11-kit", + ret = p11_parse_file (test.parser, SRCDIR "/input/verisign-v1.p11-kit", NULL, P11_PARSE_FLAG_NONE); assert_num_eq (P11_PARSE_SUCCESS, ret); @@ -226,7 +226,7 @@ test_parse_openssl_trusted (void) int i; p11_parser_formats (test.parser, p11_parser_format_pem, NULL); - ret = p11_parse_file (test.parser, SRCDIR "/files/cacert3-trusted.pem", + ret = p11_parse_file (test.parser, SRCDIR "/files/cacert3-trusted.pem", NULL, P11_PARSE_FLAG_ANCHOR); assert_num_eq (P11_PARSE_SUCCESS, ret); @@ -310,7 +310,7 @@ test_parse_openssl_distrusted (void) * 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", + ret = p11_parse_file (test.parser, SRCDIR "/files/distrusted.pem", NULL, P11_PARSE_FLAG_ANCHOR); assert_num_eq (P11_PARSE_SUCCESS, ret); @@ -350,7 +350,7 @@ test_parse_anchor (void) int ret; p11_parser_formats (test.parser, p11_parser_format_x509, NULL); - ret = p11_parse_file (test.parser, SRCDIR "/files/cacert3.der", + ret = p11_parse_file (test.parser, SRCDIR "/files/cacert3.der", NULL, P11_PARSE_FLAG_ANCHOR); assert_num_eq (P11_PARSE_SUCCESS, ret); @@ -380,7 +380,7 @@ test_parse_thawte (void) }; p11_parser_formats (test.parser, p11_parser_format_pem, NULL); - ret = p11_parse_file (test.parser, SRCDIR "/files/thawte.pem", + ret = p11_parse_file (test.parser, SRCDIR "/files/thawte.pem", NULL, P11_PARSE_FLAG_NONE); assert_num_eq (P11_PARSE_SUCCESS, ret); @@ -401,7 +401,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", + ret = p11_parse_file (test.parser, "/nonexistant", NULL, P11_PARSE_FLAG_NONE); assert_num_eq (P11_PARSE_FAILURE, ret); @@ -416,7 +416,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", + ret = p11_parse_file (test.parser, SRCDIR "/files/unrecognized-file.txt", NULL, P11_PARSE_FLAG_NONE); assert_num_eq (P11_PARSE_UNRECOGNIZED, ret); @@ -433,7 +433,7 @@ test_parse_no_asn1_cache (void) 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); + ret = p11_parse_file (parser, SRCDIR "/files/cacert3.der", NULL, P11_PARSE_FLAG_NONE); assert_num_eq (P11_PARSE_SUCCESS, ret); /* Should have gotten certificate */ diff --git a/trust/tests/test-token.c b/trust/tests/test-token.c index bdf1120..a028d9c 100644 --- a/trust/tests/test-token.c +++ b/trust/tests/test-token.c @@ -238,9 +238,11 @@ test_not_writable (void) { p11_token *token; - token = p11_token_new (333, "/", "Label"); - assert (!p11_token_is_writable (token)); - p11_token_free (token); + if (getuid () != 0) { + token = p11_token_new (333, "/", "Label"); + assert (!p11_token_is_writable (token)); + p11_token_free (token); + } token = p11_token_new (333, "", "Label"); assert (!p11_token_is_writable (token)); @@ -533,7 +535,7 @@ test_write_new (void) /* The expected file name */ path = p11_path_build (test.directory, "Yay_.p11-kit", NULL); - ret = p11_parse_file (test.parser, path, 0); + ret = p11_parse_file (test.parser, path, NULL, 0); assert_num_eq (ret, P11_PARSE_SUCCESS); free (path); @@ -573,7 +575,7 @@ test_write_no_label (void) /* The expected file name */ path = p11_path_build (test.directory, "data.p11-kit", NULL); - ret = p11_parse_file (test.parser, path, 0); + ret = p11_parse_file (test.parser, path, NULL, 0); assert_num_eq (ret, P11_PARSE_SUCCESS); free (path); |