[Openvpn-devel] Fix binary and used instead auth-token check instead of logical and
| Message ID | 20210331155508.19423-1-arne@rfc2549.org |
|---|---|
| State | Changes Requested |
| Headers |
Return-Path: <openvpn-devel-bounces@lists.sourceforge.net> Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director7.mail.ord1d.rsapps.net ([172.30.191.6]) by backend30.mail.ord1d.rsapps.net with LMTP id GBkyJLKbZGCWXQAAIUCqbw (envelope-from <openvpn-devel-bounces@lists.sourceforge.net>) for <patchwork@openvpn.net>; Wed, 31 Mar 2021 11:56:34 -0400 Received: from proxy9.mail.ord1d.rsapps.net ([172.30.191.6]) by director7.mail.ord1d.rsapps.net with LMTP id IFQhJLKbZGACdwAAovjBpQ (envelope-from <openvpn-devel-bounces@lists.sourceforge.net>) for <patchwork@openvpn.net>; Wed, 31 Mar 2021 11:56:34 -0400 Received: from smtp8.gate.ord1d ([172.30.191.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy9.mail.ord1d.rsapps.net with LMTPS id mHnZI7KbZGDUFwAA7h+8OQ (envelope-from <openvpn-devel-bounces@lists.sourceforge.net>) for <patchwork@openvpn.net>; Wed, 31 Mar 2021 11:56:34 -0400 X-Spam-Threshold: 95 X-Spam-Score: 0 X-Spam-Flag: NO X-Virus-Scanned: OK X-Orig-To: openvpnslackdevel@openvpn.net X-Originating-Ip: [216.105.38.7] Authentication-Results: smtp8.gate.ord1d.rsapps.net; iprev=pass policy.iprev="216.105.38.7"; spf=pass smtp.mailfrom="openvpn-devel-bounces@lists.sourceforge.net" smtp.helo="lists.sourceforge.net"; dkim=fail (signature verification failed) header.d=sourceforge.net; dkim=fail (signature verification failed) header.d=sf.net; dmarc=none (p=nil; dis=none) header.from=rfc2549.org X-Suspicious-Flag: YES X-Classification-ID: a911d250-9239-11eb-8812-5254001e5a60-1-1 Received: from [216.105.38.7] ([216.105.38.7:60708] helo=lists.sourceforge.net) by smtp8.gate.ord1d.rsapps.net (envelope-from <openvpn-devel-bounces@lists.sourceforge.net>) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id A9/EB-26568-FAB94606; Wed, 31 Mar 2021 11:56:31 -0400 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.90_1) (envelope-from <openvpn-devel-bounces@lists.sourceforge.net>) id 1lRdC6-0008DH-AK; Wed, 31 Mar 2021 15:55:46 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-1.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from <arne@kamera.blinkt.de>) id 1lRdBg-0008AY-VE for openvpn-devel@lists.sourceforge.net; Wed, 31 Mar 2021 15:55:20 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Message-Id:Date:Subject:To:From:Sender:Reply-To:Cc: MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=FF0EFztuZvXQtqkXm+yqE+SjWzIMLlyQ6DQeEVCkw7o=; b=leM5AB/2qch32DxoBQu669JVUI FJ/0JrCzqN4DgDBsPKwQCM6IJdf1fi5DrcTAj0xVrM+LZk0xmKPis/+JypnlAL+pTh3dLuS+YhHfv GaILTAwWLNsvNcT5OhHGmnXx00ChdwLaNkny16XK8578CgaCUPKy0Dzfu9BacHBPxLXY=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Message-Id:Date:Subject:To:From:Sender:Reply-To:Cc:MIME-Version: Content-Type:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=FF0EFztuZvXQtqkXm+yqE+SjWzIMLlyQ6DQeEVCkw7o=; b=b95jW1bFWIiRy9N1Ib4vT7Zwn+ 8Ixq/ssmvOQ6GhBZxOWdhcQYCpiSqLQKZQ/8WNkZsaZSGsKteGoWkmktezG9o32Gyd6t28jNFMUeE 75pjLb8Dm6soA3YPnhpylDOTg0ndb5d1PieQbQ9Dp6wYEAdHWkGhkRwSimtwgtE3Ypdg=; Received: from mail.blinkt.de ([192.26.174.232]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.3) id 1lRdBc-0007gt-8c for openvpn-devel@lists.sourceforge.net; Wed, 31 Mar 2021 15:55:20 +0000 Received: from kamera.blinkt.de ([2001:638:502:390:20c:29ff:fec8:535c]) by mail.blinkt.de with smtp (Exim 4.94 (FreeBSD)) (envelope-from <arne@kamera.blinkt.de>) id 1lRdBV-000FDg-0C for openvpn-devel@lists.sourceforge.net; Wed, 31 Mar 2021 17:55:09 +0200 Received: (nullmailer pid 19468 invoked by uid 10006); Wed, 31 Mar 2021 15:55:08 -0000 From: Arne Schwabe <arne@rfc2549.org> To: openvpn-devel@lists.sourceforge.net Date: Wed, 31 Mar 2021 17:55:08 +0200 Message-Id: <20210331155508.19423-1-arne@rfc2549.org> X-Mailer: git-send-email 2.17.1 X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. 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: rfc2549.org] 0.2 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level mail domains are different 0.0 SPF_NONE SPF: sender does not publish an SPF Record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record X-Headers-End: 1lRdBc-0007gt-8c Subject: [Openvpn-devel] [PATCH] Fix binary and used instead auth-token check instead of logical and X-BeenThere: openvpn-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: <openvpn-devel.lists.sourceforge.net> List-Unsubscribe: <https://lists.sourceforge.net/lists/options/openvpn-devel>, <mailto:openvpn-devel-request@lists.sourceforge.net?subject=unsubscribe> List-Archive: <http://sourceforge.net/mailarchive/forum.php?forum_name=openvpn-devel> List-Post: <mailto:openvpn-devel@lists.sourceforge.net> List-Help: <mailto:openvpn-devel-request@lists.sourceforge.net?subject=help> List-Subscribe: <https://lists.sourceforge.net/lists/listinfo/openvpn-devel>, <mailto:openvpn-devel-request@lists.sourceforge.net?subject=subscribe> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox |
| Series |
[Openvpn-devel] Fix binary and used instead auth-token check instead of logical and
|
|
Commit Message
Arne Schwabe
March 31, 2021, 4:55 a.m. UTC
AUTH_TOKEN_HMAC_OK is 1, so the first term is always 0/1 and the bool
from the second part is also 0/1, so the & does the same in this instance
as &&.
In this specific case & instead && does not change behaviour but using
&& is the intended semantic behaviour.
Signed-off-by: Arne Schwabe <arne@rfc2549.org>
---
src/openvpn/auth_token.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
Hi, I would reword the commit subject, because the way it is now fails to highlight that we are talking about a bitwise-and operator (&). On 31/03/2021 17:55, Arne Schwabe wrote: > AUTH_TOKEN_HMAC_OK is 1, so the first term is always 0/1 and the bool > from the second part is also 0/1, so the & does the same in this instance > as &&. > > In this specific case & instead && does not change behaviour but using > && is the intended semantic behaviour. > > Signed-off-by: Arne Schwabe <arne@rfc2549.org> > --- > src/openvpn/auth_token.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/src/openvpn/auth_token.c b/src/openvpn/auth_token.c > index cc70c06c3..d571b686e 100644 > --- a/src/openvpn/auth_token.c > +++ b/src/openvpn/auth_token.c > @@ -99,7 +99,7 @@ add_session_token_env(struct tls_session *session, struct tls_multi *multi, > /* We had a valid session id before */ > const char *session_id_source; > if (multi->auth_token_state_flags & AUTH_TOKEN_HMAC_OK > - &!(multi->auth_token_state_flags & AUTH_TOKEN_EXPIRED)) > + && !(multi->auth_token_state_flags & AUTH_TOKEN_EXPIRED)) > { > session_id_source = up->password; > } > Compile-tested and I stared at the change long enough that I can feel confident it does not change any functional behaviour. The commit subject did not pass the compile test :) therefore I Will wait for a new revision before leaving my ACK. Cheers,
Acked-by: Gert Doering <gert@greenie.muc.de> Your patch has been applied to the master branch. Release/2.5 has this fix already, as part of commit 3aca477a1b58. Antonio complained about the patch subject:, and asked for a v2 - which I did not see anywhere, so I rewrote the commit subject and now it's out of my work queue :-) commit 0cbfa10e6aac01831bebe42ab33dc56c4704c1a6 Author: Arne Schwabe Date: Wed Mar 31 17:55:08 2021 +0200 Fix binary and (&) used in auth-token check instead of logical and (&&) Signed-off-by: Arne Schwabe <arne@rfc2549.org> Acked-by: Gert Doering <gert@greenie.muc.de> Message-Id: <20210331155508.19423-1-arne@rfc2549.org> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg21911.html Signed-off-by: Gert Doering <gert@greenie.muc.de> -- kind regards, Gert Doering
diff --git a/src/openvpn/auth_token.c b/src/openvpn/auth_token.c index cc70c06c3..d571b686e 100644 --- a/src/openvpn/auth_token.c +++ b/src/openvpn/auth_token.c @@ -99,7 +99,7 @@ add_session_token_env(struct tls_session *session, struct tls_multi *multi, /* We had a valid session id before */ const char *session_id_source; if (multi->auth_token_state_flags & AUTH_TOKEN_HMAC_OK - &!(multi->auth_token_state_flags & AUTH_TOKEN_EXPIRED)) + && !(multi->auth_token_state_flags & AUTH_TOKEN_EXPIRED)) { session_id_source = up->password; }