diff --git a/plugin/openssl_plugin/crypto_operation/rsa/src/cipher_rsa_openssl.c b/plugin/openssl_plugin/crypto_operation/rsa/src/cipher_rsa_openssl.c index 69ab3e1ee9b4504d8b6bff21e6809accc83173d7..46e2f7ae6148031fa8e9241fa0a89db26842d066 100644 --- a/plugin/openssl_plugin/crypto_operation/rsa/src/cipher_rsa_openssl.c +++ b/plugin/openssl_plugin/crypto_operation/rsa/src/cipher_rsa_openssl.c @@ -282,7 +282,6 @@ static void EngineDestroySpiImpl(HcfObjectBase *generator) EVP_PKEY_CTX_free(impl->ctx); impl->ctx = NULL; HcfFree(impl); - generator = NULL; } static const char *EngineGetClass() diff --git a/plugin/openssl_plugin/crypto_operation/signature/src/signature_rsa_openssl.c b/plugin/openssl_plugin/crypto_operation/signature/src/signature_rsa_openssl.c index d8ff2349336f9a52aab3b2094d3114c0ede1e4e5..77733cd57b29ed81e7653a10af5e31c9cd672079 100644 --- a/plugin/openssl_plugin/crypto_operation/signature/src/signature_rsa_openssl.c +++ b/plugin/openssl_plugin/crypto_operation/signature/src/signature_rsa_openssl.c @@ -322,7 +322,7 @@ static HcfResult EngineVerifyUpdate(HcfVerifySpi *self, HcfBlob *data) static HcfResult EngineSign(HcfSignSpi *self, HcfBlob *data, HcfBlob *returnSignatureData) { LOGI("EngineSign start"); - if (self == NULL || data == NULL || data->data == NULL || returnSignatureData == NULL) { + if (self == NULL || returnSignatureData == NULL) { LOGE("Invalid input params."); return HCF_INVALID_PARAMS; } @@ -373,7 +373,7 @@ static HcfResult EngineSign(HcfSignSpi *self, HcfBlob *data, HcfBlob *returnSign static bool EngineVerify(HcfVerifySpi *self, HcfBlob *data, HcfBlob *signatureData) { LOGI("EngineVerify start"); - if (self == NULL || data == NULL || data->data == NULL || signatureData == NULL || signatureData->data == NULL) { + if (self == NULL || signatureData == NULL || signatureData->data == NULL) { LOGE("Invalid input params"); return false; } diff --git a/plugin/openssl_plugin/key/asy_key_generator/src/rsa_asy_key_generator_openssl.c b/plugin/openssl_plugin/key/asy_key_generator/src/rsa_asy_key_generator_openssl.c index 3330b631031815092721106806e930ceb97f3125..e6611b6dc9cdb787e4db8d532300336bbfa7288d 100644 --- a/plugin/openssl_plugin/key/asy_key_generator/src/rsa_asy_key_generator_openssl.c +++ b/plugin/openssl_plugin/key/asy_key_generator/src/rsa_asy_key_generator_openssl.c @@ -160,7 +160,6 @@ static void DestroyPubKey(HcfObjectBase *self) RSA_free(impl->pk); impl->pk = NULL; HcfFree(self); - self = NULL; } static void DestroyPriKey(HcfObjectBase *self) @@ -179,7 +178,6 @@ static void DestroyPriKey(HcfObjectBase *self) impl->sk = NULL; } HcfFree(impl); - self = NULL; } static void DestroyKeyPair(HcfObjectBase *self) @@ -198,7 +196,6 @@ static void DestroyKeyPair(HcfObjectBase *self) OH_HCF_ObjDestroy((HcfObjectBase *)impl->base.pubKey); impl->base.pubKey = NULL; HcfFree(self); - self = NULL; } static HcfResult RsaSaveKeyMaterial(const RSA *rsa, const uint32_t keySize, HcfBlob *key, bool needPrivate) @@ -480,7 +477,6 @@ static void DestroyKeyGeneratorSpiImpl(HcfObjectBase *self) HcfFree(impl->params); impl->params = NULL; HcfFree(self); - self = NULL; LOGI("DestroyKeyGeneratorSpiImpl end."); }