From patchwork Sun Mar 23 21:13:53 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gert Doering X-Patchwork-Id: 4188 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7000:81e:b0:60a:d70a:d3c7 with SMTP id jj30csp1557952mab; Sun, 23 Mar 2025 14:14:28 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWe7ds8G5IsTW7YqnSwIH3loPhI+tb0c7b5ZIlJvMy0G3M6JWu2Hsr6TZbsJrppP18URtsD0nyJ6VU=@openvpn.net X-Google-Smtp-Source: AGHT+IH47pUK+M9CqbNZ14QlW96npcIsuZ0OZH6/g/5wEbaGkOnXd3YQsJleQG3ucjxw5o0HWwLC X-Received: by 2002:a05:6870:c111:b0:2bc:7c3d:1918 with SMTP id 586e51a60fabf-2c78035afa0mr6913614fac.21.1742764467796; Sun, 23 Mar 2025 14:14:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1742764467; cv=none; d=google.com; s=arc-20240605; b=NL9m9Oomy4kLin7wRKXv8zs4DTosskZpn3VnWuTFLOEdERhRN/oeajRG6FKQ2hWpKj RePRX450eFtYdC+FeJLOgxHia8mZTvXZ9ZOpX7VdxDhBPcz597ipzV+KYoTAocOKMgsM 5YBor+nOlAwZZngbySZSz/jVFEKeUyAKsVVE0uOsEwXJWfFSeYUxSN4ZDD0qwZrwCXV/ ag2nP0K4/5eavEE+tV3HJJu18+LnmCRJzB5AvDAiSRpdOap5j6FdcYpNktl0KxEvBSII nioIX1/RA+AwJn8GiSTIveaj8xO9MIEmB8+WeebRJX9JWXZjJE+gQRqHxOd9mNaUYByn 0R0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=uvjgBGkCMn/Ty9eT8jjqPeK7EOEssTeVvggZ9ROKcm8=; fh=4NbAC/LsuMLI0S0hprUlLSLCiHwg6SCAifhH718Jh0Q=; b=T0pT9J/H95Cuavo9E+e+5KxEWtEU6UfuQgpLXxiS9syuMbCmlriH1EUvYDapwDuBwt ojdzvMm/LqkHOcTS4XmN0fZ/rMUONEDCp7m2C7GUFjORRKUflOtwO8ppby5ZQW0v+lgm HkwFdthcj865P32Mr5dhm4ATA0AFWNR7JKhlPhSmr0IwjdOqGwrjIL5sHHLdgOnQJI8z 1p4da1htDIg/YRF1fnbZC6WsX8o6uaycVvrLU0vHvgOJrpROG3ijdqIqsjvRPAhlewPi 9RLjmqfGSsrcvaFREcHLXKWn6O2PJQ6c/Ca5FcuoW3wJ21LndgrRulrAbQLYYkGnZeGc AN7w==; 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=ayJ8JIqf; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=NVTVAnwJ; 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 586e51a60fabf-2c77f177c95si5148049fac.264.2025.03.23.14.14.27 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 23 Mar 2025 14:14:27 -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=ayJ8JIqf; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=NVTVAnwJ; 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-1.v29.lw.sourceforge.com) by sfs-ml-1.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1twSeC-0006qR-4H; Sun, 23 Mar 2025 21:14:20 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-1.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1twSeA-0006qL-Vy for openvpn-devel@lists.sourceforge.net; Sun, 23 Mar 2025 21:14:19 +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=tP0VZQZHQ2jlVrgV4WClzHyUv87NTArXjAZ6vtE4Mfo=; b=ayJ8JIqfoh4vRZSbOcRIJ89pGH 6i3/JW2c/9iFPL/v/ZycyIlFCrgzLqz7m0v//UL2C9GGm48fWPgBH1QfvThoEggK67orhdrFF7oia luPpJT5LR9T56HXhsac+aX6G3969UgCKgSDJrY8b+9gT7MoeZhdRYXFfNI6f2fig0ljU=; 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=tP0VZQZHQ2jlVrgV4WClzHyUv87NTArXjAZ6vtE4Mfo=; b=NVTVAnwJxYEIknoNNZPziEnnbr nfDmjO5XHLfpKoC1tTMNURD3e5uEQceT7BjBb5c/pBrU0csuJJUcQSP3WU5ujzK8YqsTqoAIC2KHk TDbpYyn+bPgEa+mxDYEpyl4rJXWE117Jo9puuM0OPlZPPdnxqewyoPGGrGQdK1dI9ROE=; 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 1twSdz-0005Hl-BX for openvpn-devel@lists.sourceforge.net; Sun, 23 Mar 2025 21:14:19 +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 52NLE0EK014248 for ; Sun, 23 Mar 2025 22:14:00 +0100 Received: (from gert@localhost) by blue.greenie.muc.de (8.17.1.9/8.17.1.9/Submit) id 52NLE0md014247 for openvpn-devel@lists.sourceforge.net; Sun, 23 Mar 2025 22:14:00 +0100 From: Gert Doering To: openvpn-devel@lists.sourceforge.net Date: Sun, 23 Mar 2025 22:13:53 +0100 Message-ID: <20250323211359.14117-1-gert@greenie.muc.de> X-Mailer: git-send-email 2.45.2 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-1.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: Arne Schwabe Commit db48cea chagned logic to move logic from a variable and repeated checks to an if clause. The old code had Content analysis details: (0.0 points, 6.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 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_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record X-Headers-End: 1twSdz-0005Hl-BX Subject: [Openvpn-devel] [PATCH v1] Fix incorrect condition for checking password related check 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?1827420994857710428?= X-GMAIL-MSGID: =?utf-8?q?1827420994857710428?= From: Arne Schwabe Commit db48cea chagned logic to move logic from a variable and repeated checks to an if clause. The old code had const bool ccnr = (options->auth_user_pass_verify_script || PLUGIN_OPTION_LIST(options) || MAN_CLIENT_AUTH_ENABLED(options)); followed by several condition that checked !ccnr This commit fixes the if clause by correctly applying De Margan's law. Change-Id: I28a8abd0ee3fa9168a716171b0a405476089c4a1 Signed-off-by: Arne Schwabe Acked-by: Antonio Quartulli --- 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/+/912 This mail reflects revision 1 of this Change. Acked-by according to Gerrit (reflected above): Antonio Quartulli diff --git a/src/openvpn/options.c b/src/openvpn/options.c index 67ef55b..ab56609 100644 --- a/src/openvpn/options.c +++ b/src/openvpn/options.c @@ -2752,8 +2752,8 @@ } if (!options->auth_user_pass_verify_script - || PLUGIN_OPTION_LIST(options) - || MAN_CLIENT_AUTH_ENABLED(options)) + && !PLUGIN_OPTION_LIST(options) + && !MAN_CLIENT_AUTH_ENABLED(options)) { const char *use_err = "--%s must be used with --management-client-auth, an --auth-user-pass-verify script, or plugin";