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 9c50c2f542444619c6aadfa97ad83e3b6d4e8dcd..2fd8553fd25e1560ab9d44adbac97c56c20dc42c 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;