summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortb <>2025-07-02 06:19:46 +0000
committertb <>2025-07-02 06:19:46 +0000
commit7edbe7bd718b07fc0ee65862b6c5c4f9f6bbc7f8 (patch)
tree5119f50a6eeee82e61c39626f92d8bcb1dcfe624 /src
parent516eee130b58dc8346e1533a697c1c964aac8098 (diff)
downloadopenbsd-7edbe7bd718b07fc0ee65862b6c5c4f9f6bbc7f8.tar.gz
openbsd-7edbe7bd718b07fc0ee65862b6c5c4f9f6bbc7f8.tar.bz2
openbsd-7edbe7bd718b07fc0ee65862b6c5c4f9f6bbc7f8.zip
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
Diffstat (limited to 'src')
-rw-r--r--src/lib/libcrypto/evp/evp_cipher.c4
1 files changed, 2 insertions, 2 deletions
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 @@
1/* $OpenBSD: evp_cipher.c,v 1.27 2025/06/02 08:50:51 tb Exp $ */ 1/* $OpenBSD: evp_cipher.c,v 1.28 2025/07/02 06:19:46 tb Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -167,7 +167,7 @@ EVP_CipherInit_ex(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, ENGINE *engine,
167 } 167 }
168 168
169 if ((ctx->cipher->flags & EVP_CIPH_CTRL_INIT) != 0) { 169 if ((ctx->cipher->flags & EVP_CIPH_CTRL_INIT) != 0) {
170 if (!EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_INIT, 0, NULL)) { 170 if (EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_INIT, 0, NULL) <= 0) {
171 EVPerror(EVP_R_INITIALIZATION_ERROR); 171 EVPerror(EVP_R_INITIALIZATION_ERROR);
172 return 0; 172 return 0;
173 } 173 }