From patchwork Thu Mar 9 12:00:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arne Schwabe X-Patchwork-Id: 3115 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7300:2310:b0:9f:bfa4:120f with SMTP id r16csp304003dye; Thu, 9 Mar 2023 04:02:06 -0800 (PST) X-Google-Smtp-Source: AK7set+TWcKEhW3A77ovb1GHEnlR/r+SLDJbheUfg4dWzZHPD3YjdyGJpUeLq0thVejZQc2Wx3Lc X-Received: by 2002:a17:903:2347:b0:19a:9859:be26 with SMTP id c7-20020a170903234700b0019a9859be26mr27637137plh.22.1678363326097; Thu, 09 Mar 2023 04:02:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678363326; cv=none; d=google.com; s=arc-20160816; b=OFRWmHCHvzRcOZW0WSCQSXq1U4rd7AjQlxTjhEt9TZKdQsDn9gIG9kopENW2nHGSo6 5gcFSetsknO6/EyJaiLynZJX7imR1Pj81GwflyP29pNDYy01hB78NkFtWpVQ8fw+EAAQ yZpt1rn/Fog49lXpT14wFtNEjoQZw3rfO0PNhN8gl/LSgk7OaZR2kXXdiEmCDK4VCbDf zRx9BAWKDtBvIH6/Wox54I45tRqU3oREatTdKjPHIcVJ647xxZffK5DgIoCBhlANbqi0 d9RZ6KMYbeKAKCmjc6BATUUFDaAAPzj+4ob8KIZV1QHVjk9YNgGSWEeMzTJfh+0N0Pr5 sRWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :mime-version:message-id:date:to:from:dkim-signature:dkim-signature; bh=LM0D0Ns9Qw7llUZ+aoUpEfPQLzvVwi4OT7jr3y9MCp0=; b=raMX0DQLDuG6MEswBnrHPq7QvXcnt4r5oBgxelO1bjxVSZ3/bXLztrBWhIA0OeXaaC xVl3AmUjcPIeYNW+cV/L3wyOsqI7LEs9J1d4Flmr87dwh8N1SQBsoopU8qgGYv51J2Ys gAAW36YCNEd0dGT6QlQZTrJazGShF2++8BxqI3CeUYXjSzOMVJO8FnNTzK86IKTX2xxd LG3VpXQxZSND6QZsbABhvm2AYNAsPdcvtseDXdgt6Ek4BSdu7FeLsPHb0827RtEN62re AVBZPaipgTTk/PdKJ0FZikF9ZICc6Xzco0hGVQn2vrFceToz5HPZ55oJs5FQZ0mFG411 BP8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=ZWptmpxF; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=Pul4YKMO; spf=pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net Received: from lists.sourceforge.net (lists.sourceforge.net. [216.105.38.7]) by mx.google.com with ESMTPS id n8-20020a17090ac68800b002340e454213si1946080pjt.190.2023.03.09.04.02.05 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Mar 2023 04:02:06 -0800 (PST) Received-SPF: pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) client-ip=216.105.38.7; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=ZWptmpxF; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=Pul4YKMO; spf=pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net Received: from [127.0.0.1] (helo=sfs-ml-4.v29.lw.sourceforge.com) by sfs-ml-4.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1paExS-0007km-77; Thu, 09 Mar 2023 12:01:23 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-4.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1paExG-0007kf-6O for openvpn-devel@lists.sourceforge.net; Thu, 09 Mar 2023 12:01:07 +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:To:From:Sender:Reply-To:Cc: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=TowAc3do/8wWzriR0L8Xu8pldP4udPh94dEdVd2KSTc=; b=ZWptmpxF7C7U22wKtny2ti8tbl CITxRKo+bid8EHgdtXFYcaq54KRVV9zuyK06NcAdWzgjcTVGtuQwqhff1+AK3gefOam16ZWEnp8vP kk4mDPqd5RX5AxRe/iT4ZXsv13M37GoNbAqEnZ6ewP+H09XFetqe1L9LhiI78IJQt+6I=; 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:To:From: Sender:Reply-To:Cc: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=TowAc3do/8wWzriR0L8Xu8pldP4udPh94dEdVd2KSTc=; b=P ul4YKMOl2PzKudX1kbB11qOuqDBxvbjdXAUH135s+A1euwJZnQipsfl+Jnc7JgPQreIOITYFBG8d4 hPMw3Vxa5KdBX1LOPcA5qPl213xX1Kweq8+zI9Fs4jbKb2hMk85UHeu8PMeG0kHtk2k1HeIrJnqQL DzMMF3HBviJ6yw6Y=; Received: from [192.26.174.232] (helo=mail.blinkt.de) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1paEwy-0004to-Ht for openvpn-devel@lists.sourceforge.net; Thu, 09 Mar 2023 12:00:55 +0000 Received: from kamera.blinkt.de ([2001:638:502:390:20c:29ff:fec8:535c]) by mail.blinkt.de with smtp (Exim 4.95 (FreeBSD)) (envelope-from ) id 1paEwh-000OWw-6J for openvpn-devel@lists.sourceforge.net; Thu, 09 Mar 2023 13:00:31 +0100 Received: (nullmailer pid 3780180 invoked by uid 10006); Thu, 09 Mar 2023 12:00:31 -0000 From: Arne Schwabe To: openvpn-devel@lists.sourceforge.net Date: Thu, 9 Mar 2023 13:00:31 +0100 Message-Id: <20230309120031.3780130-1-arne@rfc2549.org> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Spam-Score: 1.5 (+) X-Spam-Report: Spam detection software, running on the system "util-spamd-1.v13.lw.sourceforge.com", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: The ASSERT in xor_key2 assumes that all methods that load a key2 struct correctly set n=2. However, tls_crypt_v2_unwrap_client_key loads a key without setting n = 2, trigerring the assert. Closes and reported in https://github.com/OpenVPN/openvpn/issues/272 Content analysis details: (1.5 points, 6.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.2 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level mail domains are different 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 SPF_NONE SPF: sender does not publish an SPF Record 1.3 RDNS_NONE Delivered to internal network by a host with no rDNS X-Headers-End: 1paEwy-0004to-Ht Subject: [Openvpn-devel] [PATCH] Ensure n = 2 is set in key2 structer in tls_crypt_v2_unwrap_client_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: , Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox X-GMAIL-THRID: =?utf-8?q?1759891502980114536?= X-GMAIL-MSGID: =?utf-8?q?1759891502980114536?= The ASSERT in xor_key2 assumes that all methods that load a key2 struct correctly set n=2. However, tls_crypt_v2_unwrap_client_key loads a key without setting n = 2, trigerring the assert. Closes and reported in https://github.com/OpenVPN/openvpn/issues/272 Change-Id: Iaeb163d83b95818e0b26faf9d25e7737dc8ecb23 Signed-off-by: Arne Schwabe Acked-by: Antonio Quartulli --- src/openvpn/tls_crypt.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/openvpn/tls_crypt.c b/src/openvpn/tls_crypt.c index 8882d5de0..4f22f8af7 100644 --- a/src/openvpn/tls_crypt.c +++ b/src/openvpn/tls_crypt.c @@ -533,6 +533,7 @@ tls_crypt_v2_unwrap_client_key(struct key2 *client_key, struct buffer *metadata, } memcpy(&client_key->keys, BPTR(&plaintext), sizeof(client_key->keys)); ASSERT(buf_advance(&plaintext, sizeof(client_key->keys))); + client_key->n = 2; if (!buf_copy(metadata, &plaintext)) {