From patchwork Wed May 10 11:22:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Lichtenheld X-Patchwork-Id: 13 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7300:7b9a:b0:c3:1364:a2a2 with SMTP id j26csp3536039dyk; Wed, 10 May 2023 04:23:53 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7Tm3ROPZOvNgR+UAPTykQ8LHYUt65rmvFkZCd42loQslI1eGtlr6zNfiyjCUab6iwieYve X-Received: by 2002:a92:d8c8:0:b0:331:3df2:56e3 with SMTP id l8-20020a92d8c8000000b003313df256e3mr13125550ilo.15.1683717833028; Wed, 10 May 2023 04:23:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683717833; cv=none; d=google.com; s=arc-20160816; b=CMZNZoku4FZSYTvTUabDHnQy8B/hTvKiBh0sxwjGX8KIyVOABOx2wCJz2MJnbn1QR+ Qj8IzsRxZ8dd2Rnjj0xlfIYs9wVbsw8zHsO+I1zyFNAHEIPF20qVjBzO8qzpLCIjJac2 1vvAObQXrRs1S43yRxj0C4IZ2sE4oX7U/RSECFjesuOZnW1COqxpz9THwexbvvRcOWgO v37EJNswCXDMbafPIcSh9Q9WGecaN/DEU9cck71J4XE5kprma+2Upxmi6DvFdJ2zpNc2 zOp4AwoVeKvTpkmUxlbLdbd+PuggzPrTkP0H5tU0kV9fk3UAqw8qGzrw/4N4yLTAdFrV kWwA== 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 :dkim-signature; bh=U+wMLV8YiqnPgM5Ls3q8IxAHXjRVaJ+5MiYPt+P2eUo=; b=Ol/bnId+gUgrcuNDJSqUsKGt/wOdMMkkAo6rJwnV9+wr/fP9HwzTL1rwOo3Np2NaTQ 3Rf1Qk7XkWZs253SKzn+ACU7u7z1ryK7bb6qufvXF+mbAtQJNwIMtAht9OkSE7w1Hed0 6v7MhlyvKegyYY2BmdGhc3Ps3QDmvS2JDnP707Uz1zW2ZPEPtwX5vrwWCBoFoMTUsF5t lonZEsvI2iQIPKNUti0Trio5TLerE2f5bZ3QlusccPOGH8/5bethz1xlb9be8h2DBsd9 ADA5QF4+DuU1G3gujNFjpKQmXW/4vzuYu2YSppGnawEVRrhYQlusvHDMnWFQHNyYvi2f ux+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b="Ma/eHnfF"; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=UvU0FjfA; dkim=neutral (body hash did not verify) header.i=@lichtenheld.com header.s=MBO0001 header.b=g71Em8a7; 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 d41-20020a023f29000000b004060f23e3b9si5639516jaa.34.2023.05.10.04.23.52 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 10 May 2023 04:23:53 -0700 (PDT) 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="Ma/eHnfF"; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=UvU0FjfA; dkim=neutral (body hash did not verify) header.i=@lichtenheld.com header.s=MBO0001 header.b=g71Em8a7; 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-3.v29.lw.sourceforge.com) by sfs-ml-3.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1pwhuH-0002QI-AB; Wed, 10 May 2023 11:22:53 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-3.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1pwhuD-0002Q3-TA for openvpn-devel@lists.sourceforge.net; Wed, 10 May 2023 11:22:50 +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=WInTQectQlpx+iW9LKxLr9cnl48Mb+aDQ1AsvXoMSHc=; b=Ma/eHnfF8AaeMbCe56jYjezig3 DViat7XeK3poJjULJMib6BLQZIfhjBwtnlTlIb/VxpMaYfBFYVKf3YOfU5O8mX3G9qMQI3BENhPq7 PEOo7eJuW4JeAU7BShrgbqGDTXN8den0lrcfp+FCQPzZWGsKABJN7VFuJWsDO8qf6Sl4=; 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=WInTQectQlpx+iW9LKxLr9cnl48Mb+aDQ1AsvXoMSHc=; b=U vU0FjfAcojCYcIGFpAjoXmIDBj6NLGb/3fkiBDYZqbRbf+ngfxgvufNfQIV4Z+RtZwareEOOcpzAh bNZZRLBzeZ10AeHp/EwNJmFjQrjdx0Vl7fd3x/1XeL6FSk/r59+0KgQ1jo0ToCLVvYPapfOpqDlVU UqXhM3YMBSENsQt0=; Received: from mout-p-103.mailbox.org ([80.241.56.161]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1pwhu9-0002MY-Ga for openvpn-devel@lists.sourceforge.net; Wed, 10 May 2023 11:22:50 +0000 Received: from smtp202.mailbox.org (smtp202.mailbox.org [IPv6:2001:67c:2050:b231:465::202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-103.mailbox.org (Postfix) with ESMTPS id 4QGXgc6Vk3z9sW2 for ; Wed, 10 May 2023 13:22:36 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lichtenheld.com; s=MBO0001; t=1683717756; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=WInTQectQlpx+iW9LKxLr9cnl48Mb+aDQ1AsvXoMSHc=; b=g71Em8a7x7eDu0MycGay3cXd+ayx+qgO93eCKBAIx7JWvYDcS7G30OsD9YHWJDoX9msy0U 0Zw/puw9NTY7ldzC5jBrF3ud/RZAKtkVeO+LN4mqi/6fZQ1wObWjzJgVL2B0yNFSBCUX1w QiaDGxFl/maYm6FvEfhyEFsCw3djcaIyuCYWiXMvpogItJjRDCLTDEzQxb4ms+8158j2Hn HrUuPbLG7bSFxa+Y8VPnrgP5ZhMsxHFhftnZNsAqReHLtndn0wL4AoMBDNyZ/VW2/etJFB YD79dd13K/wb0owUcu4hyO5LKfq1IEPDgyWSjMLrr8XzN1+XJLClBWiVRcPzJA== From: Frank Lichtenheld To: openvpn-devel@lists.sourceforge.net Date: Wed, 10 May 2023 13:22:33 +0200 Message-Id: <20230510112236.248026-1-frank@lichtenheld.com> MIME-Version: 1.0 X-Rspamd-Queue-Id: 4QGXgc6Vk3z9sW2 X-Spam-Score: -0.9 (/) 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: In the context of the CMake patchset Lev and I discussed lowering the warning level for the MSVC builds since there are so many conversion warnings they drown out everything else. So I actually tried what happens when you build with -Wconversion on Linux and whether it would be possible to resolve these issues. The short answer is: no, this is not possible with reasonable effor [...] Content analysis details: (-0.9 points, 6.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [80.241.56.161 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-Headers-End: 1pwhu9-0002MY-Ga Subject: [Openvpn-devel] [PATCH 0/3] Some misc -Wconversion fixes 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?1765506110515612446?= X-GMAIL-MSGID: =?utf-8?q?1765506110515612446?= In the context of the CMake patchset Lev and I discussed lowering the warning level for the MSVC builds since there are so many conversion warnings they drown out everything else. So I actually tried what happens when you build with -Wconversion on Linux and whether it would be possible to resolve these issues. The short answer is: no, this is not possible with reasonable effort. But while finding this out I at least fixed some of the issues. So here a small patchset that fell out of that. Can also be reviewed via https://gerrit.openvpn.net/ Frank Lichtenheld (3): Various fixes for -Wconversion errors Change type of frame.mss_fix to uint16_t mss/mtu: make all size calculations use size_t src/openvpn/buffer.c | 4 +- src/openvpn/crypto.c | 10 +++-- src/openvpn/integer.h | 15 ++++++-- src/openvpn/mss.c | 43 +++++++++++----------- src/openvpn/mss.h | 4 +- src/openvpn/mtu.c | 6 +-- src/openvpn/mtu.h | 2 +- src/openvpn/options.c | 1 + src/openvpn/otime.c | 2 +- src/openvpn/otime.h | 2 +- src/openvpn/packet_id.c | 4 +- src/openvpn/reliable.c | 7 ++-- src/openvpn/socket.h | 4 +- src/openvpn/tls_crypt.c | 2 +- src/openvpn/xkey_helper.c | 14 +++---- tests/unit_tests/openvpn/mock_get_random.c | 2 +- tests/unit_tests/openvpn/test_crypto.c | 6 +-- tests/unit_tests/openvpn/test_packet_id.c | 6 +-- tests/unit_tests/openvpn/test_provider.c | 2 +- tests/unit_tests/openvpn/test_tls_crypt.c | 2 +- 20 files changed, 74 insertions(+), 64 deletions(-)