Home
last modified time | relevance | path

Searched refs:keyInfo (Results 1 – 25 of 26) sorted by relevance

12

/base/security/huks/services/huks_standard/huks_service/main/core/src/
Dhks_storage_adapter.c25 bool HksIsKeyInfoLenInvalid(struct HksStoreKeyInfo *keyInfo) in HksIsKeyInfoLenInvalid() argument
27 return (keyInfo->aliasSize > HKS_MAX_KEY_ALIAS_LEN) || (keyInfo->aliasSize == 0) || in HksIsKeyInfoLenInvalid()
28 (keyInfo->keySize > HKS_MAX_KEY_MATERIAL_LEN) || (keyInfo->keySize == 0) || in HksIsKeyInfoLenInvalid()
29 (keyInfo->authIdSize > HKS_MAX_KEY_AUTH_ID_LEN) || in HksIsKeyInfoLenInvalid()
30 …(keyInfo->keyInfoLen != (sizeof(*keyInfo) + keyInfo->aliasSize + keyInfo->authIdSize + keyInfo->ke… in HksIsKeyInfoLenInvalid()
33 static int32_t AddStorageFixedParams(const struct HksStoreKeyInfo *keyInfo, struct HksParamSet *par… in AddStorageFixedParams() argument
38 .uint32Param = keyInfo->flag in AddStorageFixedParams()
41 .uint32Param = keyInfo->keyAlg in AddStorageFixedParams()
44 .uint32Param = keyInfo->purpose in AddStorageFixedParams()
47 .uint32Param = keyInfo->keyLen in AddStorageFixedParams()
[all …]
Dhks_upgrade_storage_data.c209 static int32_t GetOldVersionKeyStoreBuf(struct HksBlob *keyInfo) in GetOldVersionKeyStoreBuf() argument
228 keyInfo->size = fileSize; in GetOldVersionKeyStoreBuf()
229 keyInfo->data = tmpBuf; in GetOldVersionKeyStoreBuf()
233 static int32_t CheckKeyStoreHeaderValid(const struct HksBlob *keyInfo) in CheckKeyStoreHeaderValid() argument
237 struct HksBlob srcData = { headerLen - HKS_HEADER_HASH_SIZE, keyInfo->data }; in CheckKeyStoreHeaderValid()
250 (HksMemCmp(hashBlob.data, keyInfo->data + srcData.size, HKS_HEADER_HASH_SIZE) != 0)) { in CheckKeyStoreHeaderValid()
261 static uint8_t GetSlotCountLoop(const struct HksBlob *keyInfo) in GetSlotCountLoop() argument
264 uint8_t slotCount = *(keyInfo->data + slotCountPos); /* keyInfo size has been checked */ in GetSlotCountLoop()
269 static int32_t GetKeyAlias(const struct HksBlob *keyInfo, struct HksBlob *keyAlias) in GetKeyAlias() argument
273 uint8_t aliasSize = *(keyInfo->data + aliasSizePos); in GetKeyAlias()
[all …]
Dhks_storage_lite.c363 struct HksStoreKeyInfo *keyInfo = (struct HksStoreKeyInfo *)tmpBuf; in GetKeyOffsetByKeyAlias() local
364 if (HksIsKeyInfoLenInvalid(keyInfo) || (keyInfo->keyInfoLen > (totalLen - offset))) { in GetKeyOffsetByKeyAlias()
369 if (keyInfo->aliasSize == keyAlias->size) { in GetKeyOffsetByKeyAlias()
370 if (HksMemCmp(keyAlias->data, tmpBuf + sizeof(*keyInfo), keyAlias->size) == 0) { in GetKeyOffsetByKeyAlias()
376 offset += keyInfo->keyInfoLen; in GetKeyOffsetByKeyAlias()
473 …struct HksStoreKeyInfo *keyInfo = (struct HksStoreKeyInfo *)(g_storageImageBuffer.data + keyOffset… in DeleteKey() local
475 uint32_t keyInfoLen = keyInfo->keyInfoLen; in DeleteKey()
481 (void)memset_s(keyInfo, keyInfoLen, 0, keyInfoLen); in DeleteKey()
485 …if (memmove_s(keyInfo, keyInfoHead->totalLen - keyOffset, g_storageImageBuffer.data + nextKeyOffse… in DeleteKey()
502 … struct HksStoreKeyInfo *keyInfo = (struct HksStoreKeyInfo *)(g_storageImageBuffer.data + offset); in StoreKeyBlob() local
[all …]
/base/security/huks/services/huks_standard/huks_engine/main/core/src/
Dhks_keyblob_lite.c105 struct HksStoreKeyInfo *keyInfo = (struct HksStoreKeyInfo *)cipherKey->data; in BuildKeyBlobUsageSpec() local
121 … .size = sizeof(*keyInfo) - sizeof(keyInfo->keyInfoLen) + keyInfo->aliasSize + keyInfo->authIdSize, in BuildKeyBlobUsageSpec()
122 .data = cipherKey->data + sizeof(keyInfo->keyInfoLen) in BuildKeyBlobUsageSpec()
128 aeadParam->payloadLen = keyInfo->keySize - HKS_AE_TAG_LEN; in BuildKeyBlobUsageSpec()
133 …aeadParam->tagDec.data = cipherKey->data + keyInfo->keyInfoLen - HKS_AE_TAG_LEN; /* the last 16 by… in BuildKeyBlobUsageSpec()
141 struct HksStoreKeyInfo *keyInfo = (struct HksStoreKeyInfo *)cipherKey->data; in EncryptAndDecryptKeyBlob() local
145 struct HksBlob random = { HKS_DEFAULT_RANDOM_LEN, keyInfo->random }; in EncryptAndDecryptKeyBlob()
167 …struct HksBlob encKey = { keyInfo->keySize, cipherKey->data + keyInfo->keyInfoLen - keyInfo->keySi… in EncryptAndDecryptKeyBlob()
169 … struct HksBlob tag = { HKS_AE_TAG_LEN, cipherKey->data + keyInfo->keyInfoLen - HKS_AE_TAG_LEN }; in EncryptAndDecryptKeyBlob()
272 struct HksStoreKeyInfo *keyInfo = (struct HksStoreKeyInfo *)key->data; in GetRawKeyMaterial() local
[all …]
Dhks_upgrade_key_info.c88 static int32_t GetParamPosition(const struct HksBlob *keyInfo, uint32_t *paramPosition) in GetParamPosition() argument
92 uint8_t keyAliasSize = *(keyInfo->data + offset); in GetParamPosition()
103 static int32_t GetKeySizePosition(const struct HksBlob *keyInfo, uint32_t *keySizePosition) in GetKeySizePosition() argument
107 int32_t ret = GetParamPosition(keyInfo, &offset); in GetKeySizePosition()
114 uint8_t authIdSize = *(keyInfo->data + offset); in GetKeySizePosition()
125 static int32_t GetKeyInfo(const struct HksBlob *keyInfo, struct HksKeyStoreInfo *keyStoreInfo) in GetKeyInfo() argument
129 int32_t ret = GetParamPosition(keyInfo, &offset); in GetKeyInfo()
132 uint8_t *tmp = keyInfo->data; in GetKeyInfo()
175 static int32_t GetNonce(const struct HksBlob *keyInfo, struct HksBlob *nonce) in GetNonce() argument
182 …if (memcpy_s(tmp, HKS_SEALING_NONCE_SIZE, keyInfo->data + offset, HKS_SEALING_NONCE_SIZE) != EOK) { in GetNonce()
[all …]
Dhks_keyblob.c260 static int32_t InitKeyBlobInfo(const struct HksBlob *key, struct HksBlob *keyInfo) in InitKeyBlobInfo() argument
262 keyInfo->size = key->size + sizeof(struct HksKeyBlobInfo); in InitKeyBlobInfo()
263 keyInfo->data = (uint8_t *)HksMalloc(keyInfo->size); in InitKeyBlobInfo()
264 HKS_IF_NULL_LOGE_RETURN(keyInfo->data, HKS_ERROR_MALLOC_FAIL, "malloc failed") in InitKeyBlobInfo()
268 struct HksKeyBlobInfo *keyBlobInfo = (struct HksKeyBlobInfo *)keyInfo->data; in InitKeyBlobInfo()
279 (void)memcpy_s(keyInfo->data + sizeof(*keyBlobInfo), keyInfo->size - sizeof(*keyBlobInfo), in InitKeyBlobInfo()
284 HKS_FREE_PTR(keyInfo->data); in InitKeyBlobInfo()
289 static int32_t AddCoreServiceParams(const struct HksBlob *keyInfo, enum HksKeyFlag keyFlag, in AddCoreServiceParams() argument
307 .blob = *keyInfo in AddCoreServiceParams()
Dhks_core_interfaces.c160 int32_t HuksHdiUpgradeKeyInfo(const struct HksBlob *keyAlias, const struct HksBlob *keyInfo, struct… in HuksHdiUpgradeKeyInfo() argument
162 return HksCoreUpgradeKeyInfo(keyAlias, keyInfo, keyOut); in HuksHdiUpgradeKeyInfo()
/base/security/huks/test/unittest/huks_lite_test/liteos_m_adapter/
Dhks_safe_cipher_key_test.c78 struct HksStoreKeyInfo *keyInfo = (struct HksStoreKeyInfo *)tmpBuf; in GetKeyOffsetByKeyAlias() local
79 if (keyInfo->aliasSize == keyAlias->size) { in GetKeyOffsetByKeyAlias()
80 if (HksMemCmp(keyAlias->data, tmpBuf + sizeof(*keyInfo), keyAlias->size) == 0) { in GetKeyOffsetByKeyAlias()
86 offset += keyInfo->keyInfoLen; in GetKeyOffsetByKeyAlias()
Dhks_safe_compare_key_test.c139 struct HksStoreKeyInfo *keyInfo = (struct HksStoreKeyInfo *)tmpBuf; in GetKeyOffsetByKeyAlias() local
140 if (keyInfo->aliasSize == keyAlias->size) { in GetKeyOffsetByKeyAlias()
141 if (HksMemCmp(keyAlias->data, tmpBuf + sizeof(*keyInfo), keyAlias->size) == 0) { in GetKeyOffsetByKeyAlias()
147 offset += keyInfo->keyInfoLen; in GetKeyOffsetByKeyAlias()
/base/security/huks/services/huks_standard/huks_engine/main/core/include/
Dhks_upgrade_key_info.h25 int32_t HksUpgradeKeyInfo(const struct HksBlob *keyAlias, const struct HksBlob *keyInfo, struct Hks…
Dhks_core_service.h63 int32_t HksCoreUpgradeKeyInfo(const struct HksBlob *keyAlias, const struct HksBlob *keyInfo, struct…
/base/security/huks/services/huks_standard/huks_service/main/core/include/
Dhks_storage_adapter.h27 bool HksIsKeyInfoLenInvalid(struct HksStoreKeyInfo *keyInfo);
Dhuks_access.h62 int32_t HuksAccessUpgradeKeyInfo(const struct HksBlob *keyAlias, const struct HksBlob *keyInfo,
70 int32_t HuksAccessUpgradeKeyInfo(const struct HksBlob *keyAlias, const struct HksBlob *keyInfo,
/base/security/device_auth/services/authenticators/src/account_unrelated/pake_task/pake_v1_task/pake_v1_protocol_task/
Dpake_v1_protocol_task_common.c162 Uint8Buff keyInfo = { (uint8_t *)TMP_AUTH_KEY_FACTOR, strlen(TMP_AUTH_KEY_FACTOR) }; in FillPskWithDerivedKeyHex() local
163 …res = params->baseParams.loader->computeHkdf(&pskKeyAlias, &(params->nonce), &keyInfo, &pskByte, t… in FillPskWithDerivedKeyHex()
/base/security/device_auth/services/protocol/src/pake_protocol/pake_v1_protocol/
Dpake_v1_protocol_common.c194 Uint8Buff keyInfo = { (uint8_t *)HICHAIN_SPEKE_BASE_INFO, HcStrlen(HICHAIN_SPEKE_BASE_INFO) }; in GeneratePakeParams() local
195 res = params->loader->computeHkdf(&(params->psk), &(params->salt), &keyInfo, &secret, false); in GeneratePakeParams()
226 …Uint8Buff keyInfo = { (uint8_t *)HICHAIN_SPEKE_SESSIONKEY_INFO, HcStrlen(HICHAIN_SPEKE_SESSIONKEY_… in DeriveKeyFromSharedSecret() local
235 …res = params->loader->computeHkdf(&(params->sharedSecret), &(params->salt), &keyInfo, &unionKey, f… in DeriveKeyFromSharedSecret()
/base/security/huks/interfaces/innerkits/huks_standard/main/include/
Dhuks_hdi.h62 int32_t (*HuksHdiUpgradeKeyInfo)(const struct HksBlob *keyAlias, const struct HksBlob *keyInfo,
/base/security/device_auth/services/authenticators/src/account_unrelated/pake_task/
Dpake_task_common.c67 Uint8Buff keyInfo = { (uint8_t *)HICHAIN_RETURN_KEY, strlen(HICHAIN_RETURN_KEY) }; in GenerateOutputKey() local
69 &keyInfo, &(params->returnKey), false); in GenerateOutputKey()
/base/security/huks/services/huks_standard/huks_service/main/os_dependency/idl/passthrough/
Dhuks_access.c262 …CFI(int32_t HuksAccessUpgradeKeyInfo(const struct HksBlob *keyAlias, const struct HksBlob *keyInfo, in ENABLE_CFI() argument
270 return g_hksHalDevicePtr->HuksHdiUpgradeKeyInfo(keyAlias, keyInfo, keyOut); in ENABLE_CFI()
/base/security/device_auth/services/protocol/src/pake_protocol/pake_v2_protocol/
Dpake_v2_protocol_common.c182 Uint8Buff keyInfo = { (uint8_t *)HICHAIN_SPEKE_BASE_INFO, HcStrlen(HICHAIN_SPEKE_BASE_INFO) }; in GeneratePakeParams() local
183 res = params->loader->computeHkdf(&(params->psk), &(params->salt), &keyInfo, &secret, false); in GeneratePakeParams()
568 …Uint8Buff keyInfo = { (uint8_t *)HICHAIN_SPEKE_SESSIONKEY_INFO, HcStrlen(HICHAIN_SPEKE_SESSIONKEY_… in GenerateSessionKey() local
569 …int res = params->loader->computeHkdf(&params->sharedSecret, &params->salt, &keyInfo, &params->ses… in GenerateSessionKey()
/base/security/device_auth/deps_adapter/key_management_adapter/interfaces/
Dalg_defs.h82 …t32_t (*ComputeHkdfFunc)(const Uint8Buff *baseKey, const Uint8Buff *salt, const Uint8Buff *keyInfo,
/base/security/device_auth/deps_adapter/key_management_adapter/impl/src/mini/
Dhuks_adapter.c234 …atic int32_t ComputeHkdf(const Uint8Buff *baseKey, const Uint8Buff *salt, const Uint8Buff *keyInfo, in ComputeHkdf() argument
247 if (keyInfo != NULL) { in ComputeHkdf()
248 keyInfoBlob.size = keyInfo->length; in ComputeHkdf()
249 keyInfoBlob.data = keyInfo->val; in ComputeHkdf()
/base/security/device_auth/deps_adapter/key_management_adapter/impl/src/small/
Dhuks_adapter.c203 …atic int32_t ComputeHkdf(const Uint8Buff *baseKey, const Uint8Buff *salt, const Uint8Buff *keyInfo, in ComputeHkdf() argument
216 if (keyInfo != NULL) { in ComputeHkdf()
217 keyInfoBlob.size = keyInfo->length; in ComputeHkdf()
218 keyInfoBlob.data = keyInfo->val; in ComputeHkdf()
/base/security/device_auth/deps_adapter/key_management_adapter/impl/src/standard/
Dhuks_adapter.c215 …atic int32_t ComputeHkdf(const Uint8Buff *baseKey, const Uint8Buff *salt, const Uint8Buff *keyInfo, in ComputeHkdf() argument
228 if (keyInfo != NULL) { in ComputeHkdf()
229 keyInfoBlob.size = keyInfo->length; in ComputeHkdf()
230 keyInfoBlob.data = keyInfo->val; in ComputeHkdf()
/base/security/huks/test/unittest/huks_standard_test/module_test/interface_test/src/
Dhks_native_api_compatibility_test.cpp820 struct OH_Huks_KeyInfo keyInfo; variable
821 ASSERT_EQ(sizeof(keyInfo.alias) == sizeof(struct OH_Huks_Blob), true);
822 ASSERT_EQ(sizeof(keyInfo.paramSet) == sizeof(struct OH_Huks_ParamSet *), true);
/base/security/huks/frameworks/huks_standard/main/common/src/
Dhks_base_check.c731 struct HksStoreKeyInfo *keyInfo = (struct HksStoreKeyInfo *)key->data; in CheckAndGetKeySize() local
732 uint32_t keyLen = keyInfo->keyLen; in CheckAndGetKeySize()

12