diff options
-rw-r--r-- | src/regress/lib/libssl/api/Makefile | 10 | ||||
-rw-r--r-- | src/regress/lib/libssl/api/apitest.c | 15 |
2 files changed, 12 insertions, 13 deletions
diff --git a/src/regress/lib/libssl/api/Makefile b/src/regress/lib/libssl/api/Makefile index 0989fc2264..7f745518eb 100644 --- a/src/regress/lib/libssl/api/Makefile +++ b/src/regress/lib/libssl/api/Makefile | |||
@@ -1,16 +1,10 @@ | |||
1 | # $OpenBSD: Makefile,v 1.1 2022/01/05 09:59:39 jsing Exp $ | 1 | # $OpenBSD: Makefile,v 1.2 2023/04/14 12:38:30 tb Exp $ |
2 | 2 | ||
3 | PROG= apitest | 3 | PROG= apitest |
4 | LDADD= -lssl -lcrypto | 4 | LDADD= -lssl -lcrypto |
5 | DPADD= ${LIBSSL} ${LIBCRYPTO} | 5 | DPADD= ${LIBSSL} ${LIBCRYPTO} |
6 | WARNINGS= Yes | 6 | WARNINGS= Yes |
7 | CFLAGS+= -DLIBRESSL_INTERNAL -Werror | 7 | CFLAGS+= -DLIBRESSL_INTERNAL -Werror |
8 | 8 | CFLAGS+= -DCERTSDIR=\"${.CURDIR}/../../libssl/certs\" | |
9 | REGRESS_TARGETS= \ | ||
10 | regress-apitest | ||
11 | |||
12 | regress-apitest: ${PROG} | ||
13 | ./apitest \ | ||
14 | ${.CURDIR}/../../libssl/certs | ||
15 | 9 | ||
16 | .include <bsd.regress.mk> | 10 | .include <bsd.regress.mk> |
diff --git a/src/regress/lib/libssl/api/apitest.c b/src/regress/lib/libssl/api/apitest.c index b5a5c544e2..9a58de9f83 100644 --- a/src/regress/lib/libssl/api/apitest.c +++ b/src/regress/lib/libssl/api/apitest.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: apitest.c,v 1.1 2022/01/05 09:59:39 jsing Exp $ */ | 1 | /* $OpenBSD: apitest.c,v 1.2 2023/04/14 12:38:30 tb Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2020, 2021 Joel Sing <jsing@openbsd.org> | 3 | * Copyright (c) 2020, 2021 Joel Sing <jsing@openbsd.org> |
4 | * | 4 | * |
@@ -21,7 +21,11 @@ | |||
21 | #include <openssl/err.h> | 21 | #include <openssl/err.h> |
22 | #include <openssl/ssl.h> | 22 | #include <openssl/ssl.h> |
23 | 23 | ||
24 | const char *certs_path; | 24 | #ifndef CERTSDIR |
25 | #define CERTSDIR "." | ||
26 | #endif | ||
27 | |||
28 | const char *certs_path = CERTSDIR; | ||
25 | 29 | ||
26 | int debug = 0; | 30 | int debug = 0; |
27 | 31 | ||
@@ -357,11 +361,12 @@ main(int argc, char **argv) | |||
357 | { | 361 | { |
358 | int failed = 0; | 362 | int failed = 0; |
359 | 363 | ||
360 | if (argc != 2) { | 364 | if (argc > 2) { |
361 | fprintf(stderr, "usage: %s certspath\n", argv[0]); | 365 | fprintf(stderr, "usage: %s [certspath]\n", argv[0]); |
362 | exit(1); | 366 | exit(1); |
363 | } | 367 | } |
364 | certs_path = argv[1]; | 368 | if (argc == 2) |
369 | certs_path = argv[1]; | ||
365 | 370 | ||
366 | failed |= ssl_get_peer_cert_chain_tests(); | 371 | failed |= ssl_get_peer_cert_chain_tests(); |
367 | 372 | ||