diff options
| author | tb <> | 2025-07-02 06:19:46 +0000 |
|---|---|---|
| committer | tb <> | 2025-07-02 06:19:46 +0000 |
| commit | ad601ff02961740f5ae318c6636c0f79f9d72ae4 (patch) | |
| tree | 5119f50a6eeee82e61c39626f92d8bcb1dcfe624 /src | |
| parent | 1c46a17c1900864397105998c0a7aa863ce27859 (diff) | |
| download | openbsd-ad601ff02961740f5ae318c6636c0f79f9d72ae4.tar.gz openbsd-ad601ff02961740f5ae318c6636c0f79f9d72ae4.tar.bz2 openbsd-ad601ff02961740f5ae318c6636c0f79f9d72ae4.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.c | 4 |
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 | } |
