From: "flichtenheld (Code Review)" Date: Thu, 20 Nov 2025 14:52:16 +0000 References: Reply-To: frank@...2641..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net Message-ID: <9edf72f5a2e5955433adf63af396bc2f1a66b986-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="1AhGs/gMCgE="; charset=UTF-8 Subject: [Openvpn-devel] [XS] Change in openvpn[master]: tls_crypt: Fix Coverity complaint in tls_crypt_v2_check_client_key_age List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: plaisthos Cc: openvpn-devel --1AhGs/gMCgE= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Attention is currently required from: plaisthos. Hello plaisthos, I'd like you to do a code review. Please visit http://gerrit.openvpn.net/c/openvpn/+/1385?usp=3Demail to review the following change. Change subject: tls_crypt: Fix Coverity complaint in tls_crypt_v2_check_cli= ent_key_age ...................................................................... tls_crypt: Fix Coverity complaint in tls_crypt_v2_check_client_key_age Coverity complained about "overflow_before_widen" because there is a theoretical overflow that can happen even though the target value is wide enough. For useful values of max_days this is irrelevant but Coverity is not wrong, so change the code accordingly. Change-Id: Ie7308d549182a95b86cd113e4a8cc65ff45ba3d7 Signed-off-by: Frank Lichtenheld --- M src/openvpn/tls_crypt.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/85/1385/1 diff --git a/src/openvpn/tls_crypt.c b/src/openvpn/tls_crypt.c index 318c939..9026cff 100644 --- a/src/openvpn/tls_crypt.c +++ b/src/openvpn/tls_crypt.c @@ -539,7 +539,7 @@ int64_t timestamp; memcpy(×tamp, metadata + 1, sizeof(int64_t)); timestamp =3D (int64_t)ntohll((uint64_t)timestamp); - int64_t max_age_in_seconds =3D max_days * 24 * 60 * 60; + int64_t max_age_in_seconds =3D (int64_t)max_days * 24 * 60 * 60; if (now - timestamp > max_age_in_seconds) { msg(M_WARN, "ERROR: Client key is too old."); -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/1385?usp=3Demail To unsubscribe, or for help writing mail filters, visit http://gerrit.openv= pn.net/settings?usp=3Demail Gerrit-MessageType: newchange Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: Ie7308d549182a95b86cd113e4a8cc65ff45ba3d7 Gerrit-Change-Number: 1385 Gerrit-PatchSet: 1 Gerrit-Owner: flichtenheld Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel Gerrit-Attention: plaisthos --1AhGs/gMCgE= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Attention is cur= rently required from: plaisthos.

flichtenheld would like plaisthos to review this change.

V= iew Change

tls_crypt: Fix Coverity complaint in tls_cr=
ypt_v2_check_client_key_age

Coverity complained about "overflow= _before_widen" because
there is a theoretical overflow that can hap= pen even though
the target value is wide enough. For useful values of ma= x_days
this is irrelevant but Coverity is not wrong, so change the
co= de accordingly.

Change-Id: Ie7308d549182a95b86cd113e4a8cc65ff45ba3d7=
Signed-off-by: Frank Lichtenheld <frank@...2641...>
---
M s= rc/openvpn/tls_crypt.c
1 file changed, 1 insertion(+), 1 deletion(-)
=
git pull ssh://gerrit.openvpn.net:29418/openvpn ref=
s/changes/85/1385/1
diff --git a/src/openvpn/tls_crypt.c b/src/open=
vpn/tls_crypt.c
index 318c939..9026cff 100644
--- a/src/openvpn/tls_crypt.c
+++ b/src/openvpn/tls_cryp= t.c
@@ -539,7 +539,7 @@
int64_t timest= amp;
memcpy(&timestamp, metadata + 1, sizeof(int64= _t));
timestamp =3D (int64_t)ntohll((uint64_t)timestam= p);
- int64_t max_ag= e_in_seconds =3D max_days * 24 * 60 * 60;
+ int64_t max_age_in_seconds =3D (int64_t)max_days = * 24 * 60 * 60;
if (now - timestamp > max_age_in_se= conds)
{
msg(M_WARN, "ER= ROR: Client key is too old.");

To = view, visit change 1385. To unsubscribe, or for help writing mail filters, visi= t settings.<= /p>

Gerrit-MessageType: newchange
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ie7308d549182a95b86cd113e4a8= cc65ff45ba3d7
Gerrit-Change-Number: 1385
Gerrit-PatchSet: 1
Gerrit-Owner: flichtenheld <frank@...2723...= .>
Gerrit-Reviewer: plaisthos <arne-openvpn@...1186...= .1227...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
Gerrit-Attention: plaisthos <arne-openvpn@...220...= ..1227...>
= --1AhGs/gMCgE=--