From patchwork Thu Jun 20 14:42:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gert Doering X-Patchwork-Id: 3744 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7000:a501:b0:57d:b2cb:6cf with SMTP id hh1csp856743mab; Thu, 20 Jun 2024 07:43:06 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVnalLQeysKVPtT+HMvTb8DyPSCrNRNiG6XycBHRyQjBMmAJxAXpwSLMPD5+aOU5vxUvh/PIaYjsRaAAzsPc19Vs0eTsZ0= X-Google-Smtp-Source: AGHT+IHz7AY6iDY1uX/c5tfJNbkSz6Tm40SGbWaYUadz/F+Lk8Em67oiUNxkKtx7BvkrQq7HoH32 X-Received: by 2002:a05:6e02:19cc:b0:375:a4f9:e70b with SMTP id e9e14a558f8ab-3761d6fa97amr76162525ab.3.1718894585817; Thu, 20 Jun 2024 07:43:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1718894585; cv=none; d=google.com; s=arc-20160816; b=mr5xh0XWefAmFJJbh77VB/8rfmioUzOV3I/Gh8h58IhT5UDef6D4sXG99TMvCfDpRI FjP0vGTKGNJMMoAYhnNPSPcKMF37Nl9ZpVj9QRPdX7mRcjdKigFRDBsIUbcb5xL2k0eh YSLJXUguFmwlkfIA5TMxyCwqf2cfJFxzl5hpJamAqXAhRnbOBOm9CxN4qV1PmFMvEfZ4 XsVxTGvANOQwAhAR1uHcjzsBBvVDTe2qoQ5k9Mj9INcf4EUIRXtBSmMx0OJqVaIhhSvC /lU34Wxl/Jq54ik2+e3wu3YSDTaKMkXfTSlaT+j/ABdPWu4Yl7ZZoplHIDxJ57bqeQMs RUeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :mime-version:references:in-reply-to:message-id:date:to:from :dkim-signature:dkim-signature; bh=mLzMaN4XM/fZyY4z4f2Vw9xXPgJqgROJmEd9cDocUTA=; fh=4NbAC/LsuMLI0S0hprUlLSLCiHwg6SCAifhH718Jh0Q=; b=m78sskAG8J8cEc8tA8gzyyxlK326fq7gS5CfnOCLUOtAJeo9ZLMtM0T/knQ/uCBU5U iSix8YP34A/K0RiQ1MevPzzKxY8oUKYl2f3Y5b19rJLHB/BUlok6eQSf8Av71x5+rlRI DAU1NBfEO2Q9R+WNm3SXZdsKo6wyyN+DzLbN/01caNVBpeb0+5ae9/QefAJu7ZRbbAV+ 82i7olbW4KmewxkkELZlXuu3GTzJ58E64e2xcwGIUCPUbIVY9ISbKC2SuG9i+Hab3Q+g +ycgogY64bnmm5Y2r2SudOMz5yom+EnNF//b13z+kqrQO+XCDWhenyeOEW1Qgl5nKmnC 0wtA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=Matr7CRV; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=g5Eof0NK; spf=pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=muc.de Received: from lists.sourceforge.net (lists.sourceforge.net. [216.105.38.7]) by mx.google.com with ESMTPS id 41be03b00d2f7-6fee558ce1esi14790545a12.708.2024.06.20.07.43.05 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 20 Jun 2024 07:43:05 -0700 (PDT) Received-SPF: pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) client-ip=216.105.38.7; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=Matr7CRV; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=g5Eof0NK; spf=pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=muc.de Received: from [127.0.0.1] (helo=sfs-ml-3.v29.lw.sourceforge.com) by sfs-ml-3.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1sKIzt-0008Ki-TG; Thu, 20 Jun 2024 14:42:45 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-3.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1sKIzr-0008KY-LW for openvpn-devel@lists.sourceforge.net; Thu, 20 Jun 2024 14:42:43 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Transfer-Encoding:MIME-Version:References: In-Reply-To:Message-ID:Date:Subject:To:From:Sender:Reply-To:Cc:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=Sslj81+HliUO07K8R0/0BMV7tNx9b6nCJnzdjHS6r4g=; b=Matr7CRV9KBYc4GXJ1EY4WOhGQ wi+s65JcFi0WAInvzAl6F7OiaE4Bw2W0IZr7gywHfXMF9xxNUifSz6qWTR+QrJ8TAmBD9fqplstn4 QNrSB+7tpwpBN4uqBhVBYJDCD4c/p3H79zeQ3ud5wdFNJklsuJqfkatS72hjnzEoBpi0=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID: Date:Subject:To:From:Sender:Reply-To:Cc:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=Sslj81+HliUO07K8R0/0BMV7tNx9b6nCJnzdjHS6r4g=; b=g5Eof0NK6bzbj3/pFXt6Ngq/40 aPoBqyg0uj1t4ZHCXeLg2SgicdSXExZJmGcRmXyAFwgeozOiXF5ioV3LieO9BcNCphZHZ6/ECvpdn xIr4PTA4syaqhwUX9hG32hAL0ItKQVnbCo/Gq0HA97hYxoKLjD91cy1TYrs7gJjilLGI=; Received: from dhcp-174.greenie.muc.de ([193.149.48.174] helo=blue.greenie.muc.de) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1sKIzm-00020n-U4 for openvpn-devel@lists.sourceforge.net; Thu, 20 Jun 2024 14:42:40 +0000 Received: from blue.greenie.muc.de (localhost [127.0.0.1]) by blue.greenie.muc.de (8.17.1.9/8.17.1.9) with ESMTP id 45KEgVvS019596 for ; Thu, 20 Jun 2024 16:42:31 +0200 Received: (from gert@localhost) by blue.greenie.muc.de (8.17.1.9/8.17.1.9/Submit) id 45KEgVgh019595 for openvpn-devel@lists.sourceforge.net; Thu, 20 Jun 2024 16:42:31 +0200 From: Gert Doering To: openvpn-devel@lists.sourceforge.net Date: Thu, 20 Jun 2024 16:42:30 +0200 Message-ID: <20240620144230.19586-1-gert@greenie.muc.de> X-Mailer: git-send-email 2.44.1 In-Reply-To: References: MIME-Version: 1.0 X-Spam-Score: -0.0 (/) X-Spam-Report: Spam detection software, running on the system "util-spamd-2.v13.lw.sourceforge.com", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: From: Frank Lichtenheld These are not covered by -Wall (nor -Wextra) but we want to enforce them. Change-Id: I6e08920e4cf4762b9f14a7461a29fa77df15255c Signed-off-by: Frank Lichtenheld Acked-by: Gert Doering --- Content analysis details: (-0.0 points, 6.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 URIBL_BLOCKED ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [URIs: openvpn.net] 0.0 RCVD_IN_VALIDITY_SAFE_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. [193.149.48.174 listed in sa-trusted.bondedsender.org] 0.0 RCVD_IN_VALIDITY_RPBL_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. [193.149.48.174 listed in bl.score.senderscore.com] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 T_SCC_BODY_TEXT_LINE No description available. X-Headers-End: 1sKIzm-00020n-U4 Subject: [Openvpn-devel] [PATCH v4] configure: Add -Wstrict-prototypes and -Wold-style-definition X-BeenThere: openvpn-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox X-GMAIL-THRID: =?utf-8?q?1802387489115938626?= X-GMAIL-MSGID: =?utf-8?q?1802391608830906702?= From: Frank Lichtenheld These are not covered by -Wall (nor -Wextra) but we want to enforce them. Change-Id: I6e08920e4cf4762b9f14a7461a29fa77df15255c Signed-off-by: Frank Lichtenheld Acked-by: Gert Doering --- This change was reviewed on Gerrit and approved by at least one developer. I request to merge it to master. Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/667 This mail reflects revision 4 of this Change. Acked-by according to Gerrit (reflected above): Gert Doering diff --git a/configure.ac b/configure.ac index 2e5ab6a..c01ad09 100644 --- a/configure.ac +++ b/configure.ac @@ -1408,6 +1408,8 @@ ) ACL_CHECK_ADD_COMPILE_FLAGS([-Wno-stringop-truncation]) +ACL_CHECK_ADD_COMPILE_FLAGS([-Wstrict-prototypes]) +ACL_CHECK_ADD_COMPILE_FLAGS([-Wold-style-definition]) ACL_CHECK_ADD_COMPILE_FLAGS([-Wall]) if test "${enable_pedantic}" = "yes"; then diff --git a/src/openvpn/dco.h b/src/openvpn/dco.h index 50ebb35..035474f 100644 --- a/src/openvpn/dco.h +++ b/src/openvpn/dco.h @@ -247,7 +247,7 @@ * * @return list of colon-separated ciphers */ -const char *dco_get_supported_ciphers(); +const char *dco_get_supported_ciphers(void); #else /* if defined(ENABLE_DCO) */ @@ -375,7 +375,7 @@ } static inline const char * -dco_get_supported_ciphers() +dco_get_supported_ciphers(void) { return ""; } diff --git a/src/openvpn/dco_freebsd.c b/src/openvpn/dco_freebsd.c index 7c8b29c..9a90f5c 100644 --- a/src/openvpn/dco_freebsd.c +++ b/src/openvpn/dco_freebsd.c @@ -773,7 +773,7 @@ } const char * -dco_get_supported_ciphers() +dco_get_supported_ciphers(void) { return "none:AES-256-GCM:AES-192-GCM:AES-128-GCM:CHACHA20-POLY1305"; } diff --git a/src/openvpn/dco_linux.c b/src/openvpn/dco_linux.c index b2584b9..277cd64 100644 --- a/src/openvpn/dco_linux.c +++ b/src/openvpn/dco_linux.c @@ -1053,7 +1053,7 @@ } const char * -dco_get_supported_ciphers() +dco_get_supported_ciphers(void) { return "AES-128-GCM:AES-256-GCM:AES-192-GCM:CHACHA20-POLY1305"; } diff --git a/src/openvpn/pkcs11.h b/src/openvpn/pkcs11.h index 3caedc0..772fa4e 100644 --- a/src/openvpn/pkcs11.h +++ b/src/openvpn/pkcs11.h @@ -35,7 +35,7 @@ ); void -pkcs11_terminate(); +pkcs11_terminate(void); bool pkcs11_addProvider( @@ -46,10 +46,10 @@ ); int -pkcs11_logout(); +pkcs11_logout(void); int -pkcs11_management_id_count(); +pkcs11_management_id_count(void); bool pkcs11_management_id_get( diff --git a/src/openvpn/sig.c b/src/openvpn/sig.c index cfbd942..8323f0d 100644 --- a/src/openvpn/sig.c +++ b/src/openvpn/sig.c @@ -448,7 +448,7 @@ } void -halt_low_priority_signals() +halt_low_priority_signals(void) { #ifndef _WIN32 struct sigaction sa; diff --git a/src/openvpn/ssl.c b/src/openvpn/ssl.c index 2054eb4..17078c9 100644 --- a/src/openvpn/ssl.c +++ b/src/openvpn/ssl.c @@ -277,7 +277,7 @@ #endif void -enable_auth_user_pass() +enable_auth_user_pass(void) { auth_user_pass_enabled = true; } diff --git a/src/openvpn/ssl.h b/src/openvpn/ssl.h index 98e59e8..0e2a43f 100644 --- a/src/openvpn/ssl.h +++ b/src/openvpn/ssl.h @@ -381,7 +381,7 @@ void pem_password_setup(const char *auth_file); /* Enables the use of user/password authentication */ -void enable_auth_user_pass(); +void enable_auth_user_pass(void); /* * Setup authentication username and password. If auth_file is given, use the diff --git a/src/openvpn/xkey_helper.c b/src/openvpn/xkey_helper.c index 283c95d..b68fb43 100644 --- a/src/openvpn/xkey_helper.c +++ b/src/openvpn/xkey_helper.c @@ -49,7 +49,7 @@ XKEY_EXTERNAL_SIGN_fn xkey_management_sign; static void -print_openssl_errors() +print_openssl_errors(void) { unsigned long e; while ((e = ERR_get_error())) diff --git a/src/openvpn/xkey_provider.c b/src/openvpn/xkey_provider.c index f5fc956..964d2eb 100644 --- a/src/openvpn/xkey_provider.c +++ b/src/openvpn/xkey_provider.c @@ -155,7 +155,7 @@ keymgmt_import_helper(XKEY_KEYDATA *key, const OSSL_PARAM params[]); static XKEY_KEYDATA * -keydata_new() +keydata_new(void) { xkey_dmsg(D_XKEY, "entry"); diff --git a/tests/unit_tests/openvpn/test_common.h b/tests/unit_tests/openvpn/test_common.h index f219e93..52503c6 100644 --- a/tests/unit_tests/openvpn/test_common.h +++ b/tests/unit_tests/openvpn/test_common.h @@ -33,7 +33,7 @@ * methods */ static inline void -openvpn_unit_test_setup() +openvpn_unit_test_setup(void) { assert_int_equal(setvbuf(stdout, NULL, _IONBF, BUFSIZ), 0); assert_int_equal(setvbuf(stderr, NULL, _IONBF, BUFSIZ), 0); diff --git a/tests/unit_tests/openvpn/test_pkcs11.c b/tests/unit_tests/openvpn/test_pkcs11.c index 84ebb29..6d283a2 100644 --- a/tests/unit_tests/openvpn/test_pkcs11.c +++ b/tests/unit_tests/openvpn/test_pkcs11.c @@ -134,7 +134,7 @@ /* Fill-in certs[] array */ void -init_cert_data() +init_cert_data(void) { struct test_cert certs_local[] = { {cert1, key1, cname1, "OVPN TEST CA1", "OVPN Test Cert 1", {0}, NULL}, diff --git a/tests/unit_tests/openvpn/test_provider.c b/tests/unit_tests/openvpn/test_provider.c index 934b2d3..cfe9ac3 100644 --- a/tests/unit_tests/openvpn/test_provider.c +++ b/tests/unit_tests/openvpn/test_provider.c @@ -119,7 +119,7 @@ } static void -init_test() +init_test(void) { openvpn_unit_test_setup(); prov[0] = OSSL_PROVIDER_load(NULL, "default"); @@ -135,7 +135,7 @@ } static void -uninit_test() +uninit_test(void) { for (size_t i = 0; i < _countof(prov); i++) { diff --git a/tests/unit_tests/openvpn/test_ssl.c b/tests/unit_tests/openvpn/test_ssl.c index a9a3137..5da5b1c 100644 --- a/tests/unit_tests/openvpn/test_ssl.c +++ b/tests/unit_tests/openvpn/test_ssl.c @@ -81,7 +81,7 @@ "-----END CERTIFICATE-----\n"; static const char * -get_tmp_dir() +get_tmp_dir(void) { const char *ret; #ifdef _WIN32 diff --git a/tests/unit_tests/plugins/auth-pam/test_search_and_replace.c b/tests/unit_tests/plugins/auth-pam/test_search_and_replace.c index ee7a151..d40467f 100644 --- a/tests/unit_tests/plugins/auth-pam/test_search_and_replace.c +++ b/tests/unit_tests/plugins/auth-pam/test_search_and_replace.c @@ -9,7 +9,7 @@ #include "utils.h" static void -pass_any_null_param__returns_null() +pass_any_null_param__returns_null(void **state) { char DUMMY[] = "DUMMY"; @@ -20,7 +20,7 @@ } static void -pass_any_empty_string__returns_null() +pass_any_empty_string__returns_null(void **state) { char DUMMY[] = "DUMMY"; @@ -32,7 +32,7 @@ } static void -replace_single_char__one_time__match_is_replaced() +replace_single_char__one_time__match_is_replaced(void **state) { char *replaced = searchandreplace("X", "X", "Y"); @@ -43,7 +43,7 @@ } static void -replace_single_char__multiple_times__match_all_matches_are_replaced() +replace_single_char__multiple_times__match_all_matches_are_replaced(void **state) { char *replaced = searchandreplace("XaX", "X", "Y"); @@ -54,7 +54,7 @@ } static void -replace_longer_text__multiple_times__match_all_matches_are_replaced() +replace_longer_text__multiple_times__match_all_matches_are_replaced(void **state) { char *replaced = searchandreplace("XXaXX", "XX", "YY"); @@ -65,7 +65,7 @@ } static void -pattern_not_found__returns_original() +pattern_not_found__returns_original(void **state) { char *replaced = searchandreplace("abc", "X", "Y");