diff --git a/README.md b/README.md index fb137fe4e23c811950a5d0fc8bdfa9c6cfb421d2..c99d8ab123ba1ebe380aa2a12ef0754d9d382870 100755 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ HUKS consists of the following modules: - HUKS SDK layer: provides HUKS APIs for applications. - HUKS service layer: implements functions such as HUKS key management and storage. -- HUKS engine layer: HUKS core module, which generates, encrypts, and decrypts keys. For devices running a standard system, this module of the commercial version must run in a secure environment such as a TEE or a chip with security capabilities. A secure environment requires dedicated hardware and is therefore implemented only by emulation in the open-source code. For the small and mini systems, HUKS only provides the example implementation of the root key protection solution. In commercial scenarios, the implementation must adapt to hardware root key or other root key protection solutions. +- HUKS engine layer: HUKS core module, which generates, encrypts, and decrypts keys. For devices running a standard system, this module of the commercial version must run in a secure environment such as a TEE or a chip with security capabilities. A secure environment requires dedicated hardware and is therefore implemented only by emulation in the open-source code. For the small and mini systems, HUKS only provides the example implementation of the root key protection solution. In commercial scenarios, the implementation must adapt to the protection solution for either the hardware root key or other root keys. ## Directory Structure @@ -21,8 +21,8 @@ HUKS consists of the following modules: base/security/huks/ ├── build # Build configuration file ├── frameworks # Framework code, which is used by interfaces and services -│ └── huks_standard # HUKS implementation -| └── huks_lite # HUKS build script in a mini or small system +│ └── huks_standard # Code implementation +| └── huks_lite # Build script in a small and mini systems | └── crypto_lite # Encryption and decryption implementation ├── interfaces # APIs │ └── innerkits diff --git a/services/huks_standard/huks_service/main/os_dependency/idl/ipc/hks_ipc_serialization.c b/services/huks_standard/huks_service/main/os_dependency/idl/ipc/hks_ipc_serialization.c index 2d8846fcbb5e588a62cfb1763432c47cc3bdd914..0f6c20861c7a601f879ba6e8c646ef0c0e3240e0 100644 --- a/services/huks_standard/huks_service/main/os_dependency/idl/ipc/hks_ipc_serialization.c +++ b/services/huks_standard/huks_service/main/os_dependency/idl/ipc/hks_ipc_serialization.c @@ -506,11 +506,13 @@ static int32_t KeyInfoListInit(struct HksKeyInfo *keyInfoList, uint32_t listCoun ret = MallocBlobFromBuffer(srcData, &keyInfoList[i].alias, offset); if (ret != HKS_SUCCESS) { HKS_LOG_E("malloc keyInfoList alias failed"); + break; } ret = MallocParamSetFromBuffer(srcData, &keyInfoList[i].paramSet, offset); if (ret != HKS_SUCCESS) { HKS_LOG_E("malloc keyInfoList paramSetSize failed"); + break; } } diff --git a/test/unittest/src/liteos_m_adapter/hks_safe_cipher_key_test.c b/test/unittest/src/liteos_m_adapter/hks_safe_cipher_key_test.c index 0d8b2799cc4bc1620dcfd8220723fca6049e5df0..49eb89ea645170781d9fb8501befe15135a4b780 100644 --- a/test/unittest/src/liteos_m_adapter/hks_safe_cipher_key_test.c +++ b/test/unittest/src/liteos_m_adapter/hks_safe_cipher_key_test.c @@ -90,7 +90,7 @@ static int32_t GetKeyOffsetByKeyAlias(const struct HksBlob *keyAlias, uint32_t * return HKS_ERROR_NOT_EXIST; } -static int32_t CompareTwoKey(const struct HksBlob *keyAliasOne, const struct HksBlob *keyAliasTwo) +static int32_t CompareTwoKey(const struct HksBlob *keyAliasOne, const struct HksBlob *keyAliasTwo) { uint32_t sizeOne = HksTestFileSize(g_storePath, "hks_keystore"); uint8_t *bufOne = (uint8_t *)HksTestMalloc(sizeOne);