From patchwork Wed Mar 31 04:55:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arne Schwabe X-Patchwork-Id: 1677 Return-Path: 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 ) for ; 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 ) for ; 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 ) for ; 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 ) (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 ) 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 ) 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 ) 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 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: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox 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 Acked-by: Gert Doering --- 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; }