From: "cron2 (Code Review)" Date: Sat, 22 Nov 2025 17:39:04 +0000 In-Reply-To: References: Reply-To: gert@...1296..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, frank@...2641... Message-ID: <7f612e57b913c085574753161bb649e0b76a3e4e-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="jlfMtIG/vbY="; 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: flichtenheld Cc: plaisthos , openvpn-devel --jlfMtIG/vbY= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable cron2 has submitted this change. ( http://gerrit.openvpn.net/c/openvpn/+/13= 85?usp=3Demail ) 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 Acked-by: Gert Doering Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1385 Message-Id: <20251122162553.12254-1-gert@...1296...> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg34= 585.html Signed-off-by: Gert Doering --- M src/openvpn/tls_crypt.c 1 file changed, 1 insertion(+), 1 deletion(-) 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: merged Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: Ie7308d549182a95b86cd113e4a8cc65ff45ba3d7 Gerrit-Change-Number: 1385 Gerrit-PatchSet: 2 Gerrit-Owner: flichtenheld Gerrit-Reviewer: cron2 Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel --jlfMtIG/vbY= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

cron2 sub= mitted this change.

View Change

tls_crypt: Fix Coverity complaint in tls_crypt_v=
2_check_client_key_age

Coverity complained about "overflow_befo= re_widen" because
there is a theoretical overflow that can happen e= ven though
the target value is wide enough. For useful values of max_day= s
this is irrelevant but Coverity is not wrong, so change the
code ac= cordingly.

Change-Id: Ie7308d549182a95b86cd113e4a8cc65ff45ba3d7
S= igned-off-by: Frank Lichtenheld <frank@...2641...>
Acked-by: Gert = Doering <gert@...1296...>
Gerrit URL: https://gerrit.openvpn.net/c= /openvpn/+/1385
Message-Id: <20251122162553.12254-1-gert@...1296...&g= t;
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net= /msg34585.html
Signed-off-by: Gert Doering <gert@...1296...>
--= -
M src/openvpn/tls_crypt.c
1 file changed, 1 insertion(+), 1 deletio= n(-)

diff --git a/src/openvpn/tls_crypt.c b/src/openvpn/tls_crypt.cindex 318c939..9026cff 100644
--- a/src/openvpn/tls_= crypt.c
+++ b/src/openvpn/tls_crypt.c
@@ -5= 39,7 +539,7 @@
int64_t timestamp;
= memcpy(&timestamp, 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 ol= d.");

To view, visit change 1385. To u= nsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: merged
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ie7308d549182a95b86cd113e4a8= cc65ff45ba3d7
Gerrit-Change-Number: 1385
Gerrit-PatchSet: 2
Gerrit-Owner: flichtenheld <frank@...2723...= .>
Gerrit-Reviewer: cron2 <gert@...1296...>=
Gerrit-Reviewer: plaisthos <arne-openvpn@...1186...= .1227...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
= --jlfMtIG/vbY=--