From patchwork Sun Nov 16 18:36:15 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gert Doering X-Patchwork-Id: 4608 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7000:6d04:b0:7b1:439f:bdf with SMTP id e4csp2812001may; Sun, 16 Nov 2025 10:36:40 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCU9M8ijFQk4TIivny40KnzlNZT7yIxuKTNPgpCwdJ3g6a85imOgdy7lFQ0MfEbZ2GOFfJX9oF+ZxbM=@openvpn.net X-Google-Smtp-Source: AGHT+IEXHL1IpGWvAch8wqVFjRCn0yEuBDHaWaLCIFDSxc/V/SHXRKVjCq6G57dG1o8W2/OYSUhH X-Received: by 2002:a05:6808:150e:b0:44f:e83b:98bd with SMTP id 5614622812f47-4509741b06emr4789636b6e.2.1763318199760; Sun, 16 Nov 2025 10:36:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1763318199; cv=none; d=google.com; s=arc-20240605; b=LdQdLs/8mWtDEvUtVwUNohpfJuksNbZooLtZfXNP42psf8PEnIu8H7rm1mBTP1xzWx rBX6FTQzRZDFmd9xh+pQLwjV8AwpmotVvBjRDQhNHJri0VDJQh4I/rbKwwuRQnveqvfE RetUJq7wnPBT+JCKXyWE3fAGFP8JKmi+majSU3BnlCIVO+BN/ytuEY1ntbx4nbBKRoJm 43HAXYIScq3M4LwKH6RNSkwDdkgVpM9TSYFJwRW1Imf+p1cekQFVnY2QS0k8l7vT02dr e4hpXjWx0hIvSgb9fhSdks/2dAIQe1Gf9ctG6BvYH+lhtIuL7VjBnJiPbGW+y2aRUTiw PJBg== 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=34z2924GJiUePqnwsQU8w5DM17Kom4uGFMqOiweO/6E=; fh=4NbAC/LsuMLI0S0hprUlLSLCiHwg6SCAifhH718Jh0Q=; b=GwzyXsZZYMDaQChALfDBMi70m0n1wd3sQHI0rvUHsNcWLADkPxR6xEdnSpZWMRpAfq uO/z7DfjyuFn0Xdy3jYLYzoqRz908n8bRIV0FeJvwdFUJdPjegXI95swBdw4CVOKOtiZ JIicYbhF25pgMq19ZRls5PLIgRP82FOOn+mH8MpNzjl9aRj2ny3Z3PyP+n+pDYjsVw4M i+jzsolP7gC0sepKLYKUYmqekSApPHWfSJo1dYefTjLM2+EWXx3oi0vjRfzlYnRVBf0t xPvsKnSZ1HzHntWwbW9gpI/WmvJrCPoamgF6gvY+m/D6Jd+Dr3G6spE5K8qoEY+qgQU2 fD3A==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.sourceforge.net header.s=beta header.b=bo9BcaVh; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b="ENp/jHn1"; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=LL4zdanr; 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 006d021491bc7-65731befb1bsi2712072eaf.149.2025.11.16.10.36.39 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 16 Nov 2025 10:36:39 -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=bo9BcaVh; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b="ENp/jHn1"; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=LL4zdanr; 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=34z2924GJiUePqnwsQU8w5DM17Kom4uGFMqOiweO/6E=; b=bo9BcaVhD+CINTEbAaNuLHWB8/ IAnhaGkCRkMNWxB6SEbwC0dN50wnbliVYRHB3aqY6rArBKbJTi0gOPGaReMYra+fLFuGjZjIJuYRz YrCFdiwXfWfGZIiMw2HKeeLdLAX8ZkU7/I7c3CjPlv8JenQQg5lVk4UDm8i+DPkhtJ7M=; 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 1vKhc4-00035m-Qj; Sun, 16 Nov 2025 18:36:37 +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 1vKhc2-00035e-Kk for openvpn-devel@lists.sourceforge.net; Sun, 16 Nov 2025 18:36:35 +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=CRdHJ7AJPu2MDgNK+MbiWMUhXZ87VR8m/zn+4Ku2ymo=; b=ENp/jHn14jIThKfhcS2CSBaiUM msJs30pCbCjO8qJuAmIVe7kBc/7RTCd4WxyxcHIcJu8YuZ7yYDKD+5yjyKkz9pBXtatB+yhszDJEb FFQUWTNrY0Eda/LkuBpFtWOprjggs5fpN+f9DnVTL1RTtt0ofWExke+nm89Eeey5/tQM=; 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=CRdHJ7AJPu2MDgNK+MbiWMUhXZ87VR8m/zn+4Ku2ymo=; b=LL4zdanrS7c/dJAhY8J+ExyS3h ssSitPVK13IESRJXoz7YWbFNMFbZzlqbFs/0DTxMOuhExuePAZsdr/3GkW5wk3JMugEZBkNLBvxtL D/UP9dNsF4T0/fF2FC4OjDdCyj+tOuKWlz+SPPNvZBTDX5RtXuALAjIbVybb4WvPrmfg=; 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 1vKhc2-000765-D2 for openvpn-devel@lists.sourceforge.net; Sun, 16 Nov 2025 18:36:35 +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 5AGIaMh0011747 for ; Sun, 16 Nov 2025 19:36:22 +0100 Received: (from gert@localhost) by blue.greenie.muc.de (8.18.1/8.18.1/Submit) id 5AGIaM3p011746 for openvpn-devel@lists.sourceforge.net; Sun, 16 Nov 2025 19:36:22 +0100 From: Gert Doering To: openvpn-devel@lists.sourceforge.net Date: Sun, 16 Nov 2025 19:36:15 +0100 Message-ID: <20251116183622.11727-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 Since we usually input a diff of two time_t values here the input value will be officially time_t. So avoid conversion warnings at almost every caller site. 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: 1vKhc2-000765-D2 Subject: [Openvpn-devel] [PATCH v5] ssl: Change update argument of compute_earliest_wakeup to time_t 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?1848973144513179988?= X-GMAIL-MSGID: =?utf-8?q?1848973144513179988?= From: Frank Lichtenheld Since we usually input a diff of two time_t values here the input value will be officially time_t. So avoid conversion warnings at almost every caller site. We can safely cast it to interval_t here because we checked that it is smaller than the interval_t value earliest. And all negative values are treated equal, so exact value doesn't matter. Change-Id: I6bc3147d10ca50291110335cd9fc3be961280c1b Signed-off-by: Frank Lichtenheld Acked-by: Gert Doering Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1299 --- 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/+/1299 This mail reflects revision 5 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 7b93ebc..355ab46 100644 --- a/src/openvpn/ssl.c +++ b/src/openvpn/ssl.c @@ -1107,11 +1107,11 @@ * called again. */ static inline void -compute_earliest_wakeup(interval_t *earliest, interval_t seconds_from_now) +compute_earliest_wakeup(interval_t *earliest, time_t seconds_from_now) { if (seconds_from_now < *earliest) { - *earliest = seconds_from_now; + *earliest = (interval_t)seconds_from_now; } if (*earliest < 0) { @@ -1119,11 +1119,6 @@ } } -#if defined(__GNUC__) || defined(__clang__) -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wconversion" -#endif - /* * Return true if "lame duck" or retiring key has expired and can * no longer be used. @@ -1338,7 +1333,7 @@ /* For now we hardcode this to be 16 for the software based data channel * DCO based implementations/HW implementation might adjust this number * based on their expected speed */ - const int future_key_count = 16; + const uint8_t future_key_count = 16; int key_direction = server ? KEY_DIRECTION_INVERSE : KEY_DIRECTION_NORMAL; struct key_direction_state kds; @@ -1785,6 +1780,11 @@ return true; } +#if defined(__GNUC__) || defined(__clang__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + static bool write_string(struct buffer *buf, const char *str, const int maxlen) {