From 73988538fc893d8a24db3a7ec7a7378d27d3d78c Mon Sep 17 00:00:00 2001 From: hu-jixiang1 Date: Mon, 28 Mar 2022 19:54:27 +0800 Subject: [PATCH] neiyuanzhenggai Signed-off-by: hu-jixiang1 Change-Id: I1f58aa0dced4dac12aa4b921de5c20ec14c1dff6 --- security/huks_standard/hks_xts_common.test.js | 4 ++-- security_lite/huks/liteos_a_adapter/hks_agreement_test.cpp | 1 - .../huks/liteos_m_adapter/hks_safe_cipher_key_test.c | 2 +- .../huks/liteos_m_adapter/hks_safe_compare_key_test.c | 2 +- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/security/huks_standard/hks_xts_common.test.js b/security/huks_standard/hks_xts_common.test.js index d7f7c4790..5f81fdc77 100644 --- a/security/huks_standard/hks_xts_common.test.js +++ b/security/huks_standard/hks_xts_common.test.js @@ -15,8 +15,8 @@ import hks from '@ohos.security.huks' -export var alias = 'alias'; -export var aliasA = 'aliasA'; +export const alias = 'alias'; +export const aliasA = 'aliasA'; export var aliasB = 'aliasB'; export var targetAlias = 'targetAlias'; diff --git a/security_lite/huks/liteos_a_adapter/hks_agreement_test.cpp b/security_lite/huks/liteos_a_adapter/hks_agreement_test.cpp index 1752786e5..393b67a15 100644 --- a/security_lite/huks/liteos_a_adapter/hks_agreement_test.cpp +++ b/security_lite/huks/liteos_a_adapter/hks_agreement_test.cpp @@ -154,7 +154,6 @@ HWTEST_F(HksAgreementTest, HksAgreementTest002, TestSize.Level1) struct HksBlob *peerPubKeyAlias = NULL; struct HksBlob *peerPublicKey = NULL; struct HksBlob *privateKey2 = NULL; - struct HksBlob *peerPubKeyAlias2 = NULL; struct HksBlob *peerPublicKey2 = NULL; int32_t ret; diff --git a/security_lite/huks/liteos_m_adapter/hks_safe_cipher_key_test.c b/security_lite/huks/liteos_m_adapter/hks_safe_cipher_key_test.c index 7044e6266..5e8a6858d 100644 --- a/security_lite/huks/liteos_m_adapter/hks_safe_cipher_key_test.c +++ b/security_lite/huks/liteos_m_adapter/hks_safe_cipher_key_test.c @@ -100,7 +100,7 @@ static int32_t GetKeyOffsetByKeyAlias(const struct HksBlob *keyAlias, uint32_t * /* 2. traverse imageBuffer to search for keyAlias */ uint32_t offset = sizeof(*keyInfoHead); - for (uint16_t i = 0; i < keyCount; ++i) { + for (uint32_t i = 0; i < keyCount; ++i) { uint8_t *tmpBuf = storageBuf.data + offset; struct HksStoreKeyInfo *keyInfo = (struct HksStoreKeyInfo *)tmpBuf; if (keyInfo->aliasSize == keyAlias->size) { diff --git a/security_lite/huks/liteos_m_adapter/hks_safe_compare_key_test.c b/security_lite/huks/liteos_m_adapter/hks_safe_compare_key_test.c index a68eafab7..d445da0f9 100644 --- a/security_lite/huks/liteos_m_adapter/hks_safe_compare_key_test.c +++ b/security_lite/huks/liteos_m_adapter/hks_safe_compare_key_test.c @@ -164,7 +164,7 @@ static int32_t GetKeyOffsetByKeyAlias(const struct HksBlob *keyAlias, uint32_t * /* 2. traverse imageBuffer to search for keyAlias */ uint32_t offset = sizeof(*keyInfoHead); - for (uint16_t i = 0; i < keyCount; ++i) { + for (uint32_t i = 0; i < keyCount; ++i) { uint8_t *tmpBuf = storageBuf.data + offset; struct HksStoreKeyInfo *keyInfo = (struct HksStoreKeyInfo *)tmpBuf; if (keyInfo->aliasSize == keyAlias->size) { -- GitLab