From 7edbe7bd718b07fc0ee65862b6c5c4f9f6bbc7f8 Mon Sep 17 00:00:00 2001 From: tb <> Date: Wed, 2 Jul 2025 06:19:46 +0000 Subject: EVP_CipherInit_ex(): normalize EVP_CIPHER_CTX_ctrl() error check While EVP_CIPHER_CTX_ctrl() can return a negative value this can't actually happen currently as all ciphers with EVP_CIPH_CTRL_INIT set normalize the EVP_CTRL_INIT return value to boolean in their ctrl() methods. Still, this check looks weird in grep, so align it. ok beck kenjiro --- src/lib/libcrypto/evp/evp_cipher.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/lib/libcrypto/evp/evp_cipher.c b/src/lib/libcrypto/evp/evp_cipher.c index 01e4ce67e7..04e0e1c0b0 100644 --- a/src/lib/libcrypto/evp/evp_cipher.c +++ b/src/lib/libcrypto/evp/evp_cipher.c @@ -1,4 +1,4 @@ -/* $OpenBSD: evp_cipher.c,v 1.27 2025/06/02 08:50:51 tb Exp $ */ +/* $OpenBSD: evp_cipher.c,v 1.28 2025/07/02 06:19:46 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -167,7 +167,7 @@ EVP_CipherInit_ex(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, ENGINE *engine, } if ((ctx->cipher->flags & EVP_CIPH_CTRL_INIT) != 0) { - if (!EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_INIT, 0, NULL)) { + if (EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_INIT, 0, NULL) <= 0) { EVPerror(EVP_R_INITIALIZATION_ERROR); return 0; } -- cgit v1.2.3-55-g6feb