From: "plaisthos (Code Review)" Date: Tue, 2 Apr 2024 00:22:02 +0000 References: Reply-To: arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, frank@...2641... Message-ID: <6eee5b0654aece503b1a0da0cdd5ff4f7aa65ae6-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="iuX4Qh7wzag="; charset=UTF-8 Subject: [Openvpn-devel] [XS] Change in openvpn[master]: Remove redundant call of EVP_CipherInit before EVP_CipherInit_Ex List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: flichtenheld Cc: openvpn-devel --iuX4Qh7wzag= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Attention is currently required from: flichtenheld. Hello flichtenheld, I'd like you to do a code review. Please visit http://gerrit.openvpn.net/c/openvpn/+/552?usp=3Demail to review the following change. Change subject: Remove redundant call of EVP_CipherInit before EVP_CipherIn= it_Ex ...................................................................... Remove redundant call of EVP_CipherInit before EVP_CipherInit_Ex EVP_CipherInit basically is the same EVP_CipherInit_ex except that it in some instances it resets/inits the ctx parameter first. We already call EVP_CIPHER_CTX_reset to reset/init the ctx before so this call does not do anything useful Change-Id: I911e25949a8647b567fd4178683534d4404ab469 Signed-off-by: Arne Schwabe --- M src/openvpn/crypto_openssl.c 1 file changed, 0 insertions(+), 4 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/52/552/1 diff --git a/src/openvpn/crypto_openssl.c b/src/openvpn/crypto_openssl.c index bfc5e37..13dfa8c 100644 --- a/src/openvpn/crypto_openssl.c +++ b/src/openvpn/crypto_openssl.c @@ -846,10 +846,6 @@ evp_cipher_type *kt =3D cipher_get(ciphername); =20 EVP_CIPHER_CTX_reset(ctx); - if (!EVP_CipherInit(ctx, kt, NULL, NULL, enc)) - { - crypto_msg(M_FATAL, "EVP cipher init #1"); - } if (!EVP_CipherInit_ex(ctx, NULL, NULL, key, NULL, enc)) { crypto_msg(M_FATAL, "EVP cipher init #2"); -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/552?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: I911e25949a8647b567fd4178683534d4404ab469 Gerrit-Change-Number: 552 Gerrit-PatchSet: 1 Gerrit-Owner: plaisthos Gerrit-Reviewer: flichtenheld Gerrit-CC: openvpn-devel Gerrit-Attention: flichtenheld Gerrit-MessageType: newchange --iuX4Qh7wzag= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Attention is currently required from: flichtenheld.

plaisthos would like flichtenheld to review this change.

Vi= ew Change

Remove redundant call of EVP_CipherInit before EVP_CipherInit=
_Ex

EVP_CipherInit basically is the same EVP_CipherInit_ex except th= at it
in some instances it resets/inits the ctx parameter first. We alre= ady
call EVP_CIPHER_CTX_reset to reset/init the ctx before so this call = does
not do anything useful

Change-Id: I911e25949a8647b567fd41786= 83534d4404ab469
Signed-off-by: Arne Schwabe <arne@...1227...>
-= --
M src/openvpn/crypto_openssl.c
1 file changed, 0 insertions(+), 4 = deletions(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs=
/changes/52/552/1
diff --git a/src/openvpn/crypto_openssl.c b/src/o=
penvpn/crypto_openssl.c
index bfc5e37..13dfa8c 100644
--- a/src/openvpn/crypto_openssl.c
+++ b/src/ope= nvpn/crypto_openssl.c
@@ -846,10 +846,6 @@
= evp_cipher_type *kt =3D cipher_get(ciphername);

EVP_CIPHER_CTX_reset(ctx);
- if (!EVP_CipherInit(ctx, kt, NULL, NULL, enc))
- {
- crypto_msg(M_FATAL, "EVP ci= pher init #1");
- = }
if (!EVP_CipherInit_ex(ctx, NULL, NULL, key, NULL= , enc))
{
crypto_msg(M_FATAL,= "EVP cipher init #2");

To vi= ew, visit change 552. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I911e25949a8647b567fd4178683= 534d4404ab469
Gerrit-Change-Number: 552
Gerrit-PatchSet: 1
Gerrit-Owner: plaisthos <arne-openvpn@...1711...= 27...>
Gerrit-Reviewer: flichtenheld <frank@...2716...= 1...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
Gerrit-Attention: flichtenheld <frank@...2375...= 41...>
Gerrit-MessageType: newchange
--iuX4Qh7wzag=--