summaryrefslogtreecommitdiffstats
path: root/test/ct_test.c
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2019-07-23 17:10:05 +0100
committerMatt Caswell <matt@openssl.org>2019-08-09 17:29:39 +0100
commit1a2a3a420609c2d540b544e5ae829a3cb468a6e3 (patch)
tree14e50634fd7d841141133e2966e45e0db3fb9d9c /test/ct_test.c
parent5235ef44b93306a14d0b6c695b13c64b16e1fdec (diff)
Extend tests of SSL_check_chain()
Actually supply a chain and then test: 1) A successful check of both the ee and chain certs 2) A failure to check the ee cert 3) A failure to check a chain cert Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> (Merged from https://github.com/openssl/openssl/pull/9442)
Diffstat (limited to 'test/ct_test.c')
-rw-r--r--test/ct_test.c23
1 files changed, 2 insertions, 21 deletions
diff --git a/test/ct_test.c b/test/ct_test.c
index 8f1e1990b8..e2f50efcf3 100644
--- a/test/ct_test.c
+++ b/test/ct_test.c
@@ -87,29 +87,10 @@ static void tear_down(CT_TEST_FIXTURE *fixture)
OPENSSL_free(fixture);
}
-static char *mk_file_path(const char *dir, const char *file)
-{
-# ifndef OPENSSL_SYS_VMS
- const char *sep = "/";
-# else
- const char *sep = "";
-# endif
- size_t len = strlen(dir) + strlen(sep) + strlen(file) + 1;
- char *full_file = OPENSSL_zalloc(len);
-
- if (full_file != NULL) {
- OPENSSL_strlcpy(full_file, dir, len);
- OPENSSL_strlcat(full_file, sep, len);
- OPENSSL_strlcat(full_file, file, len);
- }
-
- return full_file;
-}
-
static X509 *load_pem_cert(const char *dir, const char *file)
{
X509 *cert = NULL;
- char *file_path = mk_file_path(dir, file);
+ char *file_path = test_mk_file_path(dir, file);
if (file_path != NULL) {
BIO *cert_io = BIO_new_file(file_path, "r");
@@ -127,7 +108,7 @@ static int read_text_file(const char *dir, const char *file,
char *buffer, int buffer_length)
{
int len = -1;
- char *file_path = mk_file_path(dir, file);
+ char *file_path = test_mk_file_path(dir, file);
if (file_path != NULL) {
BIO *file_io = BIO_new_file(file_path, "r");