summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortb <>2023-04-14 12:38:30 +0000
committertb <>2023-04-14 12:38:30 +0000
commit5264a960a8d814a5b4d0ae2da392a87900170249 (patch)
tree7f8ed4763441e51c4513f6fcceedce86984e5918
parentf78b4c90269928d9cf87e71271ceff64401ba9ce (diff)
downloadopenbsd-5264a960a8d814a5b4d0ae2da392a87900170249.tar.gz
openbsd-5264a960a8d814a5b4d0ae2da392a87900170249.tar.bz2
openbsd-5264a960a8d814a5b4d0ae2da392a87900170249.zip
Make the apitest work better with the portable tets framework
-rw-r--r--src/regress/lib/libssl/api/Makefile10
-rw-r--r--src/regress/lib/libssl/api/apitest.c15
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
3PROG= apitest 3PROG= apitest
4LDADD= -lssl -lcrypto 4LDADD= -lssl -lcrypto
5DPADD= ${LIBSSL} ${LIBCRYPTO} 5DPADD= ${LIBSSL} ${LIBCRYPTO}
6WARNINGS= Yes 6WARNINGS= Yes
7CFLAGS+= -DLIBRESSL_INTERNAL -Werror 7CFLAGS+= -DLIBRESSL_INTERNAL -Werror
8 8CFLAGS+= -DCERTSDIR=\"${.CURDIR}/../../libssl/certs\"
9REGRESS_TARGETS= \
10 regress-apitest
11
12regress-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
24const char *certs_path; 24#ifndef CERTSDIR
25#define CERTSDIR "."
26#endif
27
28const char *certs_path = CERTSDIR;
25 29
26int debug = 0; 30int 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