From patchwork Wed Nov 11 16:39:30 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gert Doering X-Patchwork-Id: 5672 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:6022:529c:b0:11a:a05e:cb97 with SMTP id x28csp729049lax; Wed, 11 Nov 2026 08:40:14 -0800 (PST) X-Forwarded-Encrypted: i=2; AL+hErHkDndjLBj9QkwPqKbPt5Iko1q139l54Y4Ynh/eoNXbcuqcfsebVYtqy+u+ZNSTJJSYhGHEGAFWnxI=@openvpn.net X-Received: by 2002:a05:7301:1a0d:b0:375:388:a6d5 with SMTP id 5a478bee46e88-376867551e5mr3227369eec.32.1794415213665; Wed, 11 Nov 2026 08:40:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1794415213; cv=none; d=google.com; s=arc-20260327; b=bbJCrp/U+Gjz/DZVuNojWtAebjnaMAOoG5Q4kdl2VCts0kRdWPkHTHobKcTMT7hS9G WqxYe+n0gHyOGDv1hrvCXCFTe3kz+TRkJUKBl2MNysXMYsGTVd2DtWFQbMri3d5xJiI3 /CmZFE0JR6qWilZkxYZCyXjQz6NOEremx1vd1xC48FXVnNPdTDFfHMFejfuu4g1G8mwF 462zQeoaTKTtn4D6wLAaQgRA1hjAvYGsOpoqiEKdmMTz41KzNYRX4qE+nH94/nS3NE/r QjpIbD1u5MkqbMKwmgronWnWd4lf+KxtRxVrkD/EJRCLK1tTUq9MYS5MTBXR52Ii8kv6 RaMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; 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:dkim-signature; bh=gxayzIQzgMvhlZqnOvI60imfyYEHTs3MRordRb9+tFE=; fh=4NbAC/LsuMLI0S0hprUlLSLCiHwg6SCAifhH718Jh0Q=; b=FriNGzPY5SYkp9ANammdohJtqmr6XYQigu9K3885oKUv4q8JoaTETrLG65qzl5tSjt U6oWixm3tz771p7vr69VkGBQ5nyUbkqUApkLIxqV1rhEp1NqVH/zNCmi8XEBWMbb1L9x na8lnAb3dL3Dcnftw9xG8dvQSho7pz/wneOayZEdpvAY/xOduNmlj1eOeutow5FUtcXl ExnTu30F8hQDi9cix3N/oXRQd9u6lVC7Lr4T+t9NPVWk5MTCkuZUkcNjeBDymJc+LJSk N8t8nncWtK0EkDzz2pn9OkPX9a3zamtLFzneI/eYfNxtVkulMaePLvGk7dGLLrETLbWU bJkA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.sourceforge.net header.s=beta header.b=WZ0ERWxj; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b="Q9V/y5/G"; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=LHjp45zn; 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 5a478bee46e88-37520617c42si18358110eec.18.2026.11.11.08.40.13 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 11 Nov 2026 08:40:13 -0800 (PST) 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=pass header.i=@lists.sourceforge.net header.s=beta header.b=WZ0ERWxj; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b="Q9V/y5/G"; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=LHjp45zn; 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 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.sourceforge.net; s=beta; h=Content-Transfer-Encoding:Content-Type: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: Subject:MIME-Version:References:In-Reply-To:Message-ID:Date:To:From:Sender: Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Unsubscribe-Post: List-Owner; bh=gxayzIQzgMvhlZqnOvI60imfyYEHTs3MRordRb9+tFE=; b=WZ0ERWxjAk6unE HBQx023/BvpUnvHb9EvKIbIpCtkucQbqJGN4O/l3jB7StHHp9SrK3kKSwzZ91Uhe3ht8GcHjJR8qH FeyMTxGPnI75SoMTQMwUYz/sVBbz7TUHMyEGGEjVI7V8saWpove15T4ruhBVYvYvQDjetIsFiiO9P IVs=; Received: from [127.0.0.1] (helo=sfs-ml-2.v29.lw.sourceforge.com) by sfs-ml-2.v29.lw.sourceforge.com with esmtp (Exim 4.100.1) (envelope-from ) id 1xRBMp-000000003iU-3xqG; Wed, 11 Nov 2026 16:40:11 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-2.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.100.1) (envelope-from ) id 1xRBMT-000000003gC-14GD for openvpn-devel@lists.sourceforge.net; Wed, 11 Nov 2026 16:39:49 +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-Unsubscribe-Post:List-Subscribe:List-Post:List-Owner:List-Archive; bh=VwIRcvuLKORY6VN/5Q9Rqr+KGAxw/a6yDdL0kUY4DIg=; b=Q9V/y5/GSves+MGtrCyLuKyELp tsgwcxkxqjJephKdpGd4LZIDr3Pt5UX9LB7DgSDO11BC5XucnISQeXlqMaVSdl8qkds4JUM+WZaCs TSOSzsFQx43+Y8+OcqcCw9J2grxOvAaZa35tgetUu5MmzxqKNjbnn1t7BsNIsKOnB5EM=; 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-Unsubscribe-Post: List-Subscribe:List-Post:List-Owner:List-Archive; bh=VwIRcvuLKORY6VN/5Q9Rqr+KGAxw/a6yDdL0kUY4DIg=; b=LHjp45znMGniPyBLg0Rjd7em+v IKZylNnbSpLtuE/l1JUdA31WG/ZaVCFV/GFiJOsmiwCBf268lhRXkdVNiLxKONauzxtdnxV7gnN4u ZFl4/V/Sy4t/5lp1b072/klOVLbwUXRaZq1jKFQNYU1F4e6RL9pStsQ9Ag8+lfK2c75I=; Received: from [193.149.48.129] (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.100.1) id 1xRBMM-0000000059Y-2xTA for openvpn-devel@lists.sourceforge.net; Wed, 11 Nov 2026 16:39:44 +0000 Received: from blue.greenie.muc.de (localhost [127.0.0.1]) by blue.greenie.muc.de (8.18.1/8.18.1) with ESMTP id 6ABGdZld006625 for ; Wed, 11 Nov 2026 17:39:35 +0100 Received: (from gert@localhost) by blue.greenie.muc.de (8.18.2/8.18.1/Submit) id 6ABGdZAD006624 for openvpn-devel@lists.sourceforge.net; Wed, 11 Nov 2026 17:39:35 +0100 From: Gert Doering To: openvpn-devel@lists.sourceforge.net Date: Wed, 11 Nov 2026 17:39:30 +0100 Message-ID: <20261111163935.6604-1-gert@greenie.muc.de> X-Mailer: git-send-email 2.55.0 In-Reply-To: References: MIME-Version: 1.0 X-Spam-Score: 1.3 (+) X-Spam-Report: Spam detection software, running on the system "sfi-spamd-1.hosts.colo.sdot.me", 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: Steffan Karger httpdigest.h defines IN as const, and never undefines it. This leaks into the pkcs11-helper headers that proxy.c includes later on, which use IN/OUT as empty annotations and only define them if not de [...] Content analysis details: (1.3 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 1.3 RDNS_NONE Delivered to internal network by a host with no rDNS X-Headers-End: 1xRBMM-0000000059Y-2xTA Subject: [Openvpn-devel] [PATCH v2] httpdigest: replace IN/OUT macros with plain const 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: 1881580727394045277 X-GMAIL-MSGID: 1881580727394045277 From: Steffan Karger httpdigest.h defines IN as const, and never undefines it. This leaks into the pkcs11-helper headers that proxy.c includes later on, which use IN/OUT as empty annotations and only define them if not defined yet. That changes the pkcs11-helper declarations proxy.c sees ('IN void * const' becomes 'const void * const'), and makes clang spit out over a hundred -Wduplicate-decl-specifier warnings. Just use const where we used IN, and drop OUT. No functional change. Change-Id: I2490a0780a6e7c98a270e97b415b0387093d37be Signed-off-by: Steffan Karger Acked-by: Razvan Cojocaru Acked-by: Arne Schwabe Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/2166 --- 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/+/2166 This mail reflects revision 2 of this Change. Acked-by according to Gerrit (reflected above): Razvan Cojocaru Arne Schwabe diff --git a/src/openvpn/httpdigest.c b/src/openvpn/httpdigest.c index 52df383..9bfa074 100644 --- a/src/openvpn/httpdigest.c +++ b/src/openvpn/httpdigest.c @@ -32,7 +32,7 @@ #include "httpdigest.h" static void -CvtHex(IN HASH Bin, OUT HASHHEX Hex) +CvtHex(const HASH Bin, HASHHEX Hex) { for (unsigned short i = 0; i < HASHLEN; i++) { @@ -60,8 +60,8 @@ /* calculate H(A1) as per spec */ void -DigestCalcHA1(IN char *pszAlg, IN char *pszUserName, IN char *pszRealm, IN char *pszPassword, - IN char *pszNonce, IN char *pszCNonce, OUT HASHHEX SessionKey) +DigestCalcHA1(const char *pszAlg, const char *pszUserName, const char *pszRealm, const char *pszPassword, + const char *pszNonce, const char *pszCNonce, HASHHEX SessionKey) { HASH HA1; md_ctx_t *md5_ctx = md_ctx_new(); @@ -90,15 +90,15 @@ /* calculate request-digest/response-digest as per HTTP Digest spec */ void -DigestCalcResponse(IN HASHHEX HA1, /* H(A1) */ - IN char *pszNonce, /* nonce from server */ - IN char *pszNonceCount, /* 8 hex digits */ - IN char *pszCNonce, /* client nonce */ - IN char *pszQop, /* qop-value: "", "auth", "auth-int" */ - IN char *pszMethod, /* method from the request */ - IN char *pszDigestUri, /* requested URL */ - IN HASHHEX HEntity, /* H(entity body) if qop="auth-int" */ - OUT HASHHEX Response /* request-digest or response-digest */ +DigestCalcResponse(const HASHHEX HA1, /* H(A1) */ + const char *pszNonce, /* nonce from server */ + const char *pszNonceCount, /* 8 hex digits */ + const char *pszCNonce, /* client nonce */ + const char *pszQop, /* qop-value: "", "auth", "auth-int" */ + const char *pszMethod, /* method from the request */ + const char *pszDigestUri, /* requested URL */ + const HASHHEX HEntity, /* H(entity body) if qop="auth-int" */ + HASHHEX Response /* request-digest or response-digest */ ) { HASH HA2; diff --git a/src/openvpn/httpdigest.h b/src/openvpn/httpdigest.h index 9f3b075..37f3d98 100644 --- a/src/openvpn/httpdigest.h +++ b/src/openvpn/httpdigest.h @@ -26,25 +26,21 @@ typedef unsigned char HASH[HASHLEN]; #define HASHHEXLEN 32 typedef unsigned char HASHHEX[HASHHEXLEN + 1]; -#undef IN -#undef OUT -#define IN const -#define OUT /* calculate H(A1) as per HTTP Digest spec */ -void DigestCalcHA1(IN char *pszAlg, IN char *pszUserName, IN char *pszRealm, IN char *pszPassword, - IN char *pszNonce, IN char *pszCNonce, OUT HASHHEX SessionKey); +void DigestCalcHA1(const char *pszAlg, const char *pszUserName, const char *pszRealm, const char *pszPassword, + const char *pszNonce, const char *pszCNonce, HASHHEX SessionKey); /* calculate request-digest/response-digest as per HTTP Digest spec */ -void DigestCalcResponse(IN HASHHEX HA1, /* H(A1) */ - IN char *pszNonce, /* nonce from server */ - IN char *pszNonceCount, /* 8 hex digits */ - IN char *pszCNonce, /* client nonce */ - IN char *pszQop, /* qop-value: "", "auth", "auth-int" */ - IN char *pszMethod, /* method from the request */ - IN char *pszDigestUri, /* requested URL */ - IN HASHHEX HEntity, /* H(entity body) if qop="auth-int" */ - OUT HASHHEX Response /* request-digest or response-digest */ +void DigestCalcResponse(const HASHHEX HA1, /* H(A1) */ + const char *pszNonce, /* nonce from server */ + const char *pszNonceCount, /* 8 hex digits */ + const char *pszCNonce, /* client nonce */ + const char *pszQop, /* qop-value: "", "auth", "auth-int" */ + const char *pszMethod, /* method from the request */ + const char *pszDigestUri, /* requested URL */ + const HASHHEX HEntity, /* H(entity body) if qop="auth-int" */ + HASHHEX Response /* request-digest or response-digest */ ); #endif /* if PROXY_DIGEST_AUTH */