summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortb <>2023-04-14 12:41:26 +0000
committertb <>2023-04-14 12:41:26 +0000
commitc556567750bcea59402276e8f89a5f39b5e97103 (patch)
tree8b43ecf518f3ed12f399896722907cb6a713e665
parent5264a960a8d814a5b4d0ae2da392a87900170249 (diff)
downloadopenbsd-c556567750bcea59402276e8f89a5f39b5e97103.tar.gz
openbsd-c556567750bcea59402276e8f89a5f39b5e97103.tar.bz2
openbsd-c556567750bcea59402276e8f89a5f39b5e97103.zip
Make the signertest work better with the portable test framework
-rw-r--r--src/regress/lib/libtls/signer/Makefile10
-rw-r--r--src/regress/lib/libtls/signer/signertest.c16
2 files changed, 12 insertions, 14 deletions
diff --git a/src/regress/lib/libtls/signer/Makefile b/src/regress/lib/libtls/signer/Makefile
index 7110e9ff5e..ac72edffe9 100644
--- a/src/regress/lib/libtls/signer/Makefile
+++ b/src/regress/lib/libtls/signer/Makefile
@@ -1,4 +1,4 @@
1# $OpenBSD: Makefile,v 1.3 2022/06/15 06:14:59 tb Exp $ 1# $OpenBSD: Makefile,v 1.4 2023/04/14 12:41:26 tb Exp $
2 2
3PROG= signertest 3PROG= signertest
4LDADD= -lcrypto -lssl ${TLS_INT} 4LDADD= -lcrypto -lssl ${TLS_INT}
@@ -7,12 +7,6 @@ DPADD= ${LIBCRYPTO} ${LIBSSL} ${LIBTLS}
7WARNINGS= Yes 7WARNINGS= Yes
8CFLAGS+= -DLIBRESSL_INTERNAL -Wall -Wundef -Werror 8CFLAGS+= -DLIBRESSL_INTERNAL -Wall -Wundef -Werror
9CFLAGS+= -I${.CURDIR}/../../../../lib/libtls/ 9CFLAGS+= -I${.CURDIR}/../../../../lib/libtls/
10 10CFLAGS+= -DCERTSDIR=\"${.CURDIR}/../../libssl/certs\"
11REGRESS_TARGETS= \
12 regress-signertest
13
14regress-signertest: ${PROG}
15 ./signertest \
16 ${.CURDIR}/../../libssl/certs
17 11
18.include <bsd.regress.mk> 12.include <bsd.regress.mk>
diff --git a/src/regress/lib/libtls/signer/signertest.c b/src/regress/lib/libtls/signer/signertest.c
index 89af257372..f0523d34b4 100644
--- a/src/regress/lib/libtls/signer/signertest.c
+++ b/src/regress/lib/libtls/signer/signertest.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: signertest.c,v 1.5 2022/03/24 15:58:57 tb Exp $ */ 1/* $OpenBSD: signertest.c,v 1.6 2023/04/14 12:41:26 tb Exp $ */
2/* 2/*
3 * Copyright (c) 2017, 2018, 2022 Joel Sing <jsing@openbsd.org> 3 * Copyright (c) 2017, 2018, 2022 Joel Sing <jsing@openbsd.org>
4 * 4 *
@@ -34,7 +34,11 @@
34 34
35#include "tls_internal.h" 35#include "tls_internal.h"
36 36
37const char *cert_path; 37#ifndef CERTSDIR
38#define CERTSDIR "."
39#endif
40
41const char *cert_path = CERTSDIR;
38int sign_cb_count; 42int sign_cb_count;
39 43
40static void 44static void
@@ -453,12 +457,12 @@ main(int argc, char **argv)
453{ 457{
454 int failure = 0; 458 int failure = 0;
455 459
456 if (argc != 2) { 460 if (argc > 2) {
457 fprintf(stderr, "usage: %s certpath\n", argv[0]); 461 fprintf(stderr, "usage: %s [certpath]\n", argv[0]);
458 return (1); 462 return (1);
459 } 463 }
460 464 if (argc == 2)
461 cert_path = argv[1]; 465 cert_path = argv[1];
462 466
463 failure |= do_signer_tests(); 467 failure |= do_signer_tests();
464 failure |= do_signer_tls_tests(); 468 failure |= do_signer_tls_tests();