From 8015aa2fe34085fbe5085a6d4e6d011ae9e7ac41 Mon Sep 17 00:00:00 2001 From: kang1024 Date: Mon, 19 May 2025 21:36:44 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DTDD=E5=A4=B1=E8=B4=A5?= =?UTF-8?q?=E7=94=A8=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: kang1024 --- frameworks/js/ani/src/ani_ecc_key_util.cpp | 2 +- test/unittest/src/crypto_cmac_test.cpp | 4 ++-- test/unittest/src/crypto_mac_test.cpp | 2 +- test/unittest/src/crypto_sm3_mac_test.cpp | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/frameworks/js/ani/src/ani_ecc_key_util.cpp b/frameworks/js/ani/src/ani_ecc_key_util.cpp index 203b64d..4859322 100644 --- a/frameworks/js/ani/src/ani_ecc_key_util.cpp +++ b/frameworks/js/ani/src/ani_ecc_key_util.cpp @@ -27,7 +27,7 @@ ECCCommonParamsSpec GenECCCommonParamsSpec(string_view curveName) .field = OptECField::make_ECFIELDFP(ecFieldFp) }; HcfEccCommParamsSpec *eccCommParamsSpec = nullptr; - HcfResult res = HcfEccKeyUtilCreate(curveName.c_str(), &eccCommParamsSpec); + HcfResult res = HcfEccKeyUtilCreate(curveName.c_str(), &eccCommParamsSpec); if (res != HCF_SUCCESS) { ANI_LOGE_THROW(res, "create C eccKey obj fail!"); return ecc; diff --git a/test/unittest/src/crypto_cmac_test.cpp b/test/unittest/src/crypto_cmac_test.cpp index 4df5204..3dead5e 100644 --- a/test/unittest/src/crypto_cmac_test.cpp +++ b/test/unittest/src/crypto_cmac_test.cpp @@ -130,8 +130,8 @@ HWTEST_F(CryptoCmacTest, CryptoCmacTest005, TestSize.Level0) ASSERT_EQ(ret, HCF_SUCCESS); EXPECT_NE(macObj, nullptr); // test api functions - const char *cipherName = macObj->getAlgoName(macObj); - int32_t cmpRes = strcmp(cipherName, "AES128"); + const char *algoName = macObj->getAlgoName(macObj); + int32_t cmpRes = strcmp(algoName, params.base.algName); EXPECT_EQ(cmpRes, HCF_SUCCESS); HcfObjDestroy(macObj); } diff --git a/test/unittest/src/crypto_mac_test.cpp b/test/unittest/src/crypto_mac_test.cpp index 0f6c439..fa036ae 100644 --- a/test/unittest/src/crypto_mac_test.cpp +++ b/test/unittest/src/crypto_mac_test.cpp @@ -139,7 +139,7 @@ HWTEST_F(CryptoMacTest, CryptoFrameworkHmacAlgoNameTest001, TestSize.Level0) EXPECT_NE(macObj, nullptr); // test api functions const char *algoName = macObj->getAlgoName(macObj); - int32_t cmpRes = strcmp(algoName, "SHA1"); + int32_t cmpRes = strcmp(algoName, params.base.algName); EXPECT_EQ(cmpRes, HCF_SUCCESS); HcfObjDestroy(macObj); } diff --git a/test/unittest/src/crypto_sm3_mac_test.cpp b/test/unittest/src/crypto_sm3_mac_test.cpp index 522be43..a98b376 100644 --- a/test/unittest/src/crypto_sm3_mac_test.cpp +++ b/test/unittest/src/crypto_sm3_mac_test.cpp @@ -131,7 +131,7 @@ HWTEST_F(CryptoSM3MacTest, CryptoFrameworkHmacSM3AlgoNameTest001, TestSize.Level EXPECT_NE(macObj, nullptr); // test api functions const char *algoName = macObj->getAlgoName(macObj); - int32_t cmpRes = strcmp(algoName, "SM3"); + int32_t cmpRes = strcmp(algoName, params.base.algName); EXPECT_EQ(cmpRes, HCF_SUCCESS); HcfObjDestroy(macObj); } -- Gitee