From patchwork Sun Nov 16 18:33:30 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gert Doering X-Patchwork-Id: 4607 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7000:6d04:b0:7b1:439f:bdf with SMTP id e4csp2810923may; Sun, 16 Nov 2025 10:33:52 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWcf+i2o1oyLtXUQ4wHvpYGeSp5VGI+fWr1lD+2QIhXtBUf64KMc7Jndv3EoRGJa68ZWxVwR669u2I=@openvpn.net X-Google-Smtp-Source: AGHT+IGrJbcg275vgV/ZOc+UYyd4Ps2nzCUJCcXbp0lDg5R44f9KJGlB+vYwg2lEBlGoSSQMQ7fn X-Received: by 2002:a05:6830:439f:b0:758:1e20:c41b with SMTP id 46e09a7af769-7c744592dc5mr6821301a34.33.1763318032663; Sun, 16 Nov 2025 10:33:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1763318032; cv=none; d=google.com; s=arc-20240605; b=S/bEjg7yBvRrZsDV5CBfQf+M0ovrjjXtYefHKH2NtcNoTxlXuQn38RZ2/xJ/ec6Pht drjOSShbswIb04q97Se2/mbmcen35RxVIorU1NbalDJItiqHfAWQhpwgKKjVyqmAEmLD GhdPv1YAdEVdugSloY8qgWH6h1N0Ib5QiytEkyOT7N0L//VEekhoaUlUZUVjdvFY9feJ RoF/msG2Or+JLc11lNF0uvIuv+AUpr6P4K47XE138+ZpZIyys4/mC6Z5DYJ5Q1e8J3h8 yE/fikZnrcxbs9doxaTu64dG3r0u7cT3dJsx1GhqfzsU4SQc/k1kMYtMetJmdTWD+Ioj yx2Q== 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=Dp3CbvPAPe+S4yT4DZTZNx2JHXK9mCIA0e0nE0Pk2sI=; fh=4NbAC/LsuMLI0S0hprUlLSLCiHwg6SCAifhH718Jh0Q=; b=L18vg3MqABzdGcWs4mIhNodTXqCWsMgplgm6KHMCxYXDmcA7kP2jGGX2PbO+D+1ZYR DSVMiCcfbSN4xGpIUCl+F/p0+6sghYTejsDER0+3aVs6SxgIFBYxHaO0IMRSOt0rBN8Y QaLqLa5EuzKEBX6iaZ7CeKhMYIYsfYt7GtfX4JHBHBH2oc7hhdFIGR7Zvc6ldB3yvHHW u/ZLx721JhAZKnFSighsFZuYeeys7t1iyn3E3r5mp5YWhelQiPfq8jBvkLUMr86gwd0v SDFUkA/Gfinc4VNqV5liFsy/AVc3JfzqhyHFMQcKlrdb8lmQxcDOYdtetHmEH+Q0w190 6X9g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.sourceforge.net header.s=beta header.b=kYx21g2a; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=BMcjHBvc; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=Q8GgfrET; 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-7c73a38bdcasi3501130a34.207.2025.11.16.10.33.52 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 16 Nov 2025 10:33:52 -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=kYx21g2a; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=BMcjHBvc; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=Q8GgfrET; 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=Dp3CbvPAPe+S4yT4DZTZNx2JHXK9mCIA0e0nE0Pk2sI=; b=kYx21g2aVaAQcBnfQajtPLHpT/ YLKQXRifrPpES9Hh2JXJyFTwmMcr50IPz+raGAZ7S6PiFJx0a2Kv/myjWrliDhGiQHfo4Ig2dgoli KrZwxFAByZHU3svXn0kRgqU3bwWMLDiCrJxBLC6d7aGZOPxaGZnhY7ZCoAXZi52oF1ZQ=; 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 1vKhZN-0002zC-Pv; Sun, 16 Nov 2025 18:33:50 +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 1vKhZM-0002z4-PH for openvpn-devel@lists.sourceforge.net; Sun, 16 Nov 2025 18:33:49 +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=jeMSx8DL1KemRDaLka7AnhEYYDYjnmGA5omk5Ydjf1o=; b=BMcjHBvc4y2x0sLnkCz2Wn5rEj wdgPbEG+jtCLpLl4Yr2GCbG5J/Ia2GjkNPy67T41lNDcpX70BrZVpkDTdIS5l2xFK+iXnZT+n3y5a mfvS0PTWU8FpY/N1zP7GaVJ5SI/6jMdATnoOWWdUSKwozZG6mGEPtkKdEzlyGrHqyCz4=; 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=jeMSx8DL1KemRDaLka7AnhEYYDYjnmGA5omk5Ydjf1o=; b=Q8GgfrETv6qE768sOVWJBMIgQx w3AAP5KCl5tR/RWX14ssHbv531csVkhtitAqN3etkHJNDMoLfNKftvVzppAz8yMZelDlMHzJspxbk aQJYeHPs3yP7KGVukTS1HgCL1N07+5FR72/oZx1hENU09P+JtGTZeN/PbRuHiawISyoE=; 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 1vKhZM-0006rN-QW for openvpn-devel@lists.sourceforge.net; Sun, 16 Nov 2025 18:33:49 +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 5AGIXbe7011464 for ; Sun, 16 Nov 2025 19:33:37 +0100 Received: (from gert@localhost) by blue.greenie.muc.de (8.18.1/8.18.1/Submit) id 5AGIXbcE011463 for openvpn-devel@lists.sourceforge.net; Sun, 16 Nov 2025 19:33:37 +0100 From: Gert Doering To: openvpn-devel@lists.sourceforge.net Date: Sun, 16 Nov 2025 19:33:30 +0100 Message-ID: <20251116183336.11447-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 Document assumption with ASSERT. Change-Id: I34584f695ddca3b3e1f2bbcb4380ac91b09c1c8d 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: 1vKhZM-0006rN-QW Subject: [Openvpn-devel] [PATCH v4] ssl: Fix conversion warning in tls_prepend_opcode_v1 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?1848972969218623009?= X-GMAIL-MSGID: =?utf-8?q?1848972969218623009?= From: Frank Lichtenheld Document assumption with ASSERT. Change-Id: I34584f695ddca3b3e1f2bbcb4380ac91b09c1c8d Signed-off-by: Frank Lichtenheld Acked-by: Gert Doering Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1298 --- 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/+/1298 This mail reflects revision 4 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 eb5c4fc..7b93ebc 100644 --- a/src/openvpn/ssl.c +++ b/src/openvpn/ssl.c @@ -3970,24 +3970,24 @@ } } +#if defined(__GNUC__) || defined(__clang__) +#pragma GCC diagnostic pop +#endif + void tls_prepend_opcode_v1(const struct tls_multi *multi, struct buffer *buf) { struct key_state *ks = multi->save_ks; - uint8_t op; msg(D_TLS_DEBUG, __func__); ASSERT(ks); + ASSERT(ks->key_id <= P_KEY_ID_MASK); - op = (P_DATA_V1 << P_OPCODE_SHIFT) | ks->key_id; + uint8_t op = (P_DATA_V1 << P_OPCODE_SHIFT) | (uint8_t)ks->key_id; ASSERT(buf_write_prepend(buf, &op, 1)); } -#if defined(__GNUC__) || defined(__clang__) -#pragma GCC diagnostic pop -#endif - void tls_prepend_opcode_v2(const struct tls_multi *multi, struct buffer *buf) {