From patchwork Sun May 10 04:00:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antonio Quartulli X-Patchwork-Id: 1109 Return-Path: Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director7.mail.ord1d.rsapps.net ([172.27.255.53]) by backend30.mail.ord1d.rsapps.net with LMTP id ID3zEzcJuF4PIgAAIUCqbw for ; Sun, 10 May 2020 10:01:27 -0400 Received: from proxy12.mail.iad3a.rsapps.net ([172.27.255.53]) by director7.mail.ord1d.rsapps.net with LMTP id GI7VEDcJuF6zYgAAovjBpQ ; Sun, 10 May 2020 10:01:27 -0400 Received: from smtp3.gate.iad3a ([172.27.255.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy12.mail.iad3a.rsapps.net with LMTP id uN0eCjcJuF6zPwAAh9K5Vw ; Sun, 10 May 2020 10:01:27 -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: smtp3.gate.iad3a.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=unstable.cc X-Suspicious-Flag: YES X-Classification-ID: bcf95680-92c6-11ea-b5ae-525400af4d07-1-1 Received: from [216.105.38.7] ([216.105.38.7:46574] helo=lists.sourceforge.net) by smtp3.gate.iad3a.rsapps.net (envelope-from ) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id 27/1F-19635-63908BE5; Sun, 10 May 2020 10:01:26 -0400 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 1jXmVe-0001fT-4Z; Sun, 10 May 2020 14:00:50 +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 1jXmVc-0001fM-P7 for openvpn-devel@lists.sourceforge.net; Sun, 10 May 2020 14:00:48 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Transfer-Encoding:MIME-Version:Message-Id: Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type: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=o0lRHO49fImBnHWOoMruYQDtwheAknmzCLVgxAwrvzA=; b=fWIfWh1NCUCOIVa7AdbL7JPJzn HGdda9MQzXQOM/ZGsQglzzp/ae4pRxaStT7c6t87tK68g2fQc4TfLPTCw8z5aOzpyucwtOuX+5+Ad w4o+wNqDSDvBIbiuiv/HBTvaUALEP6XP4lrCuonUU23uLg3UCRd2cYQx5PvCqj1SBxk8=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:MIME-Version:Message-Id:Date:Subject:Cc:To:From :Sender:Reply-To:Content-Type: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=o0lRHO49fImBnHWOoMruYQDtwheAknmzCLVgxAwrvzA=; b=A og8a+0nXAJkx3K/+Lmg8C9ZcMdJXSqLsDG9Slhs9uX7dCxVkYDZ0pniDLlpkySjl9fFUt8UJFy+pr oMgMSPP36R0zzVZJkG61fE+bL8DynvzfRbPan2SzWayAQ3uvs9JwPZsUtjjxPDgyu961shBtqdlP2 TSVlt/GcIpH5DPaY=; Received: from s2.neomailbox.net ([5.148.176.60]) by sfi-mx-1.v28.lw.sourceforge.com with esmtps (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.2) id 1jXmVa-006uSG-FU for openvpn-devel@lists.sourceforge.net; Sun, 10 May 2020 14:00:48 +0000 From: Antonio Quartulli To: openvpn-devel@lists.sourceforge.net Date: Sun, 10 May 2020 16:00:17 +0200 Message-Id: <20200510140017.16837-1-a@unstable.cc> MIME-Version: 1.0 X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.1 AWL AWL: Adjusted score from AWL reputation of From: address X-Headers-End: 1jXmVa-006uSG-FU Subject: [Openvpn-devel] [PATCH] tls-crypt-v2: fix testing of inline key 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: , Cc: Antonio Quartulli Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox The inline logic was recently changed by commit ("convert *_inline attributes to bool"), however the code testing a newly created tls-crypt-v2 client key was not adapted. Adapt tls-crypt-v2 test routine by properly signaling when the passed key is inlined or not. Signed-off-by: Antonio Quartulli Acked-by: David Sommerseth --- src/openvpn/tls_crypt.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/openvpn/tls_crypt.c b/src/openvpn/tls_crypt.c index 484d4d46..a3894d66 100644 --- a/src/openvpn/tls_crypt.c +++ b/src/openvpn/tls_crypt.c @@ -697,14 +697,14 @@ tls_crypt_v2_write_client_key_file(const char *filename, goto cleanup; } - const char *client_filename = filename; - const char *client_inline = NULL; + const char *client_file = filename; + bool client_inline = false; if (!filename || streq(filename, "")) { printf("%s\n", BPTR(&client_key_pem)); - client_filename = INLINE_FILE_TAG; - client_inline = (const char *)BPTR(&client_key_pem); + client_file = (const char *)BPTR(&client_key_pem); + client_inline = true; } else if (!buffer_write_file(filename, &client_key_pem)) { @@ -717,7 +717,7 @@ tls_crypt_v2_write_client_key_file(const char *filename, struct buffer test_wrapped_client_key; msg(D_GENKEY, "Testing client-side key loading..."); tls_crypt_v2_init_client_key(&test_client_key, &test_wrapped_client_key, - client_filename, client_inline); + client_file, client_inline); free_key_ctx_bi(&test_client_key); /* Sanity check: unwrap and load client key (as "server") */