From: "flichtenheld (Code Review)" Date: Mon, 25 Mar 2024 14:30:49 +0000 References: Reply-To: frank@...2641..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net Message-ID: <8be38848bbb0b6931888dfd560d9f6c45897274d-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="7zJd+7iLJgE="; charset=UTF-8 Subject: [Openvpn-devel] [XS] Change in openvpn[master]: mbedtls: avoid warning with GCC 13+ List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: plaisthos Cc: openvpn-devel --7zJd+7iLJgE= 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/+/548?usp=3Demail to review the following change. Change subject: mbedtls: avoid warning with GCC 13+ ...................................................................... mbedtls: avoid warning with GCC 13+ crypto_mbedtls.c:568:1: error: conflicting types for =E2=80=98cipher_ctx_init=E2=80=99 due to enum/integer= mismatch; have =E2=80=98void(mbedtls_cipher_context_t *, const uint8_t *, const char = *, const mbedtls_operation_t)=E2=80=99 [...] [-Werror=3Denum-int-mismatch] crypto_backend.h:341:6: note: previous declaration of =E2=80=98cipher_ctx_init=E2=80=99 with type =E2=80=98void(cipher_ctx_t *, const uint8_t *, const char *, int)=E2=80=99 = [...] Previous compiler versions did not complain. Change-Id: If0dcdde30879fd6185efb2ad31399c1629c04d22 Signed-off-by: Frank Lichtenheld --- M src/openvpn/crypto_mbedtls.c 1 file changed, 2 insertions(+), 1 deletion(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/48/548/1 diff --git a/src/openvpn/crypto_mbedtls.c b/src/openvpn/crypto_mbedtls.c index 1a39752..91485cb 100644 --- a/src/openvpn/crypto_mbedtls.c +++ b/src/openvpn/crypto_mbedtls.c @@ -566,11 +566,12 @@ void cipher_ctx_init(mbedtls_cipher_context_t *ctx, const uint8_t *key, - const char *ciphername, const mbedtls_operation_t operatio= n) + const char *ciphername, int enc) { ASSERT(NULL !=3D ciphername && NULL !=3D ctx); CLEAR(*ctx); + const mbedtls_operation_t operation =3D (mbedtls_operation_t)enc; const mbedtls_cipher_info_t *kt =3D cipher_get(ciphername); ASSERT(kt); size_t key_bitlen =3D mbedtls_cipher_info_get_key_bitlen(kt); -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/548?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: If0dcdde30879fd6185efb2ad31399c1629c04d22 Gerrit-Change-Number: 548 Gerrit-PatchSet: 1 Gerrit-Owner: flichtenheld Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel Gerrit-Attention: plaisthos Gerrit-MessageType: newchange --7zJd+7iLJgE= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Attention is currently required from: plaisthos.

flichtenheld would like plaisthos to review this change.

Vi= ew Change

mbedtls: avoid warning with GCC 13+

crypto_mbedtls.c:5= 68:1: error:
conflicting types for =E2=80=98cipher_ctx_init=E2=80=99 due= to enum/integer mismatch;
have =E2=80=98void(mbedtls_cipher_context_t *= , const uint8_t *, const char *, const mbedtls_operation_t)=E2=80=99
[..= .] [-Werror=3Denum-int-mismatch]
crypto_backend.h:341:6: note:
previo= us declaration of =E2=80=98cipher_ctx_init=E2=80=99 with type
=E2=80=98v= oid(cipher_ctx_t *, const uint8_t *, const char *, int)=E2=80=99 [...]
<= br>Previous compiler versions did not complain.

Change-Id: If0dcdde3= 0879fd6185efb2ad31399c1629c04d22
Signed-off-by: Frank Lichtenheld <fr= ank@...2641...>
---
M src/openvpn/crypto_mbedtls.c
1 file chang= ed, 2 insertions(+), 1 deletion(-)

git pull ssh://gerrit.openvpn.=
net:29418/openvpn refs/changes/48/548/1
diff --git a/src/openvpn/cr=
ypto_mbedtls.c b/src/openvpn/crypto_mbedtls.c
index 1a39752= ..91485cb 100644
--- a/src/openvpn/crypto_mbedtls.c<= br>+++ b/src/openvpn/crypto_mbedtls.c
@@ -566,11 +566= ,12 @@

void
cipher_ctx_= init(mbedtls_cipher_context_t *ctx, const uint8_t *key,
- const char *ciphername, c= onst mbedtls_operation_t operation)
+ const char *ciphername, int enc)
= {
ASSERT(NULL !=3D ciphername && NULL != =3D ctx);
CLEAR(*ctx);

+ const mbedtls_operation_t ope= ration =3D (mbedtls_operation_t)enc;
const mbedtls_cip= her_info_t *kt =3D cipher_get(ciphername);
ASSERT(kt);=
size_t key_bitlen =3D mbedtls_cipher_info_get_key_bit= len(kt);

To view, visit change 548. To unsub= scribe, or for help writing mail filters, visit settings.

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: If0dcdde30879fd6185efb2ad313= 99c1629c04d22
Gerrit-Change-Number: 548
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...>
Gerrit-MessageType: newchange
--7zJd+7iLJgE=--