From patchwork Mon Jan 25 01:56:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arne Schwabe X-Patchwork-Id: 1576 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 SAgUCkfADmDMXAAAIUCqbw (envelope-from ) for ; Mon, 25 Jan 2021 07:57:43 -0500 Received: from proxy5.mail.ord1d.rsapps.net ([172.30.191.6]) by director7.mail.ord1d.rsapps.net with LMTP id MAEBCkfADmAgOwAAovjBpQ (envelope-from ) for ; Mon, 25 Jan 2021 07:57:43 -0500 Received: from smtp7.gate.ord1c ([172.30.191.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy5.mail.ord1d.rsapps.net with LMTPS id aE+tCUfADmALdgAA8Zzt7w (envelope-from ) for ; Mon, 25 Jan 2021 07:57:43 -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: smtp7.gate.ord1c.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: e95a6efe-5f0c-11eb-9a37-bc305bf04148-1-1 Received: from [216.105.38.7] ([216.105.38.7:54950] helo=lists.sourceforge.net) by smtp7.gate.ord1c.rsapps.net (envelope-from ) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id 5B/56-07265-640CE006; Mon, 25 Jan 2021 07:57:43 -0500 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.90_1) (envelope-from ) id 1l41QQ-0006Gu-46; Mon, 25 Jan 2021 12:56:58 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-2.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l41QI-0006Fa-4v for openvpn-devel@lists.sourceforge.net; Mon, 25 Jan 2021 12:56:50 +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=/3eUrYX+suKwyBS3wbaL4owJAhwYI82eVYmN5HAYigA=; b=bdmpqFpzRtlG7CmXm4jnRUVQi6 +R4CJMraCo8lWJosn81xdbiWKcBPgY7nkj3JvpoW/qu948QKy8zCBpLLFlQFENbIiC9wd8eftG8Ln jkM9w0oZ8sePzX67skRJxaapgR4CWIzdqcrgiOmsT9kc+F8ihYFIsqqBaRQyWU3fMdMU=; 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=/3eUrYX+suKwyBS3wbaL4owJAhwYI82eVYmN5HAYigA=; b=BlEo+7V9qOBfoarRdZm0Gm21KP UrRqnluEGSQv2t3RqLM2MHIHTQMUZcM73N873qngvN0nMk99pgfNBgp6IicXi/W4zFIDt3eLe592E JqUKp6rhzLGDbW6mn1LtKy/woG38Jd6SNAzdWvo4GJzSUJTEYl9D8O5LrhH25/9WwNa4=; 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 1l41Q9-006gWX-76 for openvpn-devel@lists.sourceforge.net; Mon, 25 Jan 2021 12:56:50 +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 1l41Pw-0007Wo-LL for openvpn-devel@lists.sourceforge.net; Mon, 25 Jan 2021 13:56:28 +0100 Received: (nullmailer pid 30408 invoked by uid 10006); Mon, 25 Jan 2021 12:56:28 -0000 From: Arne Schwabe To: openvpn-devel@lists.sourceforge.net Date: Mon, 25 Jan 2021 13:56:17 +0100 Message-Id: <20210125125628.30364-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: 1l41Q9-006gWX-76 Subject: [Openvpn-devel] [PATCH v2 00/11] Pending authentication improvements 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 patchset brings a number of improvements: - Allow a tiemout that is different from the default 60s for pending authentication. 60s is a bit tight, especially when being redirected to a complicated web login process. - Make the server side auth-pending support no longer dependent on management interface but also allow scripts and plugins to utilise it. - Introduce deffered authentication support for scripts. Deferred authentication is a necessary requirement for pending authentication. The branch is also available here: https://github.com/schwabe/openvpn/tree/schwabe/auth_pending The v2 patches ae modified from the v1 if they contain a Patch v2 note in the commit message, otherwise they are just rebased and resent with the patchset. Arne Schwabe (11): Change pull request timeout use a timeout rather than a number Implement client side handling of AUTH_PENDING message Implement server side of AUTH_PENDING with extending timeout Introduce management client state for AUTH_PENDING notifications Change parameter of send_auth_pending_messages from context to tls_multi Add S_EXITCODE flag for openvpn_run_script to report exit code Refactor extract_var_peer_info into standalone function and add ssl_util.c Allow pending auth to be send from a auth plugin Implement deferred auth for scripts Implement --client-crresponse script options and plugin interface Add example script demonstrating TOTP via auth-pending Changes.rst | 21 ++ doc/man-sections/generic-options.rst | 3 +- doc/man-sections/script-options.rst | 45 +++- doc/man-sections/server-options.rst | 4 + doc/man-sections/tls-options.rst | 3 + doc/management-notes.txt | 39 +++- include/openvpn-plugin.h.in | 15 +- sample/sample-scripts/totpauth.py | 107 +++++++++ src/openvpn/Makefile.am | 1 + src/openvpn/forward.c | 27 ++- src/openvpn/forward.h | 9 + src/openvpn/init.c | 1 + src/openvpn/integer.h | 25 +++ src/openvpn/manage.c | 26 ++- src/openvpn/manage.h | 5 +- src/openvpn/multi.c | 29 +-- src/openvpn/openvpn.h | 2 +- src/openvpn/openvpn.vcxproj | 2 + src/openvpn/openvpn.vcxproj.filters | 6 + src/openvpn/options.c | 15 ++ src/openvpn/options.h | 1 + src/openvpn/platform.c | 34 +++ src/openvpn/platform.h | 5 +- src/openvpn/push.c | 153 ++++++++++++- src/openvpn/push.h | 23 +- src/openvpn/run_command.c | 25 ++- src/openvpn/run_command.h | 15 +- src/openvpn/ssl.c | 10 +- src/openvpn/ssl.h | 3 + src/openvpn/ssl_common.h | 4 + src/openvpn/ssl_ncp.c | 20 +- src/openvpn/ssl_util.c | 59 +++++ src/openvpn/ssl_util.h | 49 +++++ src/openvpn/ssl_verify.c | 311 ++++++++++++++++++++++++--- src/openvpn/ssl_verify.h | 25 ++- tests/unit_tests/openvpn/Makefile.am | 3 +- 36 files changed, 988 insertions(+), 137 deletions(-) create mode 100755 sample/sample-scripts/totpauth.py create mode 100644 src/openvpn/ssl_util.c create mode 100644 src/openvpn/ssl_util.h