| Message ID | 20190510121114.30468-1-arne@rfc2549.org |
|---|---|
| Headers |
Return-Path: <openvpn-devel-bounces@lists.sourceforge.net> Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director9.mail.ord1d.rsapps.net ([172.31.255.6]) by backend30.mail.ord1d.rsapps.net with LMTP id GCNsIStv1VywZgAAIUCqbw for <patchwork@openvpn.net>; Fri, 10 May 2019 08:31:39 -0400 Received: from proxy3.mail.iad3b.rsapps.net ([172.31.255.6]) by director9.mail.ord1d.rsapps.net with LMTP id YPA/Hytv1VzXTwAAalYnBA ; Fri, 10 May 2019 08:31:39 -0400 Received: from smtp30.gate.iad3b ([172.31.255.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy3.mail.iad3b.rsapps.net with LMTP id iPBOGitv1VzDHwAAM8Wetg ; Fri, 10 May 2019 08:31:39 -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: smtp30.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: 8e39be6a-731f-11e9-b305-525400502618-1-1 Received: from [216.105.38.7] ([216.105.38.7:22769] helo=lists.sourceforge.net) by smtp30.gate.iad3b.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 20/6E-04453-A2F65DC5; Fri, 10 May 2019 08:31:38 -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 1hP4ft-0001gj-Va; Fri, 10 May 2019 12:30:53 +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 1hP4fs-0001gQ-Ex for openvpn-devel@lists.sourceforge.net; Fri, 10 May 2019 12:30:52 +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=eglK0iOtpgJTc820xen1ylX1yf7M+6Y3imD3iEzFnYM=; b=HNhe7S+EWbzPGkPT1JOMINlRDD IFsiUQdC2B5IrcLWGrpyPZZxMYMc9KKdUNSzCl2pkEjMA7lC6UqH+uyww3/72EqUVthJHULUqgP78 BqUna6IKLbTomc40hwQe4+p06tBqepRDnSR+m+a4alKwjZ4RO1TFnEk5G9QDMeKCsm4o=; 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=eglK0iOtpgJTc820xen1ylX1yf7M+6Y3imD3iEzFnYM=; b=OJfqk3onzWS0hDNL8vLsppPc45 y3F64gGtdvYL+YOjUyNDcGIS3YewBQ4wMQ3zqgRRhAyVdxMCHLlxIkSBNkNsrNKz4MOHVXhbegD9I u5TH08dtKSNcUMHN1i0wDxrfJRBRfTNhYFgSLsUZRO7/5vQNzFU7sX9yr96SynSAj9Bw=; 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.90_1) id 1hP4fr-00Byrj-3o for openvpn-devel@lists.sourceforge.net; Fri, 10 May 2019 12:30:52 +0000 Received: from kamera.blinkt.de ([2001:638:502:390:20c:29ff:fec8:535c]) by mail.blinkt.de with smtp (Exim 4.91 (FreeBSD)) (envelope-from <arne@kamera.blinkt.de>) id 1hP4Ms-000B4g-VC for openvpn-devel@lists.sourceforge.net; Fri, 10 May 2019 14:11:14 +0200 Received: (nullmailer pid 30513 invoked by uid 10006); Fri, 10 May 2019 12:11:14 -0000 From: Arne Schwabe <arne@rfc2549.org> To: openvpn-devel@lists.sourceforge.net Date: Fri, 10 May 2019 14:11:07 +0200 Message-Id: <20190510121114.30468-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.1 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level mail domains are different 0.2 AWL AWL: Adjusted score from AWL reputation of From: address X-Headers-End: 1hP4fr-00Byrj-3o Subject: [Openvpn-devel] [PATCH v3 0/7] Auth token patches v3 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 |
Auth token patches v3
|
|
Message
Arne Schwabe
May 10, 2019, 2:11 a.m. UTC
This is the v3 of the patch series. I choose to resend all of the patches so they all cleanly apply. Since the patches depend on the changes suggested to --genkey, I made them part of the patch series. The other patches have been updated to incoperate the feedback. Arne Schwabe (7): Write key to stdout if filename is not given Implement --genkey type keyfile syntax and migrate tls-crypt-v2 Add pem_read_key_file variant that allows a random key Rewrite auth-token-gen to be based on HMAC based tokens Implement a permanent session id in auth-token Sent indication that a session is expired to clients Implement unit tests for auth-gen-token doc/openvpn.8 | 141 ++++++-- src/openvpn/Makefile.am | 1 + src/openvpn/auth_token.c | 387 +++++++++++++++++++++ src/openvpn/auth_token.h | 129 +++++++ src/openvpn/crypto.c | 35 +- src/openvpn/crypto.h | 15 + src/openvpn/init.c | 90 +++-- src/openvpn/manage.c | 4 +- src/openvpn/openvpn.h | 1 + src/openvpn/options.c | 103 ++++-- src/openvpn/options.h | 19 +- src/openvpn/push.c | 70 +++- src/openvpn/push.h | 8 + src/openvpn/ssl.c | 13 +- src/openvpn/ssl_common.h | 56 +-- src/openvpn/ssl_verify.c | 213 ++++++------ src/openvpn/ssl_verify.h | 15 +- src/openvpn/tls_crypt.c | 13 +- tests/unit_tests/openvpn/Makefile.am | 18 +- tests/unit_tests/openvpn/test_auth_token.c | 375 ++++++++++++++++++++ 20 files changed, 1457 insertions(+), 249 deletions(-) create mode 100644 src/openvpn/auth_token.c create mode 100644 src/openvpn/auth_token.h create mode 100644 tests/unit_tests/openvpn/test_auth_token.c
Comments
Am 10.05.19 um 17:14 schrieb Jan Just Keijser: > Hi Arne, > > On 10/05/19 14:11, Arne Schwabe wrote: >> This is the v3 of the patch series. I choose to resend all of the patches >> so they all cleanly apply. Since the patches depend on the changes >> suggested >> to --genkey, I made them part of the patch series. The other patches have >> been updated to incoperate the feedback. >> >> Arne Schwabe (7): >> Write key to stdout if filename is not given >> Implement --genkey type keyfile syntax and migrate tls-crypt-v2 >> Add pem_read_key_file variant that allows a random key >> Rewrite auth-token-gen to be based on HMAC based tokens >> Implement a permanent session id in auth-token >> Sent indication that a session is expired to clients >> Implement unit tests for auth-gen-token >> >> > I 've been busy with the --genkey patch and was wondering how/when to > include any auth-token stuff; should I wait for this patch to be ACKed > and then do a git clone again? or can I include your patch beforehand > (if so, which git magic is needed for that?) Sorry that, I missed from your last mail that you also wanted to prepare a patch and basically implemented what I think you proposed in your last email to get a an updated patch set of auth-token :( That was bad coordination from my part. Personally I don't care which way around we do this. Either you send your patch too and I review that one or you review my patch and then eitehr accept it, force my to redo it or declare it so ppor that you have to send your patch anyway. Arne
On 10/05/2019 14:11, Arne Schwabe wrote: > This is the v3 of the patch series. I choose to resend all of the patches > so they all cleanly apply. Since the patches depend on the changes suggested > to --genkey, I made them part of the patch series. The other patches have > been updated to incoperate the feedback. > > Arne Schwabe (7): > Write key to stdout if filename is not given > Implement --genkey type keyfile syntax and migrate tls-crypt-v2 > Add pem_read_key_file variant that allows a random key > Rewrite auth-token-gen to be based on HMAC based tokens > Implement a permanent session id in auth-token > Sent indication that a session is expired to clients > Implement unit tests for auth-gen-token > > doc/openvpn.8 | 141 ++++++-- > src/openvpn/Makefile.am | 1 + > src/openvpn/auth_token.c | 387 +++++++++++++++++++++ > src/openvpn/auth_token.h | 129 +++++++ > src/openvpn/crypto.c | 35 +- > src/openvpn/crypto.h | 15 + > src/openvpn/init.c | 90 +++-- > src/openvpn/manage.c | 4 +- > src/openvpn/openvpn.h | 1 + > src/openvpn/options.c | 103 ++++-- > src/openvpn/options.h | 19 +- > src/openvpn/push.c | 70 +++- > src/openvpn/push.h | 8 + > src/openvpn/ssl.c | 13 +- > src/openvpn/ssl_common.h | 56 +-- > src/openvpn/ssl_verify.c | 213 ++++++------ > src/openvpn/ssl_verify.h | 15 +- > src/openvpn/tls_crypt.c | 13 +- > tests/unit_tests/openvpn/Makefile.am | 18 +- > tests/unit_tests/openvpn/test_auth_token.c | 375 ++++++++++++++++++++ > 20 files changed, 1457 insertions(+), 249 deletions(-) > create mode 100644 src/openvpn/auth_token.c > create mode 100644 src/openvpn/auth_token.h > create mode 100644 tests/unit_tests/openvpn/test_auth_token.c I've focused on functional testing in the beginning. And here's a summary so far of my feedback: * The --help screen is inaccurate in regards to --auth-gen-token and --genkey entries. * Using --genkey with --secret now sends the key to stdout instead of the given --secret file. I don't recall if we discussed this and if this was considered expected. * When starting a server with --auth-gen-token-secret, there is no (afaict) indications in the log file such a file is used * In the log file when the server sends PUSH_REPLY there's a formatting issue, where you will find: [...], auth-tokenSESS_ID,[....]. This happens on both server and client. * The configuration below ends up going into username/password auth loop on each renegotiation after the auth-token has expired: - server # ./src/openvpn/openvpn --dev tun --ca sample/sample-keys/ca.crt \ --cert sample/sample-keys/server.crt \ --key sample/sample-keys/server.key \ --dh sample/sample-keys/dh2048.pem \ --server 10.8.0.0 255.255.255.0 --verb 4 \ --script-security 3 \ --auth-user-pass-verify ./auth.sh via-env \ --auth-gen-token 60 external-auth \ --auth-gen-token-secret auth-token.key \ --reneg-sec 30 --tran-window 15 \ --hand-window 20 --keepalive 10 20 - client # ./src/openvpn/openvpn --dev tun --client --auth-user-pass \ --remote $REMOTE_IP \ --ca sample/sample-keys/ca.crt \ --key sample/sample-keys/client.key \ --cert sample/sample-keys/client.crt \ --verb 4 --explicit-exit-notify \ --auth-nocache - auth.sh script: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #!/bin/bash echo "----------------------------------------------------" echo "session_state: $session_state" echo "username: $username" echo "password: $password" echo "session_id: $session_id" ret=1 if [ "$session_state" = "Authenticated" ]; then ret=0; elif [ "$username" = "testuser" ]; then if [ "$password" = "foobaraaa" ]; then ret=0 fi fi if [ $ret -eq 0 ]; then echo "Authentication successful" else echo "Authentication failed" fi echo "----------------------------------------------------" exit $ret ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ What happens: - Server starts - Client starts and connects, auth with username/password (state: Initial) - 30 seconds, reneg happens - Client re-auth with token (state: Authenticated) - 30 seconds, reneg happens - Client re-auth with token (state: Expired) - 30 seconds, reneg happens - Client re-auth with token (state: Expired) - Client restarts with username/password auth (state: Initial) - 30 seconds, reneg happens - Client restarts with username/password auth (state: Initial) - 30 seconds, reneg happens - Client restarts with username/password auth (state: Initial) .... I'll run more tests and review patches too, but here's something to dive into at least.
> * The --help screen is inaccurate in regards to --auth-gen-token and --genkey > entries. > > * Using --genkey with --secret now sends the key to stdout instead of the > given --secret file. I don't recall if we discussed this and if this was > considered expected. These two will be fixed in a version of the --genkey patch. > > * When starting a server with --auth-gen-token-secret, there is no (afaict) > indications in the log file such a file is used No. But there is a warning when not using that file and an ephermal key. > > * In the log file when the server sends PUSH_REPLY there's a formatting issue, > where you will find: [...], auth-tokenSESS_ID,[....]. This happens on both > server and client. > > * The configuration below ends up going into username/password auth loop on > each renegotiation after the auth-token has expired: > What happens: > - Server starts > - Client starts and connects, auth with username/password (state: Initial) > - 30 seconds, reneg happens > - Client re-auth with token (state: Authenticated) > - 30 seconds, reneg happens > - Client re-auth with token (state: Expired) > - 30 seconds, reneg happens > - Client re-auth with token (state: Expired) > - Client restarts with username/password auth (state: Initial) Up to here that is more or less expected behaviour. (The renog failing and connnection continuing to work until renog timeout is reached, is wonky but will/should also happen with other auth methods) > - 30 seconds, reneg happens > - Client restarts with username/password auth (state: Initial) So here it looks like the client did not get a new auth-token or ingored it right? > - 30 seconds, reneg happens > - Client restarts with username/password auth (state: Initial) > .... > This might be a problem of auth-nocache on the client side doing strage things. I never had that on. Arne