From patchwork Sun Nov 16 21:54:27 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gert Doering X-Patchwork-Id: 4609 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7000:6d04:b0:7b1:439f:bdf with SMTP id e4csp2881122may; Sun, 16 Nov 2025 13:54:50 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCU2Q1ghLeNHaLMISXevfYCNsX/fso0ELpTEC9B0IEg8n7/LJo8kjLKefh7htl/AyvNrXvgZdZ2v1Ig=@openvpn.net X-Google-Smtp-Source: AGHT+IHNCS75p227cuEbeonXp+BBczISZjSANCuC9KMMAvcSowTmN2idDEwpIT7+h2IuwPuitq22 X-Received: by 2002:a05:6820:c8f:b0:656:9e05:31d4 with SMTP id 006d021491bc7-65733bdd46fmr4356247eaf.2.1763330090324; Sun, 16 Nov 2025 13:54:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1763330090; cv=none; d=google.com; s=arc-20240605; b=hh0FyZvCgs59Uc6ZO95X0Uetpz/Fs4FyQnvTFDUjrgHtWtrlfX4x8tLX6mAp/8Abmt CuQCvpTKbmR+uai2GN0Mj9ycM8jXsJRLfMa4UJVWdIuKwSCVp/Wyzmz1bJtIC2UCbCvP /lPKJ6QV8J6PbmsAvHxwuZM0zbM7An2yiUPdHoLmAdAf2hwgQ2TwxHb0j4HX/7uyi7yY RNBD5wR+CGyExnfRHV3jZcWT9HtZiyXBliWNGD6MQrFezkSUQ/9tAcBI0WqSmoXIF6kG IhKKaltxgtiSQe2+Lze4lvFh5ioVMWpRfnkxC3hD/PSjS0e+GkGok7EYY2t8nQ7+So20 RmMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=errors-to:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :mime-version:references:in-reply-to:message-id:date:to:from :dkim-signature:dkim-signature:dkim-signature; bh=MKJd7uN75cBijAQXbPmQEPCaa11psw3dew68lGi8NOg=; fh=4NbAC/LsuMLI0S0hprUlLSLCiHwg6SCAifhH718Jh0Q=; b=ScDlKVeLaiPyZXgQ1MhrZ0pIb42FbmERFMtSFt7ypc6s9QDUG+g7vmifyrCWUP6K7y x9utX0/M6n1ARSQrBXheT7HD5MbgvcXHpNJLjTHZMmR/+YIbSateger7yELzT6vVLWno MO3K0KRUCXs4QYJ5Tl5FzCvP+4SWp3g709B8Ghbxw5F7hiBnqKRNwicE9HGdbrDHiax4 2qmU618n4CiZWzB+EohtYGnoyBHCU7Udg/ksBXS2HBmOacrR9u3cV2+KLmpHCu1NOVlx 0t+cey0npHsXB41mfDU9Tg5JpbI7ELTfgI18eLnG/alQqM4y6n7njkxiOnXjnIAODH0T ZExw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.sourceforge.net header.s=beta header.b=g5AhtiGM; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=BVzVrZGf; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b="eY/1K5WG"; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=muc.de Received: from lists.sourceforge.net (lists.sourceforge.net. [216.105.38.7]) by mx.google.com with ESMTPS id 46e09a7af769-7c73a3d18desi4008445a34.445.2025.11.16.13.54.49 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 16 Nov 2025 13:54:50 -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=pass header.i=@lists.sourceforge.net header.s=beta header.b=g5AhtiGM; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=BVzVrZGf; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b="eY/1K5WG"; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=muc.de DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.sourceforge.net; s=beta; h=Content-Transfer-Encoding:Content-Type: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: Subject:MIME-Version:References:In-Reply-To:Message-ID:Date:To:From:Sender: Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=MKJd7uN75cBijAQXbPmQEPCaa11psw3dew68lGi8NOg=; b=g5AhtiGMZRl7hGkpR2UfRFyIIN quxAB+MFwRW2zCPtnrdcwpDgphrfuPttLYfQY1bSj1zomRlq4aZ/Fbdu0I3b1xV7qQ256hPrlP5Cq JQTVFTbytaz3tslo1LE9Nf9oJecRtVi2KICuX0AIda80hfRaPV/yrLtHmJYZMz6ltOPw=; 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.95) (envelope-from ) id 1vKkhr-0002W0-8w; Sun, 16 Nov 2025 21:54:48 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-2.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1vKkhp-0002Vn-W7 for openvpn-devel@lists.sourceforge.net; Sun, 16 Nov 2025 21:54:46 +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:References: In-Reply-To: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:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=+iQLHv7sQ97GfBG13eYgHUNfpw3VG/aw1ZHrb4D1ieE=; b=BVzVrZGfQJsd13XBW31u5Ali/W y62IqCgUOtckHb96oGEOMDqf7v3PVqcePsCFpQltoMjzv6qZrJVERYKE4iPjlQqsVJmfAkd59iI3V bPpmwx9omK/9HUME3kx4hHcU8BBc7eqAwL9A52Xe2gLaJpcMH4sgeNCb42Dpe6lV6lOA=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: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:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=+iQLHv7sQ97GfBG13eYgHUNfpw3VG/aw1ZHrb4D1ieE=; b=eY/1K5WGZ8jeZmDJpyhJuUjM5B pHx/O6hpLF6GMhZGBV2edkc/q5BCXvHIBV9RsfX7aevoJanOKDQSbj4PtoF3t94SN6g1E3PSb7xzv P378R4QTZJEduBZ4vSPjddCpYJM5nmGRsZD3Fk57Hoi2pakPtoaDjV648gWJaBC02cbs=; Received: from [193.149.48.134] (helo=blue.greenie.muc.de) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1vKkhp-0003Fi-Mb for openvpn-devel@lists.sourceforge.net; Sun, 16 Nov 2025 21:54:46 +0000 Received: from blue.greenie.muc.de (localhost [127.0.0.1]) by blue.greenie.muc.de (8.18.1/8.18.1) with ESMTP id 5AGLsXYM029278 for ; Sun, 16 Nov 2025 22:54:33 +0100 Received: (from gert@localhost) by blue.greenie.muc.de (8.18.1/8.18.1/Submit) id 5AGLsX6U029276 for openvpn-devel@lists.sourceforge.net; Sun, 16 Nov 2025 22:54:33 +0100 From: Gert Doering To: openvpn-devel@lists.sourceforge.net Date: Sun, 16 Nov 2025 22:54:27 +0100 Message-ID: <20251116215433.29257-1-gert@greenie.muc.de> X-Mailer: git-send-email 2.49.1 In-Reply-To: References: MIME-Version: 1.0 X-Spam-Score: 1.3 (+) X-Spam-Report: Spam detection software, running on the system "sfi-spamd-2.hosts.colo.sdot.me", 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: From: Frank Lichtenheld buf_read_u16 does not return uint16_t. Change-Id: Ie7ad637223c332f7611c09b20a8d7a3a92d97ec7 Signed-off-by: Frank Lichtenheld Acked-by: Gert Doering Gerrit URL: https://gerrit.openvpn.net/c/open [...] Content analysis details: (1.3 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 1.3 RDNS_NONE Delivered to internal network by a host with no rDNS X-Headers-End: 1vKkhp-0003Fi-Mb Subject: [Openvpn-devel] [PATCH v6] ssl: Clean up type handling in parse_early_negotiation_tlvs() 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?1848985612646922089?= X-GMAIL-MSGID: =?utf-8?q?1848985612646922089?= From: Frank Lichtenheld buf_read_u16 does not return uint16_t. Change-Id: Ie7ad637223c332f7611c09b20a8d7a3a92d97ec7 Signed-off-by: Frank Lichtenheld Acked-by: Gert Doering Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1302 --- This change was reviewed on Gerrit and approved by at least one developer. I request to merge it to master. Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1302 This mail reflects revision 6 of this Change. Acked-by according to Gerrit (reflected above): Gert Doering diff --git a/src/openvpn/ssl.c b/src/openvpn/ssl.c index 555f483..6f15ebe 100644 --- a/src/openvpn/ssl.c +++ b/src/openvpn/ssl.c @@ -2194,11 +2194,6 @@ } } -#if defined(__GNUC__) || defined(__clang__) -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wconversion" -#endif - /** * Handle reading key data, peer-info, username/password, OCC * from the TLS control channel (cleartext). @@ -2529,9 +2524,9 @@ goto error; } /* read type */ - uint16_t type = buf_read_u16(buf); - uint16_t len = buf_read_u16(buf); - if (buf_len(buf) < len) + int type = buf_read_u16(buf); + int len = buf_read_u16(buf); + if (type < 0 || len < 0 || buf_len(buf) < len) { goto error; } @@ -2543,7 +2538,7 @@ { goto error; } - uint16_t flags = buf_read_u16(buf); + int flags = buf_read_u16(buf); if (flags & EARLY_NEG_FLAG_RESEND_WKC) { @@ -3971,10 +3966,6 @@ } } -#if defined(__GNUC__) || defined(__clang__) -#pragma GCC diagnostic pop -#endif - void tls_prepend_opcode_v1(const struct tls_multi *multi, struct buffer *buf) {