From: tb Date: Fri, 14 Apr 2023 12:41:26 +0000 (+0000) Subject: Make the signertest work better with the portable test framework X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=3da24e266c6277c5c9261103034f973c24e71aa3;p=openbsd Make the signertest work better with the portable test framework --- diff --git a/regress/lib/libtls/signer/Makefile b/regress/lib/libtls/signer/Makefile index 7110e9ff5e8..ac72edffe91 100644 --- a/regress/lib/libtls/signer/Makefile +++ b/regress/lib/libtls/signer/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.3 2022/06/15 06:14:59 tb Exp $ +# $OpenBSD: Makefile,v 1.4 2023/04/14 12:41:26 tb Exp $ PROG= signertest LDADD= -lcrypto -lssl ${TLS_INT} @@ -7,12 +7,6 @@ DPADD= ${LIBCRYPTO} ${LIBSSL} ${LIBTLS} WARNINGS= Yes CFLAGS+= -DLIBRESSL_INTERNAL -Wall -Wundef -Werror CFLAGS+= -I${.CURDIR}/../../../../lib/libtls/ - -REGRESS_TARGETS= \ - regress-signertest - -regress-signertest: ${PROG} - ./signertest \ - ${.CURDIR}/../../libssl/certs +CFLAGS+= -DCERTSDIR=\"${.CURDIR}/../../libssl/certs\" .include diff --git a/regress/lib/libtls/signer/signertest.c b/regress/lib/libtls/signer/signertest.c index 89af2573726..f0523d34b40 100644 --- a/regress/lib/libtls/signer/signertest.c +++ b/regress/lib/libtls/signer/signertest.c @@ -1,4 +1,4 @@ -/* $OpenBSD: signertest.c,v 1.5 2022/03/24 15:58:57 tb Exp $ */ +/* $OpenBSD: signertest.c,v 1.6 2023/04/14 12:41:26 tb Exp $ */ /* * Copyright (c) 2017, 2018, 2022 Joel Sing * @@ -34,7 +34,11 @@ #include "tls_internal.h" -const char *cert_path; +#ifndef CERTSDIR +#define CERTSDIR "." +#endif + +const char *cert_path = CERTSDIR; int sign_cb_count; static void @@ -453,12 +457,12 @@ main(int argc, char **argv) { int failure = 0; - if (argc != 2) { - fprintf(stderr, "usage: %s certpath\n", argv[0]); + if (argc > 2) { + fprintf(stderr, "usage: %s [certpath]\n", argv[0]); return (1); } - - cert_path = argv[1]; + if (argc == 2) + cert_path = argv[1]; failure |= do_signer_tests(); failure |= do_signer_tls_tests();