From patchwork Fri May 10 02:11:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arne Schwabe X-Patchwork-Id: 732 Return-Path: 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 ; 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 ) (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 ) 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 ) 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 ) 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 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: 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 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