summaryrefslogtreecommitdiffstats
path: root/crypto/evp
diff options
context:
space:
mode:
authorPeiwei Hu <jlu.hpw@foxmail.com>2022-05-21 16:17:23 +0800
committerTomas Mraz <tomas@openssl.org>2022-05-24 08:58:20 +0200
commit4aa3eb454e89fd78884faa168a90ccf19d0bca3a (patch)
treec7286d9a8738993b053fd792fa1d88a028525649 /crypto/evp
parent5aa6e627953a4b3e96ea1f37b5ed71c9bb8c1e1b (diff)
Fix check of EVP_CIPHER_CTX_ctrl
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/18368) (cherry picked from commit d649c51a5388912277dffb56d921eb720db54be1)
Diffstat (limited to 'crypto/evp')
-rw-r--r--crypto/evp/evp_enc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/crypto/evp/evp_enc.c b/crypto/evp/evp_enc.c
index 19a07debd9..e69da3f9a0 100644
--- a/crypto/evp/evp_enc.c
+++ b/crypto/evp/evp_enc.c
@@ -304,7 +304,7 @@ static int evp_cipher_init_internal(EVP_CIPHER_CTX *ctx,
/* Preserve wrap enable flag, zero everything else */
ctx->flags &= EVP_CIPHER_CTX_FLAG_WRAP_ALLOW;
if (ctx->cipher->flags & EVP_CIPH_CTRL_INIT) {
- if (!EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_INIT, 0, NULL)) {
+ if (EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_INIT, 0, NULL) <= 0) {
ctx->cipher = NULL;
ERR_raise(ERR_LIB_EVP, EVP_R_INITIALIZATION_ERROR);
return 0;