From: Peiwei Hu Date: Sun, 14 Nov 2021 08:39:42 +0000 (+0800) Subject: EVP_Cipher: fix the incomplete return check X-Git-Tag: openssl-3.0.1~112 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c8d3926eb7bcbce6ec85fd3218d64fa8bc7c0861;p=thirdparty%2Fopenssl.git EVP_Cipher: fix the incomplete return check Signed-off-by: Peiwei Hu Reviewed-by: Matt Caswell Reviewed-by: Paul Dale Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/17027) (cherry picked from commit 6d774732517f1d63b7999c5691fc0bf046023faf) --- diff --git a/crypto/cmac/cmac.c b/crypto/cmac/cmac.c index 18c7fea3dde..218eb942596 100644 --- a/crypto/cmac/cmac.c +++ b/crypto/cmac/cmac.c @@ -227,7 +227,7 @@ int CMAC_Final(CMAC_CTX *ctx, unsigned char *out, size_t *poutlen) for (i = 0; i < bl; i++) out[i] = ctx->last_block[i] ^ ctx->k2[i]; } - if (!EVP_Cipher(ctx->cctx, out, out, bl)) { + if (EVP_Cipher(ctx->cctx, out, out, bl) <= 0) { OPENSSL_cleanse(out, bl); return 0; }