From: "stipa (Code Review)" Date: Mon, 29 Sep 2025 08:47:32 +0000 References: Reply-To: lstipakov@...277..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, frank@...2641... Message-ID: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="OTGb2g9pyW4="; charset=UTF-8 Subject: [Openvpn-devel] [XS] Change in openvpn[master]: dco-win: fix broken ASSERT in dco_new_key List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: plaisthos , flichtenheld Cc: openvpn-devel --OTGb2g9pyW4= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Attention is currently required from: flichtenheld, plaisthos. Hello plaisthos, flichtenheld, I'd like you to do a code review. Please visit http://gerrit.openvpn.net/c/openvpn/+/1223?usp=3Demail to review the following change. Change subject: dco-win: fix broken ASSERT in dco_new_key ...................................................................... dco-win: fix broken ASSERT in dco_new_key Commit e77c343 ("dco_win: In dco_new_key, document size assumptions for the inte= ger casts") has added an ASSERT on key-id, but didn't take into account that key-id 0 is a perfectly valid value and is the first key-id. This essentially broke dco-win. Fix by adjusting ASSERT to >=3D 0. Change-Id: I3b1243461ec9b6e85897f452f78dc4b05f7e126d Signed-off-by: Lev Stipakov --- M src/openvpn/dco_win.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/23/1223/1 diff --git a/src/openvpn/dco_win.c b/src/openvpn/dco_win.c index 4dd307f..30307de 100644 --- a/src/openvpn/dco_win.c +++ b/src/openvpn/dco_win.c @@ -541,7 +541,7 @@ ZeroMemory(&crypto_data, sizeof(crypto_data)); crypto_data.CipherAlg =3D dco_get_cipher(ciphername); - ASSERT(keyid > 0 && keyid <=3D UCHAR_MAX); + ASSERT(keyid >=3D 0 && keyid <=3D UCHAR_MAX); crypto_data.KeyId =3D (unsigned char)keyid; crypto_data.PeerId =3D peerid; crypto_data.KeySlot =3D slot; -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/1223?usp=3Demail To unsubscribe, or for help writing mail filters, visit http://gerrit.openv= pn.net/settings Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: I3b1243461ec9b6e85897f452f78dc4b05f7e126d Gerrit-Change-Number: 1223 Gerrit-PatchSet: 1 Gerrit-Owner: stipa Gerrit-Reviewer: flichtenheld Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel Gerrit-Attention: plaisthos Gerrit-Attention: flichtenheld Gerrit-MessageType: newchange --OTGb2g9pyW4= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Attention is currently required from: flichtenheld, plaisthos.

stipa would like plaisthos and flichtenheld to review t= his change.

V= iew Change

dco-win: fix broken ASSERT in dco_new_key

Commit
<= br> e77c343 ("dco_win: In dco_new_key, document size assumptions for = the integer casts")

has added an ASSERT on key-id, but didn'= ;t take into account that
key-id 0 is a perfectly valid value and is the= first key-id. This
essentially broke dco-win.

Fix by adjusting A= SSERT to >=3D 0.

Change-Id: I3b1243461ec9b6e85897f452f78dc4b05f7e= 126d
Signed-off-by: Lev Stipakov <lev@...515...>
---
M src/o= penvpn/dco_win.c
1 file changed, 1 insertion(+), 1 deletion(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/23/1223/1
<=
span>diff --git a/src/openvpn/dco_win.c b/src/openvpn/dco_win.c
<= span>index 4dd307f..30307de 100644
--- a/src/openvpn/dco_wi= n.c
+++ b/src/openvpn/dco_win.c
@@ -541,7 += 541,7 @@
ZeroMemory(&crypto_data, sizeof(crypto_da= ta));

crypto_data.CipherAlg =3D dco_= get_cipher(ciphername);
- ASSERT(keyid > 0 && keyid <=3D UCHAR_MAX);
+ ASSERT(keyid >=3D 0 &= & keyid <=3D UCHAR_MAX);
crypto_data.KeyId =3D = (unsigned char)keyid;
crypto_data.PeerId =3D peerid;
crypto_data.KeySlot =3D slot;

To view, visit change 1223. To unsubscribe, or for help writing mail= filters, visit settings= .

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I3b1243461ec9b6e85897f452f78= dc4b05f7e126d
Gerrit-Change-Number: 1223
Gerrit-PatchSet: 1
Gerrit-Owner: stipa <lstipakov@...277...>= ;
Gerrit-Reviewer: flichtenheld <frank@...2716...= 1...>
Gerrit-Reviewer: plaisthos <arne-openvpn@...1186...= .1227...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
Gerrit-Attention: plaisthos <arne-openvpn@...220...= ..1227...>
Gerrit-Attention: flichtenheld <frank@...2375...= 41...>
Gerrit-MessageType: newchange
--OTGb2g9pyW4=--