From: "flichtenheld (Code Review)" Date: Tue, 11 Nov 2025 14:26:54 +0000 In-Reply-To: References: Reply-To: frank@...2641..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net Message-ID: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="iTNE7wPnsB4="; 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: plaisthos Cc: openvpn-devel --iTNE7wPnsB4= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Attention is currently required from: flichtenheld, plaisthos. Hello plaisthos, I'd like you to reexamine a change. Please visit http://gerrit.openvpn.net/c/openvpn/+/1298?usp=3Demail to look at the new patch set (#4). The following approvals got outdated and were removed: Code-Review-1 by plaisthos Change subject: ssl: Fix conversion warning in tls_prepend_opcode_v1 ...................................................................... ssl: Fix conversion warning in tls_prepend_opcode_v1 Document assumption with ASSERT. Change-Id: I34584f695ddca3b3e1f2bbcb4380ac91b09c1c8d Signed-off-by: Frank Lichtenheld --- M src/openvpn/ssl.c 1 file changed, 6 insertions(+), 6 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/98/1298/4 diff --git a/src/openvpn/ssl.c b/src/openvpn/ssl.c index eb5c4fc..7b93ebc 100644 --- a/src/openvpn/ssl.c +++ b/src/openvpn/ssl.c @@ -3970,24 +3970,24 @@ } } +#if defined(__GNUC__) || defined(__clang__) +#pragma GCC diagnostic pop +#endif + void tls_prepend_opcode_v1(const struct tls_multi *multi, struct buffer *buf) { struct key_state *ks =3D multi->save_ks; - uint8_t op; msg(D_TLS_DEBUG, __func__); ASSERT(ks); + ASSERT(ks->key_id <=3D P_KEY_ID_MASK); - op =3D (P_DATA_V1 << P_OPCODE_SHIFT) | ks->key_id; + uint8_t op =3D (P_DATA_V1 << P_OPCODE_SHIFT) | (uint8_t)ks->key_id; ASSERT(buf_write_prepend(buf, &op, 1)); } -#if defined(__GNUC__) || defined(__clang__) -#pragma GCC diagnostic pop -#endif - void tls_prepend_opcode_v2(const struct tls_multi *multi, struct buffer *buf) { -- 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: newpatchset Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: I34584f695ddca3b3e1f2bbcb4380ac91b09c1c8d Gerrit-Change-Number: 1298 Gerrit-PatchSet: 4 Gerrit-Owner: flichtenheld Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel Gerrit-Attention: plaisthos Gerrit-Attention: flichtenheld --iTNE7wPnsB4= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Attention is cur= rently required from: flichtenheld, plaisthos.

flichtenheld uploaded patch set #4 to this change.

<= p>View C= hange

The following approvals got outdated and were removed: Code-Review-1 by plaisthos

ssl: Fix conversion warning in =
tls_prepend_opcode_v1

Document assumption with ASSERT.

Change= -Id: I34584f695ddca3b3e1f2bbcb4380ac91b09c1c8d
Signed-off-by: Frank Lich= tenheld <frank@...2641...>
---
M src/openvpn/ssl.c
1 file ch= anged, 6 insertions(+), 6 deletions(-)

git pull =
ssh://gerrit.openvpn.net:29418/openvpn refs/changes/98/1298/4
diff =
--git a/src/openvpn/ssl.c b/src/openvpn/ssl.c
index eb5c4fc= ..7b93ebc 100644
--- a/src/openvpn/ssl.c
++= + b/src/openvpn/ssl.c
@@ -3970,24 +3970,24 @@
}
}

+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic p= op
+#endif
= +
void<= br> tls_prepend_opcode_v1(const struct tls_multi *multi, struct buffe= r *buf)
{
struct key_state *ks =3D mu= lti->save_ks;
- u= int8_t op;

msg(D_TLS_DEBUG, __func__= );

ASSERT(ks);
+ ASSERT(ks->key_id <=3D P_KEY_ID= _MASK);

- op =3D (P_DATA_V1 << P_OPCODE_SHIFT) | ks->key_id;<= br>+ uint8_t op =3D (P_DATA_= V1 << P_OPCODE_SHIFT) | (uint8_t)ks->key_id;
= ASSERT(buf_write_prepend(buf, &op, 1));
}

-#if defined(__GN= UC__) || defined(__clang__)
-#pragma GCC diagnostic pop
-#endif
-

void
tls_prepend_opcode_v2(const struct tls_= multi *multi, struct buffer *buf)
{

To view, visit change 1298. To unsubscribe, or for help writing m= ail filters, visit settings.

<= /div>
Gerrit-MessageType: newpatchset
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I34584f695ddca3b3e1f2bbcb438= 0ac91b09c1c8d
Gerrit-Change-Number: 1298
Gerrit-PatchSet: 4
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...>
Gerrit-Attention: flichtenheld <frank@...2375...= 41...>
= --iTNE7wPnsB4=--