From 3de537e240dda84e72c884bd70ebe302185937bb Mon Sep 17 00:00:00 2001 From: lichaochen_huawei Date: Mon, 11 Aug 2025 15:37:21 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DDES=E5=A2=9E=E5=BC=BAIV?= =?UTF-8?q?=E6=A0=A1=E9=AA=8C=E5=AF=BC=E8=87=B4=E7=9A=843DES=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: lichaochen_huawei --- .../crypto_operation/cipher/src/cipher_des_openssl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin/openssl_plugin/crypto_operation/cipher/src/cipher_des_openssl.c b/plugin/openssl_plugin/crypto_operation/cipher/src/cipher_des_openssl.c index 9c50c2f..2fd8553 100644 --- a/plugin/openssl_plugin/crypto_operation/cipher/src/cipher_des_openssl.c +++ b/plugin/openssl_plugin/crypto_operation/cipher/src/cipher_des_openssl.c @@ -222,7 +222,7 @@ static HcfResult EngineCipherInit(HcfCipherGeneratorSpi *self, enum HcfCryptoMod goto clearup; } const unsigned char *iv = GetIvData(cipherImpl, params); - if (iv == NULL && cipherImpl->attr.mode != HCF_ALG_MODE_ECB) { + if ((iv == NULL) && (cipherImpl->attr.mode != HCF_ALG_MODE_ECB) && (cipherImpl->attr.algo == HCF_ALG_DES)) { LOGE("IV is required for non-ECB modes."); ret = HCF_INVALID_PARAMS; goto clearup; -- Gitee