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 f962461e1bc114b4746266651cb7d1b24614c380..b6b48d060a5069999d3a6a11329100286c0b9410 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 @@ -281,7 +281,6 @@ static void EngineDestroySpiImpl(HcfObjectBase *generator) EVP_PKEY_CTX_free(impl->ctx); impl->ctx = NULL; HcfFree(impl); - generator = NULL; } static const char *EngineGetClass(void) 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 b5dd5a7be444c7c9d07862e446c7f837cae742a9..9c282b3ee7cef359762110f132c02a9a34eb61e8 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 ee5fc52c7341b164547c9abb103381de99e78ece..a7b78befb41232c633eeeb7e813791efa845331c 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) @@ -496,7 +493,6 @@ static void DestroyKeyGeneratorSpiImpl(HcfObjectBase *self) HcfFree(impl->params); impl->params = NULL; HcfFree(self); - self = NULL; LOGI("DestroyKeyGeneratorSpiImpl end."); }