From patchwork Tue Dec 1 23:59:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arne Schwabe X-Patchwork-Id: 1534 Return-Path: Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director14.mail.ord1d.rsapps.net ([172.31.255.6]) by backend41.mail.ord1d.rsapps.net with LMTP id MGW1BQB0x1/wKgAAqwncew (envelope-from ) for ; Wed, 02 Dec 2020 06:01:20 -0500 Received: from proxy15.mail.iad3b.rsapps.net ([172.31.255.6]) by director14.mail.ord1d.rsapps.net with LMTP id yAukBQB0x18jPAAAeJ7fFg (envelope-from ) for ; Wed, 02 Dec 2020 06:01:20 -0500 Received: from smtp2.gate.iad3b ([172.31.255.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy15.mail.iad3b.rsapps.net with LMTPS id 0Lc2AAB0x1+DQAAAhyf7VQ (envelope-from ) for ; Wed, 02 Dec 2020 06:01:20 -0500 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: smtp2.gate.iad3b.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: b449e928-348d-11eb-ac77-5254000fbace-1-1 Received: from [216.105.38.7] ([216.105.38.7:54834] helo=lists.sourceforge.net) by smtp2.gate.iad3b.rsapps.net (envelope-from ) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id 17/C5-28034-FF377CF5; Wed, 02 Dec 2020 06:01:19 -0500 Received: from [127.0.0.1] (helo=sfs-ml-4.v29.lw.sourceforge.com) by sfs-ml-4.v29.lw.sourceforge.com with esmtp (Exim 4.90_1) (envelope-from ) id 1kkPrm-0005z3-I9; Wed, 02 Dec 2020 11:00:10 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-4.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkPri-0005yk-EA for openvpn-devel@lists.sourceforge.net; Wed, 02 Dec 2020 11:00:06 +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=z+vYWmkg16TS4NuxarHVKqMqRedetoA0mp7fH4YeES4=; b=WmG5eFMr7nufKYjXipRzYW5XNs ntN99dn41X/Ai9inFt+H9MTMP9xpJ8V2SY0k0zYN2jayJhYOsnUJxCvmAD/KrHCgU1t211stuL+RA Hd1c97Ip9vpQxkMAdv0Y1yWb8jcgRGO1mZr1G5pdOsL/l6INC3r3xbXi0GBUcJ9wbuS4=; 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=z+vYWmkg16TS4NuxarHVKqMqRedetoA0mp7fH4YeES4=; b=DaajeAyK0FvRybA08huv1qxleU ZBIFibYCv0A4GR4gpAJM31TZhmiD5HqxYHn8jjMnG4Dj60ct48Oe7ZVdkH8I3DSicxCXmfiiHYQzm 1gftOhqZR0KY7lyuuEmgO519qd2zBqgYrMhRS13azfZAY4/emn46xY/LfYNfeY3tu7p8=; Received: from mail.blinkt.de ([192.26.174.232]) by sfi-mx-3.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.2) id 1kkPra-00Fn5x-Rm for openvpn-devel@lists.sourceforge.net; Wed, 02 Dec 2020 11:00:06 +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 1kkPrO-000N5P-VC for openvpn-devel@lists.sourceforge.net; Wed, 02 Dec 2020 11:59:46 +0100 Received: (nullmailer pid 8936 invoked by uid 10006); Wed, 02 Dec 2020 10:59:46 -0000 From: Arne Schwabe To: openvpn-devel@lists.sourceforge.net Date: Wed, 2 Dec 2020 11:59:46 +0100 Message-Id: <20201202105946.8891-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.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: 1kkPra-00Fn5x-Rm Subject: [Openvpn-devel] [PATCH] Remove auth_user_pass.wait_for_push variable 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 This variable was first introduce in earlier attempt to fix the auth-token problems with auth-nocache before user_password and auth_token were split into two variables. The idea of the variable it is being set if --pull is in use. However the variable was not always set correctly, especially if username/password are queried after an expired auth-token. Instead using that variable use session->opt->pull directly. Signed-off-by: Arne Schwabe --- src/openvpn/manage.c | 1 - src/openvpn/misc.h | 1 - src/openvpn/ssl.c | 7 +++---- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/openvpn/manage.c b/src/openvpn/manage.c index 68b136fb..446b82f4 100644 --- a/src/openvpn/manage.c +++ b/src/openvpn/manage.c @@ -3579,7 +3579,6 @@ management_query_user_pass(struct management *man, { /* preserve caller's settings */ man->connection.up_query.nocache = up->nocache; - man->connection.up_query.wait_for_push = up->wait_for_push; *up = man->connection.up_query; } secure_memzero(&man->connection.up_query, sizeof(man->connection.up_query)); diff --git a/src/openvpn/misc.h b/src/openvpn/misc.h index 8c3a1227..e4342b0d 100644 --- a/src/openvpn/misc.h +++ b/src/openvpn/misc.h @@ -64,7 +64,6 @@ struct user_pass { bool defined; bool nocache; - bool wait_for_push; /* true if this object is waiting for a push-reply */ /* max length of username/password */ #ifdef ENABLE_PKCS11 diff --git a/src/openvpn/ssl.c b/src/openvpn/ssl.c index 950bf421..52774a9a 100644 --- a/src/openvpn/ssl.c +++ b/src/openvpn/ssl.c @@ -434,8 +434,6 @@ ssl_set_auth_nocache(void) { passbuf.nocache = true; auth_user_pass.nocache = true; - /* wait for push-reply, because auth-token may still need the username */ - auth_user_pass.wait_for_push = true; } /* @@ -2414,14 +2412,15 @@ key_method_2_write(struct buffer *buf, struct tls_session *session) } /* if auth-nocache was specified, the auth_user_pass object reaches * a "complete" state only after having received the push-reply - * message. + * message. The push message might contain an auth-token that needs + * the username of auth_user_pass. * * For this reason, skip the purge operation here if no push-reply * message has been received yet. * * This normally happens upon first negotiation only. */ - if (!auth_user_pass.wait_for_push) + if (!session->opt->pull) { purge_user_pass(&auth_user_pass, false); }