From a770e75c91418457493022e1a8324d165c51523c Mon Sep 17 00:00:00 2001 From: wanghaixiang Date: Thu, 12 Aug 2021 18:02:10 +0800 Subject: [PATCH] bugfix Signed-off-by: wanghaixiang --- README.md | 6 +++--- .../main/os_dependency/idl/ipc/hks_ipc_serialization.c | 2 ++ .../src/liteos_m_adapter/hks_safe_cipher_key_test.c | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index fb137fe4..c99d8ab1 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 2d8846fc..0f6c2086 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 0d8b2799..49eb89ea 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); -- Gitee