From patchwork Wed Sep 30 03:13:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arne Schwabe X-Patchwork-Id: 1489 Return-Path: Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director7.mail.ord1d.rsapps.net ([172.31.255.6]) by backend30.mail.ord1d.rsapps.net with LMTP id GIpqG7yEdF+VYwAAIUCqbw (envelope-from ) for ; Wed, 30 Sep 2020 09:14:36 -0400 Received: from proxy19.mail.iad3b.rsapps.net ([172.31.255.6]) by director7.mail.ord1d.rsapps.net with LMTP id yM4+G7yEdF/aEwAAovjBpQ (envelope-from ) for ; Wed, 30 Sep 2020 09:14:36 -0400 Received: from smtp6.gate.iad3b ([172.31.255.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy19.mail.iad3b.rsapps.net with LMTPS id OMEME7yEdF/ZVgAAIG4riQ (envelope-from ) for ; Wed, 30 Sep 2020 09:14:36 -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: smtp6.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: e2921634-031e-11eb-8fb2-5254000d607e-1-1 Received: from [216.105.38.7] ([216.105.38.7:57132] helo=lists.sourceforge.net) by smtp6.gate.iad3b.rsapps.net (envelope-from ) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id 53/6D-17274-BB4847F5; Wed, 30 Sep 2020 09:14:35 -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 1kNbvV-0005gb-4K; Wed, 30 Sep 2020 13:13:45 +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 1kNbvP-0005fW-NW for openvpn-devel@lists.sourceforge.net; Wed, 30 Sep 2020 13:13:39 +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=ADzI1l9OGWAFJsiwQ7/ZJcxPIRnEb0n5LdLQFmVzohY=; b=ZXgfMK2cpbhv28HhPechK+PSIh oiURtnUjqAXvgGFKRo/uTuew4FELyalCWK50JHfxUL+AdbuNLk9JYtQ8+yx//VhJGq+HEZA5gcBS+ 6n5Qb6YG4K3PFqRXBX7pqqNsTtKwuPvZy4RiE7RYdWhREpwL5jVrNIbRnKMJ4sOsruaw=; 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=ADzI1l9OGWAFJsiwQ7/ZJcxPIRnEb0n5LdLQFmVzohY=; b=PJePlIA5EslecqHKHqYI0B9KmR aKd1xSXLQXa0swnyq/93ZyfzuXDjD1CO/RlAcofbP4B5Kl33TKkIFdCkjVkNMImKbAK8BMTjNDAZW HPu+CZdj2NYctXeD/Sy9tB5RCZa58toqMTHJovI1JISPkz5ZMXC0D6DSosSVfocYe8Ow=; 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 1kNbvF-00BNb8-Rr for openvpn-devel@lists.sourceforge.net; Wed, 30 Sep 2020 13:13:39 +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 1kNbv4-0003ni-0j for openvpn-devel@lists.sourceforge.net; Wed, 30 Sep 2020 15:13:18 +0200 Received: (nullmailer pid 1349 invoked by uid 10006); Wed, 30 Sep 2020 13:13:17 -0000 From: Arne Schwabe To: openvpn-devel@lists.sourceforge.net Date: Wed, 30 Sep 2020 15:13:05 +0200 Message-Id: <20200930131317.1299-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: makefile.am] 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: 1kNbvF-00BNb8-Rr Subject: [Openvpn-devel] [PATCH 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 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 | 18 ++ 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 | 4 + 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 | 29 ++- 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 | 35 ++++ src/openvpn/platform.h | 5 +- src/openvpn/push.c | 157 ++++++++++++++- src/openvpn/push.h | 23 ++- src/openvpn/run_command.c | 25 ++- src/openvpn/run_command.h | 14 +- src/openvpn/ssl.c | 8 +- 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 | 283 +++++++++++++++++++++++++-- src/openvpn/ssl_verify.h | 25 ++- tests/unit_tests/openvpn/Makefile.am | 3 +- 36 files changed, 982 insertions(+), 118 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