diff options
author | tb <> | 2023-04-14 12:37:20 +0000 |
---|---|---|
committer | tb <> | 2023-04-14 12:37:20 +0000 |
commit | f78b4c90269928d9cf87e71271ceff64401ba9ce (patch) | |
tree | d6d9816f3922d92b5be899e1a712c877192e2b1d | |
parent | 25fb8b7b6452723037d5e49c8ceb8e1430e7e379 (diff) | |
download | openbsd-f78b4c90269928d9cf87e71271ceff64401ba9ce.tar.gz openbsd-f78b4c90269928d9cf87e71271ceff64401ba9ce.tar.bz2 openbsd-f78b4c90269928d9cf87e71271ceff64401ba9ce.zip |
Make cttest work better with the portable test harness
-rw-r--r-- | src/regress/lib/libcrypto/ct/Makefile | 6 | ||||
-rw-r--r-- | src/regress/lib/libcrypto/ct/cttest.c | 15 |
2 files changed, 12 insertions, 9 deletions
diff --git a/src/regress/lib/libcrypto/ct/Makefile b/src/regress/lib/libcrypto/ct/Makefile index 5cfdf74c11..a30fd1c278 100644 --- a/src/regress/lib/libcrypto/ct/Makefile +++ b/src/regress/lib/libcrypto/ct/Makefile | |||
@@ -1,4 +1,4 @@ | |||
1 | # $OpenBSD: Makefile,v 1.5 2023/04/14 11:18:40 tb Exp $ | 1 | # $OpenBSD: Makefile,v 1.6 2023/04/14 12:37:20 tb Exp $ |
2 | 2 | ||
3 | PROG= cttest | 3 | PROG= cttest |
4 | LDADD= -lcrypto | 4 | LDADD= -lcrypto |
@@ -7,8 +7,6 @@ DPADD= ${LIBCRYPTO} | |||
7 | WARNINGS= Yes | 7 | WARNINGS= Yes |
8 | CFLAGS+= -Wundef -Werror | 8 | CFLAGS+= -Wundef -Werror |
9 | CFLAGS+= -DLIBRESSL_CRYPTO_INTERNAL -DLIBRESSL_INTERNAL | 9 | CFLAGS+= -DLIBRESSL_CRYPTO_INTERNAL -DLIBRESSL_INTERNAL |
10 | 10 | CFLAGS+= -DCTPATH=\"${.CURDIR}\" | |
11 | run-regress-cttest: cttest | ||
12 | ./cttest ${.CURDIR}/../../libcrypto/ct/ | ||
13 | 11 | ||
14 | .include <bsd.regress.mk> | 12 | .include <bsd.regress.mk> |
diff --git a/src/regress/lib/libcrypto/ct/cttest.c b/src/regress/lib/libcrypto/ct/cttest.c index 8986c93883..a0c75560ef 100644 --- a/src/regress/lib/libcrypto/ct/cttest.c +++ b/src/regress/lib/libcrypto/ct/cttest.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: cttest.c,v 1.5 2023/04/14 11:18:40 tb Exp $ */ | 1 | /* $OpenBSD: cttest.c,v 1.6 2023/04/14 12:37:20 tb Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2021 Joel Sing <jsing@openbsd.org> | 3 | * Copyright (c) 2021 Joel Sing <jsing@openbsd.org> |
4 | * | 4 | * |
@@ -23,6 +23,10 @@ | |||
23 | #include <openssl/pem.h> | 23 | #include <openssl/pem.h> |
24 | #include <openssl/x509v3.h> | 24 | #include <openssl/x509v3.h> |
25 | 25 | ||
26 | #ifndef CTPATH | ||
27 | #define CTPATH "." | ||
28 | #endif | ||
29 | |||
26 | char *test_ctlog_conf_file; | 30 | char *test_ctlog_conf_file; |
27 | char *test_cert_file; | 31 | char *test_cert_file; |
28 | char *test_issuer_file; | 32 | char *test_issuer_file; |
@@ -452,14 +456,15 @@ ct_sct_verify_test(void) | |||
452 | int | 456 | int |
453 | main(int argc, char **argv) | 457 | main(int argc, char **argv) |
454 | { | 458 | { |
455 | const char *ctpath; | 459 | const char *ctpath = CTPATH; |
456 | int failed = 0; | 460 | int failed = 0; |
457 | 461 | ||
458 | if (argc != 2) { | 462 | if (argc > 2) { |
459 | fprintf(stderr, "usage: %s ctpath\n", argv[0]); | 463 | fprintf(stderr, "usage %s [ctpath]\n", argv[0]); |
460 | exit(1); | 464 | exit(1); |
461 | } | 465 | } |
462 | ctpath = argv[1]; | 466 | if (argc == 2) |
467 | ctpath = argv[1]; | ||
463 | 468 | ||
464 | if (asprintf(&test_cert_file, "%s/%s", ctpath, | 469 | if (asprintf(&test_cert_file, "%s/%s", ctpath, |
465 | "libressl.org.crt") == -1) | 470 | "libressl.org.crt") == -1) |