Modify regress ssl_get_shared_ciphers for portable
authorinoguchi <inoguchi@openbsd.org>
Mon, 3 May 2021 23:42:04 +0000 (23:42 +0000)
committerinoguchi <inoguchi@openbsd.org>
Mon, 3 May 2021 23:42:04 +0000 (23:42 +0000)
- Split out the intermediate path (../certs/) to Makefile
- Change 'shutdown' to 'shutdown_all'

ok tb@

regress/lib/libssl/unit/Makefile
regress/lib/libssl/unit/ssl_get_shared_ciphers.c

index 1a783b4..a1935bb 100644 (file)
@@ -1,4 +1,4 @@
-#      $OpenBSD: Makefile,v 1.11 2021/01/10 07:30:50 tb Exp $
+#      $OpenBSD: Makefile,v 1.12 2021/05/03 23:42:04 inoguchi Exp $
 
 TEST_CASES+= cipher_list
 TEST_CASES+= ssl_get_shared_ciphers
@@ -12,7 +12,7 @@ REGRESS_TARGETS= all_tests
 WARNINGS=      Yes
 LDLIBS=                ${SSL_INT} -lcrypto
 CFLAGS+=       -DLIBRESSL_INTERNAL -Wall -Wundef -Werror
-CFLAGS+=       -DCURDIR=\"${.CURDIR}\"
+CFLAGS+=       -DCERTSDIR=\"${.CURDIR}/../certs\"
 CFLAGS+=       -I${.CURDIR}/../../../../lib/libssl
 
 CLEANFILES+= ${TEST_CASES}
index 7bffba2..d53aff5 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: ssl_get_shared_ciphers.c,v 1.8 2021/01/21 05:02:25 tb Exp $ */
+/*     $OpenBSD: ssl_get_shared_ciphers.c,v 1.9 2021/05/03 23:42:04 inoguchi Exp $ */
 /*
  * Copyright (c) 2021 Theo Buehler <tb@openbsd.org>
  *
@@ -353,7 +353,7 @@ handshake(SSL *client_ssl, SSL *server_ssl, const char *description)
 }
 
 static int
-shutdown(SSL *client_ssl, SSL *server_ssl, const char *description)
+shutdown_all(SSL *client_ssl, SSL *server_ssl, const char *description)
 {
        int loops = 0, client_ret = 0, server_ret = 0;
 
@@ -442,7 +442,7 @@ test_get_shared_ciphers(const struct ssl_shared_ciphers_test_data *test)
                goto err;
        }
 
-       if (!shutdown(client_ssl, server_ssl, test->description))
+       if (!shutdown_all(client_ssl, server_ssl, test->description))
                goto err;
 
        failed = check_shared_ciphers(test, buf);
@@ -462,7 +462,7 @@ main(int argc, char **argv)
        size_t i;
        int failed = 0;
 
-       if (asprintf(&server_cert, "%s/../certs/server.pem", CURDIR) == -1) {
+       if (asprintf(&server_cert, "%s/server.pem", CERTSDIR) == -1) {
                fprintf(stderr, "asprintf server_cert failed\n");
                failed = 1;
                goto err;