From 6f74632a039a315190a099f99750abcc2641def1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E9=9D=99?= Date: Sat, 14 Sep 2024 10:20:52 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9TDD=E5=86=85=E5=AD=98?= =?UTF-8?q?=E6=B3=84=E6=BC=8F=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 王静 Signed-off-by: hhhFun --- test/unittest/src/alg_25519_common_param_spec.c | 1 + test/unittest/src/crypto_ed25519_asy_key_generator_test.cpp | 2 ++ 2 files changed, 3 insertions(+) diff --git a/test/unittest/src/alg_25519_common_param_spec.c b/test/unittest/src/alg_25519_common_param_spec.c index 705bbbb..a7fc2f6 100644 --- a/test/unittest/src/alg_25519_common_param_spec.c +++ b/test/unittest/src/alg_25519_common_param_spec.c @@ -284,6 +284,7 @@ HcfResult TestGenerateKeyPairAndConvertKey(const char *algName, HcfAsyKeyGenerat return HCF_ERR_CRYPTO_OPERATION; } HcfObjDestroy(*keyPair); + *keyPair = NULL; res = TestGenerateConvertKey(*generator, pubKeyBlob, priKeyBlob, keyPair); if (res != HCF_SUCCESS) { return HCF_ERR_CRYPTO_OPERATION; diff --git a/test/unittest/src/crypto_ed25519_asy_key_generator_test.cpp b/test/unittest/src/crypto_ed25519_asy_key_generator_test.cpp index 9925e6c..eefbcf8 100644 --- a/test/unittest/src/crypto_ed25519_asy_key_generator_test.cpp +++ b/test/unittest/src/crypto_ed25519_asy_key_generator_test.cpp @@ -376,9 +376,11 @@ HWTEST_F(CryptoEd25519AsyKeyGeneratorTest, CryptoEd25519AsyKeyGeneratorTest015, HcfResult res = TestGenerateKeyPairAndConvertKey(g_ed25519AlgoName.c_str(), &generator, &g_mockEd25519PubKeyBlob, &g_mockEd25519PriKeyBlob, &keyPair); ASSERT_EQ(res, HCF_SUCCESS); + HcfObjDestroy(keyPair); res = TestGenerateConvertKey(generator, nullptr, &g_mockEd25519PriKeyBlob, &keyPair); ASSERT_EQ(res, HCF_SUCCESS); + HcfObjDestroy(keyPair); res = TestGenerateConvertKey(generator, &g_mockEd25519PubKeyBlob, nullptr, &keyPair); ASSERT_EQ(res, HCF_SUCCESS); -- Gitee From 4352027334938b1ddbf3a46883c163edd91ef32b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E9=9D=99?= Date: Sat, 14 Sep 2024 11:55:53 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9TDD=E5=86=85=E5=AD=98?= =?UTF-8?q?=E6=B3=84=E6=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 王静 Signed-off-by: hhhFun --- .../unittest/src/ecc/crypto_ecc_no_length_sign_sub_test.cpp | 6 ++++-- .../src/ecc/crypto_ecc_no_length_verify_sub_test.cpp | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/test/unittest/src/ecc/crypto_ecc_no_length_sign_sub_test.cpp b/test/unittest/src/ecc/crypto_ecc_no_length_sign_sub_test.cpp index 16335c2..d91e34e 100644 --- a/test/unittest/src/ecc/crypto_ecc_no_length_sign_sub_test.cpp +++ b/test/unittest/src/ecc/crypto_ecc_no_length_sign_sub_test.cpp @@ -1185,6 +1185,7 @@ HWTEST_F(CryptoEccNoLengthSignSubTest, CryptoEccNoLengthSignSubTest927, TestSize HcfFree(out.data); HcfObjDestroy(sign); + HcfObjDestroy(keyPair); } HWTEST_F(CryptoEccNoLengthSignSubTest, CryptoEccNoLengthSignSubTest928, TestSize.Level0) @@ -1226,6 +1227,7 @@ HWTEST_F(CryptoEccNoLengthSignSubTest, CryptoEccNoLengthSignSubTest928, TestSize HcfFree(out.data); HcfObjDestroy(sign); + HcfObjDestroy(keyPair); } HcfSignatureParams g_params = { @@ -1455,7 +1457,7 @@ HWTEST_F(CryptoEccNoLengthSignSubTest, CryptoEccNoLengthSignSubTest1101, TestSiz HcfFree(out.data); HcfObjDestroy(sign); - + HcfObjDestroy(keyPair); uint32_t mallocCount = GetMallocNum(); MemoryMallocTestFunc(mallocCount, &input); @@ -1549,7 +1551,7 @@ HWTEST_F(CryptoEccNoLengthSignSubTest, CryptoEccNoLengthSignSubTest1102, TestSiz HcfFree(out.data); HcfObjDestroy(sign); - + HcfObjDestroy(keyPair); uint32_t mallocCount = GetOpensslCallNum(); OpensslMockTestFunc(mallocCount, &input); diff --git a/test/unittest/src/ecc/crypto_ecc_no_length_verify_sub_test.cpp b/test/unittest/src/ecc/crypto_ecc_no_length_verify_sub_test.cpp index cc74555..3bc18ca 100644 --- a/test/unittest/src/ecc/crypto_ecc_no_length_verify_sub_test.cpp +++ b/test/unittest/src/ecc/crypto_ecc_no_length_verify_sub_test.cpp @@ -2080,6 +2080,7 @@ HWTEST_F(CryptoEccNoLengthVerifySubTest, CryptoEccNoLengthVerifySubTest601, Test uint32_t mallocCount = GetMallocNum(); MemoryMockTestFunc(mallocCount, &out); + HcfFree(out.data); EndRecordMallocNum(); } @@ -2135,6 +2136,7 @@ HWTEST_F(CryptoEccNoLengthVerifySubTest, CryptoEccNoLengthVerifySubTest602, Test uint32_t mallocCount = GetOpensslCallNum(); OpensslMockTestFunc(mallocCount, &out); + HcfFree(out.data); EndRecordOpensslCallNum(); } } -- Gitee From ec4893be33439f95f012ba2aac1d526dfd61887f Mon Sep 17 00:00:00 2001 From: lcc Date: Sat, 14 Sep 2024 14:30:13 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9TDD=E5=86=85=E5=AD=98?= =?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: lcc Signed-off-by: hhhFun --- ...pto_dsa_asy_key_generator_by_spec_test.cpp | 2 +- .../src/crypto_dsa_asy_key_generator_test.cpp | 20 ++--- .../src/crypto_rsa_asy_key_generator_test.cpp | 2 - .../src/ecc/crypto_ecc_sign_sub_test.cpp | 4 + .../src/ecc/crypto_ecc_verify_sub_test.cpp | 2 + .../src/native/native_asym_key_test.cpp | 1 + .../src/native/native_sym_key_test.cpp | 1 + ...pto_sm2_asy_key_generator_by_spec_test.cpp | 86 +++++++++++++++++-- 8 files changed, 96 insertions(+), 22 deletions(-) diff --git a/test/unittest/src/crypto_dsa_asy_key_generator_by_spec_test.cpp b/test/unittest/src/crypto_dsa_asy_key_generator_by_spec_test.cpp index 05b00a3..a85af2f 100644 --- a/test/unittest/src/crypto_dsa_asy_key_generator_by_spec_test.cpp +++ b/test/unittest/src/crypto_dsa_asy_key_generator_by_spec_test.cpp @@ -308,7 +308,7 @@ HWTEST_F(CryptoDsaAsyKeyGeneratorBySpecTest, CryptoDsaAsyKeyGeneratorBySpecTest1 const char *className = generator->base.getClass(); HcfObjDestroy(generator); - ASSERT_EQ(className, g_asyKeyGeneratorBySpecClass); + ASSERT_EQ(&className, &g_asyKeyGeneratorBySpecClass); } HWTEST_F(CryptoDsaAsyKeyGeneratorBySpecTest, CryptoDsaAsyKeyGeneratorBySpecTest102, TestSize.Level0) diff --git a/test/unittest/src/crypto_dsa_asy_key_generator_test.cpp b/test/unittest/src/crypto_dsa_asy_key_generator_test.cpp index 6257d41..50393d4 100644 --- a/test/unittest/src/crypto_dsa_asy_key_generator_test.cpp +++ b/test/unittest/src/crypto_dsa_asy_key_generator_test.cpp @@ -292,7 +292,7 @@ HWTEST_F(CryptoDsaAsyKeyGeneratorTest, CryptoDsaAsyKeyGeneratorTest203, TestSize HWTEST_F(CryptoDsaAsyKeyGeneratorTest, CryptoDsaAsyKeyGeneratorTest301, TestSize.Level0) { const char *className = dsa2048KeyPair_->base.getClass(); - ASSERT_EQ(className, OPENSSL_DSA_KEYPAIR_CLASS); + EXPECT_STREQ(className, OPENSSL_DSA_KEYPAIR_CLASS); } HWTEST_F(CryptoDsaAsyKeyGeneratorTest, CryptoDsaAsyKeyGeneratorTest302, TestSize.Level0) @@ -319,7 +319,7 @@ HWTEST_F(CryptoDsaAsyKeyGeneratorTest, CryptoDsaAsyKeyGeneratorTest305, TestSize dsa2048KeyPair_->base.destroy((HcfObjectBase *)&g_obj); const char *pkClassName = dsa2048KeyPair_->pubKey->base.base.getClass(); - ASSERT_EQ(pkClassName, OPENSSL_DSA_PUBKEY_CLASS); + EXPECT_STREQ(pkClassName, OPENSSL_DSA_PUBKEY_CLASS); } HWTEST_F(CryptoDsaAsyKeyGeneratorTest, CryptoDsaAsyKeyGeneratorTest306, TestSize.Level0) @@ -348,7 +348,7 @@ HWTEST_F(CryptoDsaAsyKeyGeneratorTest, CryptoDsaAsyKeyGeneratorTest309, TestSize dsa2048KeyPair_->pubKey->base.base.destroy((HcfObjectBase *)&g_obj); const char *alg = dsa2048KeyPair_->pubKey->base.getAlgorithm(&(dsa2048KeyPair_->pubKey->base)); - ASSERT_EQ(alg, g_algNameDSA); + EXPECT_STREQ(alg, g_algNameDSA); } HWTEST_F(CryptoDsaAsyKeyGeneratorTest, CryptoDsaAsyKeyGeneratorTest310, TestSize.Level1) @@ -475,7 +475,7 @@ HWTEST_F(CryptoDsaAsyKeyGeneratorTest, CryptoDsaAsyKeyGeneratorTest323, TestSize HWTEST_F(CryptoDsaAsyKeyGeneratorTest, CryptoDsaAsyKeyGeneratorTest324, TestSize.Level0) { const char *skClassName = dsa2048KeyPair_->priKey->base.base.getClass(); - ASSERT_EQ(skClassName, OPENSSL_DSA_PRIKEY_CLASS); + EXPECT_STREQ(skClassName, OPENSSL_DSA_PRIKEY_CLASS); } HWTEST_F(CryptoDsaAsyKeyGeneratorTest, CryptoDsaAsyKeyGeneratorTest325, TestSize.Level0) @@ -501,7 +501,7 @@ HWTEST_F(CryptoDsaAsyKeyGeneratorTest, CryptoDsaAsyKeyGeneratorTest325, TestSize HWTEST_F(CryptoDsaAsyKeyGeneratorTest, CryptoDsaAsyKeyGeneratorTest326, TestSize.Level0) { const char *alg = dsa2048KeyPair_->priKey->base.getAlgorithm(&(dsa2048KeyPair_->priKey->base)); - ASSERT_EQ(alg, g_algNameDSA); + EXPECT_STREQ(alg, g_algNameDSA); } HWTEST_F(CryptoDsaAsyKeyGeneratorTest, CryptoDsaAsyKeyGeneratorTest327, TestSize.Level0) @@ -675,7 +675,7 @@ HWTEST_F(CryptoDsaAsyKeyGeneratorTest, CryptoDsaAsyKeyGeneratorTest501, TestSize EXPECT_NE(convertKeyPair, nullptr); const char *keyPairClassName = convertKeyPair->base.getClass(); - EXPECT_EQ(keyPairClassName, OPENSSL_DSA_KEYPAIR_CLASS); + EXPECT_STREQ(keyPairClassName, OPENSSL_DSA_KEYPAIR_CLASS); HcfObjDestroy(generator); HcfObjDestroy(convertKeyPair); @@ -718,7 +718,7 @@ HWTEST_F(CryptoDsaAsyKeyGeneratorTest, CryptoDsaAsyKeyGeneratorTest503, TestSize EXPECT_NE(convertKeyPair, nullptr); const char *pkClassName = convertKeyPair->pubKey->base.base.getClass(); - EXPECT_EQ(pkClassName, OPENSSL_DSA_PUBKEY_CLASS); + EXPECT_STREQ(pkClassName, OPENSSL_DSA_PUBKEY_CLASS); HcfObjDestroy(generator); HcfObjDestroy(convertKeyPair); @@ -764,7 +764,7 @@ HWTEST_F(CryptoDsaAsyKeyGeneratorTest, CryptoDsaAsyKeyGeneratorTest505, TestSize EXPECT_NE(convertKeyPair, nullptr); const char *alg = convertKeyPair->pubKey->base.getAlgorithm(&(convertKeyPair->pubKey->base)); - EXPECT_EQ(alg, g_algNameDSA); + EXPECT_STREQ(alg, g_algNameDSA); HcfObjDestroy(generator); HcfObjDestroy(convertKeyPair); @@ -944,7 +944,7 @@ HWTEST_F(CryptoDsaAsyKeyGeneratorTest, CryptoDsaAsyKeyGeneratorTest512, TestSize EXPECT_NE(convertKeyPair, nullptr); const char *skClassName = convertKeyPair->priKey->base.base.getClass(); - EXPECT_EQ(skClassName, OPENSSL_DSA_PRIKEY_CLASS); + EXPECT_STREQ(skClassName, OPENSSL_DSA_PRIKEY_CLASS); HcfObjDestroy(generator); HcfObjDestroy(convertKeyPair); @@ -989,7 +989,7 @@ HWTEST_F(CryptoDsaAsyKeyGeneratorTest, CryptoDsaAsyKeyGeneratorTest514, TestSize EXPECT_NE(convertKeyPair, nullptr); const char *skAlg = convertKeyPair->priKey->base.getAlgorithm(&(convertKeyPair->priKey->base)); - EXPECT_EQ(skAlg, g_algNameDSA); + EXPECT_STREQ(skAlg, g_algNameDSA); HcfObjDestroy(generator); HcfObjDestroy(convertKeyPair); diff --git a/test/unittest/src/crypto_rsa_asy_key_generator_test.cpp b/test/unittest/src/crypto_rsa_asy_key_generator_test.cpp index c5b99a0..bfbea49 100644 --- a/test/unittest/src/crypto_rsa_asy_key_generator_test.cpp +++ b/test/unittest/src/crypto_rsa_asy_key_generator_test.cpp @@ -470,8 +470,6 @@ HWTEST_F(CryptoRsaAsyKeyGeneratorTest, CryptoRsaAsyKeyGeneratorTest511, TestSize EXPECT_NE(res, HCF_SUCCESS); HcfObjDestroy(keyPair); HcfObjDestroy(generator); - HcfFree(pubKeyBlob.data); - HcfFree(priKeyBlob.data); } HWTEST_F(CryptoRsaAsyKeyGeneratorTest, CryptoRsaAsyKeyGeneratorTest512, TestSize.Level0) diff --git a/test/unittest/src/ecc/crypto_ecc_sign_sub_test.cpp b/test/unittest/src/ecc/crypto_ecc_sign_sub_test.cpp index c557a31..2dfeea0 100644 --- a/test/unittest/src/ecc/crypto_ecc_sign_sub_test.cpp +++ b/test/unittest/src/ecc/crypto_ecc_sign_sub_test.cpp @@ -997,6 +997,7 @@ HWTEST_F(CryptoEccSignSubTest, CryptoEccSignSubTest927, TestSize.Level0) HcfFree(out.data); HcfObjDestroy(sign); + HcfObjDestroy(keyPair); } HWTEST_F(CryptoEccSignSubTest, CryptoEccSignSubTest928, TestSize.Level0) @@ -1038,6 +1039,7 @@ HWTEST_F(CryptoEccSignSubTest, CryptoEccSignSubTest928, TestSize.Level0) HcfFree(out.data); HcfObjDestroy(sign); + HcfObjDestroy(keyPair); } HWTEST_F(CryptoEccSignSubTest, CryptoEccSignSubTest1001, TestSize.Level0) @@ -1323,6 +1325,7 @@ HWTEST_F(CryptoEccSignSubTest, CryptoEccSignSubTest1101, TestSize.Level0) HcfFree(out.data); HcfObjDestroy(sign); + HcfObjDestroy(keyPair); uint32_t mallocCount = GetMallocNum(); MemoryMallocTestFunc(mallocCount, &input); @@ -1417,6 +1420,7 @@ HWTEST_F(CryptoEccSignSubTest, CryptoEccSignSubTest1102, TestSize.Level0) HcfFree(out.data); HcfObjDestroy(sign); + HcfObjDestroy(keyPair); uint32_t mallocCount = GetOpensslCallNum(); OpensslMockTestFunc(mallocCount, &input); diff --git a/test/unittest/src/ecc/crypto_ecc_verify_sub_test.cpp b/test/unittest/src/ecc/crypto_ecc_verify_sub_test.cpp index 385624d..15e189c 100644 --- a/test/unittest/src/ecc/crypto_ecc_verify_sub_test.cpp +++ b/test/unittest/src/ecc/crypto_ecc_verify_sub_test.cpp @@ -1902,6 +1902,7 @@ HWTEST_F(CryptoEccVerifySubTest, CryptoEccVerifySubTest601, TestSize.Level0) ASSERT_EQ(flag, true); HcfObjDestroy(verify); + HcfBlobDataFree((HcfBlob *)&out); uint32_t mallocCount = GetMallocNum(); MemoryMockTestFunc(mallocCount, &out); @@ -1960,6 +1961,7 @@ HWTEST_F(CryptoEccVerifySubTest, CryptoEccVerifySubTest602, TestSize.Level0) uint32_t mallocCount = GetOpensslCallNum(); OpensslMockTestFunc(mallocCount, &out); + HcfBlobDataFree((HcfBlob *)&out); EndRecordOpensslCallNum(); } } diff --git a/test/unittest/src/native/native_asym_key_test.cpp b/test/unittest/src/native/native_asym_key_test.cpp index fc0dea1..f949d65 100644 --- a/test/unittest/src/native/native_asym_key_test.cpp +++ b/test/unittest/src/native/native_asym_key_test.cpp @@ -173,6 +173,7 @@ HWTEST_F(NativeAsymKeyTest, NativeAsymKeyTest004, TestSize.Level0) OH_CryptoAsymKeyGenerator_Destroy(ctx); OH_CryptoKeyPair_Destroy(keyPair); + OH_Crypto_FreeDataBlob(&retBlob); OH_CryptoKeyPair_Destroy(dupKeyPair); } diff --git a/test/unittest/src/native/native_sym_key_test.cpp b/test/unittest/src/native/native_sym_key_test.cpp index 79bc861..4730d88 100644 --- a/test/unittest/src/native/native_sym_key_test.cpp +++ b/test/unittest/src/native/native_sym_key_test.cpp @@ -79,6 +79,7 @@ HWTEST_F(NativeSymKeyTest, NativeSymKeyTest002, TestSize.Level0) ASSERT_NE(algoName, nullptr); OH_CryptoSymKey_Destroy(symKey); + OH_Crypto_FreeDataBlob(&dataBlob); OH_CryptoSymKeyGenerator_Destroy(ctx); } } \ No newline at end of file diff --git a/test/unittest/src/sm2/crypto_sm2_asy_key_generator_by_spec_test.cpp b/test/unittest/src/sm2/crypto_sm2_asy_key_generator_by_spec_test.cpp index c86b00c..c1aae3c 100644 --- a/test/unittest/src/sm2/crypto_sm2_asy_key_generator_by_spec_test.cpp +++ b/test/unittest/src/sm2/crypto_sm2_asy_key_generator_by_spec_test.cpp @@ -102,6 +102,7 @@ HWTEST_F(CryptoSm2AsyKeyGeneratorBySpecTest, CryptoSm2AsyKeyGeneratorBySpecTest0 HcfObjDestroy(generator); FreeEccCommParamsSpec(reinterpret_cast(paramSpec)); + HcfFree(paramSpec); } HWTEST_F(CryptoSm2AsyKeyGeneratorBySpecTest, CryptoSm2AsyKeyGeneratorBySpecTest002, TestSize.Level0) @@ -127,6 +128,7 @@ HWTEST_F(CryptoSm2AsyKeyGeneratorBySpecTest, CryptoSm2AsyKeyGeneratorBySpecTest0 res = HcfAsyKeyGeneratorBySpecCreate(paramSpec, nullptr); ASSERT_NE(res, HCF_SUCCESS); FreeEccCommParamsSpec(reinterpret_cast(paramSpec)); + HcfFree(paramSpec); } HWTEST_F(CryptoSm2AsyKeyGeneratorBySpecTest, CryptoSm2AsyKeyGeneratorBySpecTest004, TestSize.Level0) @@ -148,6 +150,7 @@ HWTEST_F(CryptoSm2AsyKeyGeneratorBySpecTest, CryptoSm2AsyKeyGeneratorBySpecTest0 HcfObjDestroy(generator); FreeEccCommParamsSpec(reinterpret_cast(paramSpec)); + HcfFree(paramSpec); } HWTEST_F(CryptoSm2AsyKeyGeneratorBySpecTest, CryptoSm2AsyKeyGeneratorBySpecTest005, TestSize.Level0) @@ -166,6 +169,7 @@ HWTEST_F(CryptoSm2AsyKeyGeneratorBySpecTest, CryptoSm2AsyKeyGeneratorBySpecTest0 generator->base.destroy((HcfObjectBase *)generator); FreeEccCommParamsSpec(reinterpret_cast(paramSpec)); + HcfFree(paramSpec); } HWTEST_F(CryptoSm2AsyKeyGeneratorBySpecTest, CryptoSm2AsyKeyGeneratorBySpecTest006, TestSize.Level0) @@ -185,6 +189,7 @@ HWTEST_F(CryptoSm2AsyKeyGeneratorBySpecTest, CryptoSm2AsyKeyGeneratorBySpecTest0 generator->base.destroy(nullptr); HcfObjDestroy(generator); FreeEccCommParamsSpec(reinterpret_cast(paramSpec)); + HcfFree(paramSpec); } HWTEST_F(CryptoSm2AsyKeyGeneratorBySpecTest, CryptoSm2AsyKeyGeneratorBySpecTest007, TestSize.Level0) @@ -203,6 +208,7 @@ HWTEST_F(CryptoSm2AsyKeyGeneratorBySpecTest, CryptoSm2AsyKeyGeneratorBySpecTest0 generator->base.destroy(&g_obj); HcfObjDestroy(generator); + FreeAsyKeySpec(paramSpec); } HWTEST_F(CryptoSm2AsyKeyGeneratorBySpecTest, CryptoSm2AsyKeyGeneratorBySpecTest008, TestSize.Level0) @@ -223,6 +229,7 @@ HWTEST_F(CryptoSm2AsyKeyGeneratorBySpecTest, CryptoSm2AsyKeyGeneratorBySpecTest0 HcfObjDestroy(generator); FreeEccCommParamsSpec(reinterpret_cast(paramSpec)); + HcfFree(paramSpec); } HWTEST_F(CryptoSm2AsyKeyGeneratorBySpecTest, CryptoSm2AsyKeyGeneratorBySpecTest009, TestSize.Level0) @@ -243,6 +250,7 @@ HWTEST_F(CryptoSm2AsyKeyGeneratorBySpecTest, CryptoSm2AsyKeyGeneratorBySpecTest0 ASSERT_EQ(algName, nullptr); HcfObjDestroy(generator); + FreeAsyKeySpec(paramSpec); } @@ -264,6 +272,7 @@ HWTEST_F(CryptoSm2AsyKeyGeneratorBySpecTest, CryptoSm2AsyKeyGeneratorBySpecTest0 HcfObjDestroy(generator); FreeEccCommParamsSpec(reinterpret_cast(paramSpec)); + HcfFree(paramSpec); } HWTEST_F(CryptoSm2AsyKeyGeneratorBySpecTest, CryptoSm2AsyKeyGeneratorBySpecTest011, TestSize.Level0) @@ -288,14 +297,16 @@ HWTEST_F(CryptoSm2AsyKeyGeneratorBySpecTest, CryptoSm2AsyKeyGeneratorBySpecTest0 HcfObjDestroy(keyPair); HcfObjDestroy(generator); DestroyEccKeyPairSpec(reinterpret_cast(paramSpec)); + HcfFree(g_eccCommSpec); } HWTEST_F(CryptoSm2AsyKeyGeneratorBySpecTest, CryptoSm2AsyKeyGeneratorBySpecTest012, TestSize.Level0) { - ConstructEccKeyPairCommParamsSpec("NID_sm2", &g_eccCommSpec); - ASSERT_NE(g_eccCommSpec, nullptr); + HcfEccCommParamsSpec *eccCommSpec = nullptr; + ConstructEccKeyPairCommParamsSpec("NID_sm2", &eccCommSpec); + ASSERT_NE(eccCommSpec, nullptr); HcfAsyKeyParamsSpec *paramSpec = nullptr; - HcfResult res = ConstructEccKeyPairParamsSpec(g_sm2AlgName.c_str(), g_eccCommSpec, ¶mSpec); + HcfResult res = ConstructEccKeyPairParamsSpec(g_sm2AlgName.c_str(), eccCommSpec, ¶mSpec); ASSERT_EQ(res, HCF_SUCCESS); ASSERT_NE(paramSpec, nullptr); @@ -314,6 +325,8 @@ HWTEST_F(CryptoSm2AsyKeyGeneratorBySpecTest, CryptoSm2AsyKeyGeneratorBySpecTest0 HcfObjDestroy(keyPair); HcfObjDestroy(generator); + FreeAsyKeySpec(paramSpec); + HcfFree(eccCommSpec); } HWTEST_F(CryptoSm2AsyKeyGeneratorBySpecTest, CryptoSm2AsyKeyGeneratorBySpecTest013, TestSize.Level0) @@ -335,6 +348,7 @@ HWTEST_F(CryptoSm2AsyKeyGeneratorBySpecTest, CryptoSm2AsyKeyGeneratorBySpecTest0 HcfObjDestroy(generator); DestroyEccKeyPairSpec(reinterpret_cast(paramSpec)); + HcfFree(g_eccCommSpec); } HWTEST_F(CryptoSm2AsyKeyGeneratorBySpecTest, CryptoSm2AsyKeyGeneratorBySpecTest014, TestSize.Level0) @@ -356,6 +370,7 @@ HWTEST_F(CryptoSm2AsyKeyGeneratorBySpecTest, CryptoSm2AsyKeyGeneratorBySpecTest0 HcfObjDestroy(generator); DestroyEccKeyPairSpec(reinterpret_cast(paramSpec)); + HcfFree(g_eccCommSpec); } HWTEST_F(CryptoSm2AsyKeyGeneratorBySpecTest, CryptoSm2AsyKeyGeneratorBySpecTest015, TestSize.Level0) @@ -383,6 +398,7 @@ HWTEST_F(CryptoSm2AsyKeyGeneratorBySpecTest, CryptoSm2AsyKeyGeneratorBySpecTest0 HcfObjDestroy(keyPair); HcfObjDestroy(generator); DestroyEccKeyPairSpec(reinterpret_cast(paramSpec)); + HcfFree(g_eccCommSpec); } HWTEST_F(CryptoSm2AsyKeyGeneratorBySpecTest, CryptoSm2AsyKeyGeneratorBySpecTest016, TestSize.Level0) @@ -407,6 +423,7 @@ HWTEST_F(CryptoSm2AsyKeyGeneratorBySpecTest, CryptoSm2AsyKeyGeneratorBySpecTest0 keyPair->base.destroy((HcfObjectBase *)(&(keyPair->base))); HcfObjDestroy(generator); DestroyEccKeyPairSpec(reinterpret_cast(paramSpec)); + HcfFree(g_eccCommSpec); } HWTEST_F(CryptoSm2AsyKeyGeneratorBySpecTest, CryptoSm2AsyKeyGeneratorBySpecTest017, TestSize.Level0) @@ -432,6 +449,7 @@ HWTEST_F(CryptoSm2AsyKeyGeneratorBySpecTest, CryptoSm2AsyKeyGeneratorBySpecTest0 HcfObjDestroy(keyPair); HcfObjDestroy(generator); DestroyEccKeyPairSpec(reinterpret_cast(paramSpec)); + HcfFree(g_eccCommSpec); } HWTEST_F(CryptoSm2AsyKeyGeneratorBySpecTest, CryptoSm2AsyKeyGeneratorBySpecTest018, TestSize.Level0) @@ -457,6 +475,7 @@ HWTEST_F(CryptoSm2AsyKeyGeneratorBySpecTest, CryptoSm2AsyKeyGeneratorBySpecTest0 HcfObjDestroy(keyPair); HcfObjDestroy(generator); DestroyEccKeyPairSpec(reinterpret_cast(paramSpec)); + HcfFree(g_eccCommSpec); } HWTEST_F(CryptoSm2AsyKeyGeneratorBySpecTest, CryptoSm2AsyKeyGeneratorBySpecTest019, TestSize.Level0) @@ -484,6 +503,7 @@ HWTEST_F(CryptoSm2AsyKeyGeneratorBySpecTest, CryptoSm2AsyKeyGeneratorBySpecTest0 HcfObjDestroy(keyPair); HcfObjDestroy(generator); DestroyEccKeyPairSpec(reinterpret_cast(paramSpec)); + HcfFree(g_eccCommSpec); } HWTEST_F(CryptoSm2AsyKeyGeneratorBySpecTest, CryptoSm2AsyKeyGeneratorBySpecTest020, TestSize.Level0) @@ -511,6 +531,7 @@ HWTEST_F(CryptoSm2AsyKeyGeneratorBySpecTest, CryptoSm2AsyKeyGeneratorBySpecTest0 HcfObjDestroy(keyPair); HcfObjDestroy(generator); DestroyEccKeyPairSpec(reinterpret_cast(paramSpec)); + HcfFree(g_eccCommSpec); } @@ -537,6 +558,7 @@ HWTEST_F(CryptoSm2AsyKeyGeneratorBySpecTest, CryptoSm2AsyKeyGeneratorBySpecTest0 HcfObjDestroy(keyPair); HcfObjDestroy(generator); DestroyEccKeyPairSpec(reinterpret_cast(paramSpec)); + HcfFree(g_eccCommSpec); } @@ -563,14 +585,16 @@ HWTEST_F(CryptoSm2AsyKeyGeneratorBySpecTest, CryptoSm2AsyKeyGeneratorBySpecTest0 HcfObjDestroy(keyPair); HcfObjDestroy(generator); DestroyEccKeyPairSpec(reinterpret_cast(paramSpec)); + HcfFree(g_eccCommSpec); } HWTEST_F(CryptoSm2AsyKeyGeneratorBySpecTest, CryptoSm2AsyKeyGeneratorBySpecTest023, TestSize.Level0) { - ConstructEccKeyPairCommParamsSpec("NID_sm2", &g_eccCommSpec); - ASSERT_NE(g_eccCommSpec, nullptr); + HcfEccCommParamsSpec *eccCommSpec = nullptr; + ConstructEccKeyPairCommParamsSpec("NID_sm2", &eccCommSpec); + ASSERT_NE(eccCommSpec, nullptr); HcfAsyKeyParamsSpec *paramSpec = nullptr; - HcfResult res = ConstructEccKeyPairParamsSpec(g_sm2AlgName.c_str(), g_eccCommSpec, ¶mSpec); + HcfResult res = ConstructEccKeyPairParamsSpec(g_sm2AlgName.c_str(), eccCommSpec, ¶mSpec); ASSERT_EQ(res, HCF_SUCCESS); ASSERT_NE(paramSpec, nullptr); @@ -590,6 +614,7 @@ HWTEST_F(CryptoSm2AsyKeyGeneratorBySpecTest, CryptoSm2AsyKeyGeneratorBySpecTest0 HcfObjDestroy(keyPair); HcfObjDestroy(generator); DestroyEccKeyPairSpec(reinterpret_cast(paramSpec)); + HcfFree(eccCommSpec); } HWTEST_F(CryptoSm2AsyKeyGeneratorBySpecTest, CryptoSm2AsyKeyGeneratorBySpecTest024, TestSize.Level0) @@ -617,6 +642,7 @@ HWTEST_F(CryptoSm2AsyKeyGeneratorBySpecTest, CryptoSm2AsyKeyGeneratorBySpecTest0 HcfObjDestroy(keyPair); HcfObjDestroy(generator); DestroyEccKeyPairSpec(reinterpret_cast(paramSpec)); + HcfFree(g_eccCommSpec); } @@ -645,6 +671,7 @@ HWTEST_F(CryptoSm2AsyKeyGeneratorBySpecTest, CryptoSm2AsyKeyGeneratorBySpecTest0 HcfObjDestroy(keyPair); HcfObjDestroy(generator); DestroyEccKeyPairSpec(reinterpret_cast(paramSpec)); + HcfFree(g_eccCommSpec); } @@ -673,6 +700,7 @@ HWTEST_F(CryptoSm2AsyKeyGeneratorBySpecTest, CryptoSm2AsyKeyGeneratorBySpecTest0 HcfObjDestroy(keyPair); HcfObjDestroy(generator); DestroyEccKeyPairSpec(reinterpret_cast(paramSpec)); + HcfFree(g_eccCommSpec); } HWTEST_F(CryptoSm2AsyKeyGeneratorBySpecTest, CryptoSm2AsyKeyGeneratorBySpecTest027, TestSize.Level0) @@ -700,6 +728,7 @@ HWTEST_F(CryptoSm2AsyKeyGeneratorBySpecTest, CryptoSm2AsyKeyGeneratorBySpecTest0 HcfObjDestroy(keyPair); HcfObjDestroy(generator); DestroyEccKeyPairSpec(reinterpret_cast(paramSpec)); + HcfFree(g_eccCommSpec); } HWTEST_F(CryptoSm2AsyKeyGeneratorBySpecTest, CryptoSm2AsyKeyGeneratorBySpecTest028, TestSize.Level0) @@ -727,6 +756,7 @@ HWTEST_F(CryptoSm2AsyKeyGeneratorBySpecTest, CryptoSm2AsyKeyGeneratorBySpecTest0 HcfObjDestroy(keyPair); HcfObjDestroy(generator); DestroyEccKeyPairSpec(reinterpret_cast(paramSpec)); + HcfFree(g_eccCommSpec); } HWTEST_F(CryptoSm2AsyKeyGeneratorBySpecTest, CryptoSm2AsyKeyGeneratorBySpecTest029, TestSize.Level0) @@ -758,6 +788,7 @@ HWTEST_F(CryptoSm2AsyKeyGeneratorBySpecTest, CryptoSm2AsyKeyGeneratorBySpecTest0 HcfObjDestroy(keyPair); HcfObjDestroy(generator); DestroyEccKeyPairSpec(reinterpret_cast(paramSpec)); + HcfFree(g_eccCommSpec); } HWTEST_F(CryptoSm2AsyKeyGeneratorBySpecTest, CryptoSm2AsyKeyGeneratorBySpecTest030, TestSize.Level0) @@ -789,6 +820,7 @@ HWTEST_F(CryptoSm2AsyKeyGeneratorBySpecTest, CryptoSm2AsyKeyGeneratorBySpecTest0 HcfObjDestroy(keyPair); HcfObjDestroy(generator); DestroyEccKeyPairSpec(reinterpret_cast(paramSpec)); + HcfFree(g_eccCommSpec); } HWTEST_F(CryptoSm2AsyKeyGeneratorBySpecTest, CryptoSm2AsyKeyGeneratorBySpecTest031, TestSize.Level0) @@ -820,6 +852,7 @@ HWTEST_F(CryptoSm2AsyKeyGeneratorBySpecTest, CryptoSm2AsyKeyGeneratorBySpecTest0 HcfObjDestroy(keyPair); HcfObjDestroy(generator); DestroyEccKeyPairSpec(reinterpret_cast(paramSpec)); + HcfFree(g_eccCommSpec); } HWTEST_F(CryptoSm2AsyKeyGeneratorBySpecTest, CryptoSm2AsyKeyGeneratorBySpecTest032, TestSize.Level0) @@ -847,6 +880,7 @@ HWTEST_F(CryptoSm2AsyKeyGeneratorBySpecTest, CryptoSm2AsyKeyGeneratorBySpecTest0 HcfObjDestroy(keyPair); HcfObjDestroy(generator); DestroyEccKeyPairSpec(reinterpret_cast(paramSpec)); + HcfFree(g_eccCommSpec); } HWTEST_F(CryptoSm2AsyKeyGeneratorBySpecTest, CryptoSm2AsyKeyGeneratorBySpecTest033, TestSize.Level0) @@ -872,6 +906,7 @@ HWTEST_F(CryptoSm2AsyKeyGeneratorBySpecTest, CryptoSm2AsyKeyGeneratorBySpecTest0 HcfObjDestroy(keyPair); HcfObjDestroy(generator); DestroyEccKeyPairSpec(reinterpret_cast(paramSpec)); + HcfFree(g_eccCommSpec); } HWTEST_F(CryptoSm2AsyKeyGeneratorBySpecTest, CryptoSm2AsyKeyGeneratorBySpecTest034, TestSize.Level0) @@ -897,6 +932,7 @@ HWTEST_F(CryptoSm2AsyKeyGeneratorBySpecTest, CryptoSm2AsyKeyGeneratorBySpecTest0 HcfObjDestroy(keyPair); HcfObjDestroy(generator); DestroyEccKeyPairSpec(reinterpret_cast(paramSpec)); + HcfFree(g_eccCommSpec); } HWTEST_F(CryptoSm2AsyKeyGeneratorBySpecTest, CryptoSm2AsyKeyGeneratorBySpecTest035, TestSize.Level0) @@ -921,6 +957,7 @@ HWTEST_F(CryptoSm2AsyKeyGeneratorBySpecTest, CryptoSm2AsyKeyGeneratorBySpecTest0 HcfObjDestroy(keyPair); HcfObjDestroy(generator); DestroyEccKeyPairSpec(reinterpret_cast(paramSpec)); + HcfFree(g_eccCommSpec); } HWTEST_F(CryptoSm2AsyKeyGeneratorBySpecTest, CryptoSm2AsyKeyGeneratorBySpecTest036, TestSize.Level0) @@ -948,6 +985,7 @@ HWTEST_F(CryptoSm2AsyKeyGeneratorBySpecTest, CryptoSm2AsyKeyGeneratorBySpecTest0 HcfObjDestroy(keyPair); HcfObjDestroy(generator); DestroyEccKeyPairSpec(reinterpret_cast(paramSpec)); + HcfFree(g_eccCommSpec); } HWTEST_F(CryptoSm2AsyKeyGeneratorBySpecTest, CryptoSm2AsyKeyGeneratorBySpecTest037, TestSize.Level0) @@ -974,15 +1012,17 @@ HWTEST_F(CryptoSm2AsyKeyGeneratorBySpecTest, CryptoSm2AsyKeyGeneratorBySpecTest0 HcfObjDestroy(keyPair); HcfObjDestroy(generator); DestroyEccKeyPairSpec(reinterpret_cast(paramSpec)); + HcfFree(g_eccCommSpec); } HWTEST_F(CryptoSm2AsyKeyGeneratorBySpecTest, CryptoSm2AsyKeyGeneratorBySpecTest038, TestSize.Level0) { - ConstructEccKeyPairCommParamsSpec("NID_sm2", &g_eccCommSpec); - ASSERT_NE(g_eccCommSpec, nullptr); + HcfEccCommParamsSpec *eccCommSpec = nullptr; + ConstructEccKeyPairCommParamsSpec("NID_sm2", &eccCommSpec); + ASSERT_NE(eccCommSpec, nullptr); HcfAsyKeyParamsSpec *paramSpec = nullptr; - HcfResult res = ConstructEccKeyPairParamsSpec(g_sm2AlgName.c_str(), g_eccCommSpec, ¶mSpec); + HcfResult res = ConstructEccKeyPairParamsSpec(g_sm2AlgName.c_str(), eccCommSpec, ¶mSpec); ASSERT_EQ(res, HCF_SUCCESS); ASSERT_NE(paramSpec, nullptr); @@ -1000,6 +1040,7 @@ HWTEST_F(CryptoSm2AsyKeyGeneratorBySpecTest, CryptoSm2AsyKeyGeneratorBySpecTest0 HcfObjDestroy(keyPair); HcfObjDestroy(generator); DestroyEccKeyPairSpec(reinterpret_cast(paramSpec)); + HcfFree(eccCommSpec); } @@ -1026,6 +1067,7 @@ HWTEST_F(CryptoSm2AsyKeyGeneratorBySpecTest, CryptoSm2AsyKeyGeneratorBySpecTest0 HcfObjDestroy(keyPair); HcfObjDestroy(generator); DestroyEccKeyPairSpec(reinterpret_cast(paramSpec)); + HcfFree(g_eccCommSpec); } HWTEST_F(CryptoSm2AsyKeyGeneratorBySpecTest, CryptoSm2AsyKeyGeneratorBySpecTest040, TestSize.Level0) @@ -1053,6 +1095,7 @@ HWTEST_F(CryptoSm2AsyKeyGeneratorBySpecTest, CryptoSm2AsyKeyGeneratorBySpecTest0 HcfObjDestroy(keyPair); HcfObjDestroy(generator); DestroyEccKeyPairSpec(reinterpret_cast(paramSpec)); + HcfFree(g_eccCommSpec); } HWTEST_F(CryptoSm2AsyKeyGeneratorBySpecTest, CryptoSm2AsyKeyGeneratorBySpecTest041, TestSize.Level0) @@ -1080,6 +1123,7 @@ HWTEST_F(CryptoSm2AsyKeyGeneratorBySpecTest, CryptoSm2AsyKeyGeneratorBySpecTest0 HcfObjDestroy(keyPair); HcfObjDestroy(generator); DestroyEccKeyPairSpec(reinterpret_cast(paramSpec)); + HcfFree(g_eccCommSpec); } @@ -1108,6 +1152,7 @@ HWTEST_F(CryptoSm2AsyKeyGeneratorBySpecTest, CryptoSm2AsyKeyGeneratorBySpecTest0 HcfObjDestroy(keyPair); HcfObjDestroy(generator); DestroyEccKeyPairSpec(reinterpret_cast(paramSpec)); + HcfFree(g_eccCommSpec); } @@ -1136,6 +1181,7 @@ HWTEST_F(CryptoSm2AsyKeyGeneratorBySpecTest, CryptoSm2AsyKeyGeneratorBySpecTest0 HcfObjDestroy(keyPair); HcfObjDestroy(generator); DestroyEccKeyPairSpec(reinterpret_cast(paramSpec)); + HcfFree(g_eccCommSpec); } HWTEST_F(CryptoSm2AsyKeyGeneratorBySpecTest, CryptoSm2AsyKeyGeneratorBySpecTest044, TestSize.Level0) @@ -1163,6 +1209,7 @@ HWTEST_F(CryptoSm2AsyKeyGeneratorBySpecTest, CryptoSm2AsyKeyGeneratorBySpecTest0 HcfObjDestroy(keyPair); HcfObjDestroy(generator); DestroyEccKeyPairSpec(reinterpret_cast(paramSpec)); + HcfFree(g_eccCommSpec); } HWTEST_F(CryptoSm2AsyKeyGeneratorBySpecTest, CryptoSm2AsyKeyGeneratorBySpecTest045, TestSize.Level0) @@ -1190,6 +1237,7 @@ HWTEST_F(CryptoSm2AsyKeyGeneratorBySpecTest, CryptoSm2AsyKeyGeneratorBySpecTest0 HcfObjDestroy(keyPair); HcfObjDestroy(generator); DestroyEccKeyPairSpec(reinterpret_cast(paramSpec)); + HcfFree(g_eccCommSpec); } HWTEST_F(CryptoSm2AsyKeyGeneratorBySpecTest, CryptoSm2AsyKeyGeneratorBySpecTest046, TestSize.Level0) @@ -1221,6 +1269,7 @@ HWTEST_F(CryptoSm2AsyKeyGeneratorBySpecTest, CryptoSm2AsyKeyGeneratorBySpecTest0 HcfObjDestroy(keyPair); HcfObjDestroy(generator); DestroyEccKeyPairSpec(reinterpret_cast(paramSpec)); + HcfFree(g_eccCommSpec); } HWTEST_F(CryptoSm2AsyKeyGeneratorBySpecTest, CryptoSm2AsyKeyGeneratorBySpecTest047, TestSize.Level0) @@ -1252,6 +1301,7 @@ HWTEST_F(CryptoSm2AsyKeyGeneratorBySpecTest, CryptoSm2AsyKeyGeneratorBySpecTest0 HcfObjDestroy(keyPair); HcfObjDestroy(generator); DestroyEccKeyPairSpec(reinterpret_cast(paramSpec)); + HcfFree(g_eccCommSpec); } HWTEST_F(CryptoSm2AsyKeyGeneratorBySpecTest, CryptoSm2AsyKeyGeneratorBySpecTest048, TestSize.Level0) @@ -1283,6 +1333,7 @@ HWTEST_F(CryptoSm2AsyKeyGeneratorBySpecTest, CryptoSm2AsyKeyGeneratorBySpecTest0 HcfObjDestroy(keyPair); HcfObjDestroy(generator); DestroyEccKeyPairSpec(reinterpret_cast(paramSpec)); + HcfFree(g_eccCommSpec); } HWTEST_F(CryptoSm2AsyKeyGeneratorBySpecTest, CryptoSm2AsyKeyGeneratorBySpecTest049, TestSize.Level0) @@ -1308,6 +1359,7 @@ HWTEST_F(CryptoSm2AsyKeyGeneratorBySpecTest, CryptoSm2AsyKeyGeneratorBySpecTest0 HcfObjDestroy(keyPair); HcfObjDestroy(generator); DestroyEccKeyPairSpec(reinterpret_cast(paramSpec)); + HcfFree(g_eccCommSpec); } HWTEST_F(CryptoSm2AsyKeyGeneratorBySpecTest, CryptoSm2AsyKeyGeneratorBySpecTest050, TestSize.Level0) @@ -1332,6 +1384,7 @@ HWTEST_F(CryptoSm2AsyKeyGeneratorBySpecTest, CryptoSm2AsyKeyGeneratorBySpecTest0 HcfObjDestroy(pubKey); HcfObjDestroy(generator); DestroyEccPubKeySpec(reinterpret_cast(paramSpec)); + HcfFree(g_eccCommSpec); } HWTEST_F(CryptoSm2AsyKeyGeneratorBySpecTest, CryptoSm2AsyKeyGeneratorBySpecTest051, TestSize.Level0) @@ -1356,6 +1409,7 @@ HWTEST_F(CryptoSm2AsyKeyGeneratorBySpecTest, CryptoSm2AsyKeyGeneratorBySpecTest0 HcfObjDestroy(pubKey); HcfObjDestroy(generator); DestroyEccPubKeySpec(reinterpret_cast(paramSpec)); + HcfFree(g_eccCommSpec); } HWTEST_F(CryptoSm2AsyKeyGeneratorBySpecTest, CryptoSm2AsyKeyGeneratorBySpecTest052, TestSize.Level0) @@ -1377,6 +1431,7 @@ HWTEST_F(CryptoSm2AsyKeyGeneratorBySpecTest, CryptoSm2AsyKeyGeneratorBySpecTest0 HcfObjDestroy(generator); DestroyEccPubKeySpec(reinterpret_cast(paramSpec)); + HcfFree(g_eccCommSpec); } HWTEST_F(CryptoSm2AsyKeyGeneratorBySpecTest, CryptoSm2AsyKeyGeneratorBySpecTest053, TestSize.Level0) @@ -1398,6 +1453,7 @@ HWTEST_F(CryptoSm2AsyKeyGeneratorBySpecTest, CryptoSm2AsyKeyGeneratorBySpecTest0 HcfObjDestroy(generator); DestroyEccPubKeySpec(reinterpret_cast(paramSpec)); + HcfFree(g_eccCommSpec); } HWTEST_F(CryptoSm2AsyKeyGeneratorBySpecTest, CryptoSm2AsyKeyGeneratorBySpecTest054, TestSize.Level0) @@ -1425,6 +1481,7 @@ HWTEST_F(CryptoSm2AsyKeyGeneratorBySpecTest, CryptoSm2AsyKeyGeneratorBySpecTest0 HcfObjDestroy(pubKey); HcfObjDestroy(generator); DestroyEccPubKeySpec(reinterpret_cast(paramSpec)); + HcfFree(g_eccCommSpec); } HWTEST_F(CryptoSm2AsyKeyGeneratorBySpecTest, CryptoSm2AsyKeyGeneratorBySpecTest055, TestSize.Level0) @@ -1450,6 +1507,7 @@ HWTEST_F(CryptoSm2AsyKeyGeneratorBySpecTest, CryptoSm2AsyKeyGeneratorBySpecTest0 pubKey->base.base.destroy((HcfObjectBase *)(&(pubKey->base.base))); HcfObjDestroy(generator); DestroyEccPubKeySpec(reinterpret_cast(paramSpec)); + HcfFree(g_eccCommSpec); } HWTEST_F(CryptoSm2AsyKeyGeneratorBySpecTest, CryptoSm2AsyKeyGeneratorBySpecTest056, TestSize.Level0) @@ -1475,6 +1533,7 @@ HWTEST_F(CryptoSm2AsyKeyGeneratorBySpecTest, CryptoSm2AsyKeyGeneratorBySpecTest0 HcfObjDestroy(pubKey); HcfObjDestroy(generator); DestroyEccPubKeySpec(reinterpret_cast(paramSpec)); + HcfFree(g_eccCommSpec); } HWTEST_F(CryptoSm2AsyKeyGeneratorBySpecTest, CryptoSm2AsyKeyGeneratorBySpecTest057, TestSize.Level0) @@ -1500,6 +1559,7 @@ HWTEST_F(CryptoSm2AsyKeyGeneratorBySpecTest, CryptoSm2AsyKeyGeneratorBySpecTest0 HcfObjDestroy(pubKey); HcfObjDestroy(generator); DestroyEccPubKeySpec(reinterpret_cast(paramSpec)); + HcfFree(g_eccCommSpec); } HWTEST_F(CryptoSm2AsyKeyGeneratorBySpecTest, CryptoSm2AsyKeyGeneratorBySpecTest058, TestSize.Level0) @@ -1527,6 +1587,7 @@ HWTEST_F(CryptoSm2AsyKeyGeneratorBySpecTest, CryptoSm2AsyKeyGeneratorBySpecTest0 HcfObjDestroy(pubKey); HcfObjDestroy(generator); DestroyEccPubKeySpec(reinterpret_cast(paramSpec)); + HcfFree(g_eccCommSpec); } HWTEST_F(CryptoSm2AsyKeyGeneratorBySpecTest, CryptoSm2AsyKeyGeneratorBySpecTest059, TestSize.Level0) @@ -1554,6 +1615,7 @@ HWTEST_F(CryptoSm2AsyKeyGeneratorBySpecTest, CryptoSm2AsyKeyGeneratorBySpecTest0 HcfObjDestroy(pubKey); HcfObjDestroy(generator); DestroyEccPubKeySpec(reinterpret_cast(paramSpec)); + HcfFree(g_eccCommSpec); } HWTEST_F(CryptoSm2AsyKeyGeneratorBySpecTest, CryptoSm2AsyKeyGeneratorBySpecTest060, TestSize.Level0) @@ -1581,6 +1643,7 @@ HWTEST_F(CryptoSm2AsyKeyGeneratorBySpecTest, CryptoSm2AsyKeyGeneratorBySpecTest0 HcfObjDestroy(pubKey); HcfObjDestroy(generator); DestroyEccPubKeySpec(reinterpret_cast(paramSpec)); + HcfFree(g_eccCommSpec); } HWTEST_F(CryptoSm2AsyKeyGeneratorBySpecTest, CryptoSm2AsyKeyGeneratorBySpecTest061, TestSize.Level0) @@ -1608,6 +1671,7 @@ HWTEST_F(CryptoSm2AsyKeyGeneratorBySpecTest, CryptoSm2AsyKeyGeneratorBySpecTest0 HcfObjDestroy(pubKey); HcfObjDestroy(generator); DestroyEccPubKeySpec(reinterpret_cast(paramSpec)); + HcfFree(g_eccCommSpec); } HWTEST_F(CryptoSm2AsyKeyGeneratorBySpecTest, CryptoSm2AsyKeyGeneratorBySpecTest062, TestSize.Level0) @@ -1635,6 +1699,7 @@ HWTEST_F(CryptoSm2AsyKeyGeneratorBySpecTest, CryptoSm2AsyKeyGeneratorBySpecTest0 HcfObjDestroy(pubKey); HcfObjDestroy(generator); DestroyEccPubKeySpec(reinterpret_cast(paramSpec)); + HcfFree(g_eccCommSpec); } HWTEST_F(CryptoSm2AsyKeyGeneratorBySpecTest, CryptoSm2AsyKeyGeneratorBySpecTest063, TestSize.Level0) @@ -1662,6 +1727,7 @@ HWTEST_F(CryptoSm2AsyKeyGeneratorBySpecTest, CryptoSm2AsyKeyGeneratorBySpecTest0 HcfObjDestroy(pubKey); HcfObjDestroy(generator); DestroyEccPubKeySpec(reinterpret_cast(paramSpec)); + HcfFree(g_eccCommSpec); } HWTEST_F(CryptoSm2AsyKeyGeneratorBySpecTest, CryptoSm2AsyKeyGeneratorBySpecTest064, TestSize.Level0) @@ -1694,6 +1760,7 @@ HWTEST_F(CryptoSm2AsyKeyGeneratorBySpecTest, CryptoSm2AsyKeyGeneratorBySpecTest0 HcfObjDestroy(pubKey); HcfObjDestroy(generator); DestroyEccPubKeySpec(reinterpret_cast(paramSpec)); + HcfFree(g_eccCommSpec); } HWTEST_F(CryptoSm2AsyKeyGeneratorBySpecTest, CryptoSm2AsyKeyGeneratorBySpecTest065, TestSize.Level0) @@ -1726,5 +1793,6 @@ HWTEST_F(CryptoSm2AsyKeyGeneratorBySpecTest, CryptoSm2AsyKeyGeneratorBySpecTest0 HcfObjDestroy(pubKey); HcfObjDestroy(generator); DestroyEccPubKeySpec(reinterpret_cast(paramSpec)); + HcfFree(g_eccCommSpec); } } \ No newline at end of file -- Gitee