From: "plaisthos (Code Review)"
Date: Tue, 11 Nov 2025 11:10:25 +0000
In-Reply-To:
References:
Reply-To: arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net,
frank@...2641...
Message-ID: <7f5025e4cee0251f13cadc383bebadfc678b44a2-EmailReviewComments-HTML@...2715...>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Disposition: inline
Content-Type: multipart/alternative; boundary="wb7lcOxRyxg="; charset=UTF-8
Subject: [Openvpn-devel] [S] Change in openvpn[master]: ssl: Fix conversion
warning in tls_prepend_opcode_v1
List-Id:
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
To: flichtenheld
Cc: openvpn-devel
--wb7lcOxRyxg=
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Attention is currently required from: flichtenheld.
plaisthos has posted comments on this change by flichtenheld. ( http://gerr=
it.openvpn.net/c/openvpn/+/1298?usp=3Demail )
Change subject: ssl: Fix conversion warning in tls_prepend_opcode_v1
......................................................................
Patch Set 3: Code-Review-1
(2 comments)
Patchset:
PS3:
I think the assert is wrong.
File src/openvpn/ssl.c:
http://gerrit.openvpn.net/c/openvpn/+/1298/comment/84eda4a7_8aea915f?usp=3D=
email :
PS3, Line 3985: ASSERT(ks->key_id <=3D 1 << P_OPCODE_SHIFT);
Can we add brackets here? I find this a bit hard to read since the order of=
<=3D and << is not so super obvious. Brackets would make this a bit nicer =
to read.
I think we should probably add a define to indicate the highest key ID, som=
ething like this:
/* packet opcode (high 5 bits) and key-id (low 3 bits) are combined in one =
byte */
#define P_KEY_ID_MASK 0x07
#define P_OPCODE_SHIFT 3
/* We use 3 bits for the key id which makes 7 the highest key id */
#define MAXIMUM_KEY_ID 7
I think this assert is also wrong since (1 << 3) =3D 8 and 8 is not an allo=
wed key id.
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1298?usp=3Demail
To unsubscribe, or for help writing mail filters, visit http://gerrit.openv=
pn.net/settings?usp=3Demail
Gerrit-MessageType: comment
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I34584f695ddca3b3e1f2bbcb4380ac91b09c1c8d
Gerrit-Change-Number: 1298
Gerrit-PatchSet: 3
Gerrit-Owner: flichtenheld
Gerrit-Reviewer: plaisthos
Gerrit-CC: openvpn-devel
Gerrit-Attention: flichtenheld
Gerrit-Comment-Date: Tue, 11 Nov 2025 11:10:25 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
--wb7lcOxRyxg=
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Attention is cur=
rently required from: flichtenheld.
Patch set 3:Code-Review -1=
V=
iew Change
2 comments:
Patchset:
- <=
p>File src/openvpn/ssl.c:
Patch Set #3, Line 3985: ASSERT(ks->key_id <=3D 1 << P_OPCODE_=
SHIFT);
Can we add brackets here? I find this a bit hard to read=
since the order of <=3D and << is not so super obvious. Brackets =
would make this a bit nicer to read.
I think we should probably add a d=
efine to indicate the highest key ID, something like this:
/* packet op=
code (high 5 bits) and key-id (low 3 bits) are combined in one byte */
#=
define P_KEY_ID_MASK 0x07
#define P_OPCODE_SHIFT 3
/* We use 3 bits =
for the key id which makes 7 the highest key id */
#define MAXIMUM_KEY_I=
D 7
I think this assert is also wrong since (1 << 3) =3D 8 and 8 =
is not an allowed key id.
To view, visit change 1298=
. To unsubscribe, or for help writing mail filters, visit settings.
Gerrit-MessageType: comment
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I34584f695ddca3b3e1f2bbcb438=
0ac91b09c1c8d
Gerrit-Change-Number: 1298
Gerrit-PatchSet: 3
Gerrit-Owner: flichtenheld <frank@...2723...=
.>
Gerrit-Reviewer: plaisthos <arne-openvpn@...1186...=
.1227...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...=
ts.sourceforge.net>
Gerrit-Attention: flichtenheld <frank@...2375...=
41...>
Gerrit-Comment-Date: Tue, 11 Nov 2025 11:10:25=
+0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
=
--wb7lcOxRyxg=--