Home
last modified time | relevance | path

Searched refs:keyNode (Results 1 – 19 of 19) sorted by relevance

/base/security/huks/services/huks_standard/huks_engine/main/core/include/
Dhks_core_service_three_stage.h33 int32_t HksCoreSignVerifyThreeStageInit(const struct HuksKeyNode *keyNode, const struct HksParamSet…
36 int32_t HksCoreSignVerifyThreeStageUpdate(const struct HuksKeyNode *keyNode, const struct HksParamS…
39 int32_t HksCoreSignVerifyThreeStageFinish(const struct HuksKeyNode *keyNode, const struct HksParamS…
42 int32_t HksCoreSignVerifyThreeStageAbort(const struct HuksKeyNode *keyNode, const struct HksParamSe…
45 int32_t HksCoreCryptoThreeStageInit(const struct HuksKeyNode *keyNode, const struct HksParamSet *pa…
48 int32_t HksCoreCryptoThreeStageUpdate(const struct HuksKeyNode *keyNode, const struct HksParamSet *…
51 int32_t HksCoreEncryptThreeStageFinish(const struct HuksKeyNode *keyNode, const struct HksParamSet …
54 int32_t HksCoreCryptoThreeStageAbort(const struct HuksKeyNode *keyNode, const struct HksParamSet *p…
57 int32_t HksCoreDecryptThreeStageFinish(const struct HuksKeyNode *keyNode, const struct HksParamSet …
60 int32_t HksCoreDeriveThreeStageInit(const struct HuksKeyNode *keyNode, const struct HksParamSet *pa…
[all …]
Dhks_secure_access.h25 int32_t HksCoreSecureAccessInitParams(struct HuksKeyNode *keyNode, const struct HksParamSet *initPa…
28 int32_t HksCoreSecureAccessVerifyParams(struct HuksKeyNode *keyNode, const struct HksParamSet *para…
30 int32_t HksCoreAppendAuthInfoBeforeUpdate(struct HuksKeyNode *keyNode, uint32_t pur,
33 int32_t HksCoreAppendAuthInfoBeforeFinish(struct HuksKeyNode *keyNode, uint32_t pur,
36 int32_t HksCoreAppendAuthInfoAfterFinish(struct HuksKeyNode *keyNode, uint32_t pur,
Dhks_auth.h41 int32_t HksAuth(uint32_t authId, const struct HksKeyNode *keyNode, const struct HksParamSet *paramS…
43 int32_t HksThreeStageAuth(uint32_t authId, const struct HuksKeyNode *keyNode);
Dhks_core_service.h109 int32_t (*handler)(const struct HuksKeyNode *keyNode, const struct HksParamSet *paramSet,
115 int32_t (*handler)(const struct HuksKeyNode *keyNode, const struct HksParamSet *paramSet,
121 int32_t (*handler)(const struct HuksKeyNode *keyNode, const struct HksParamSet *paramSet,
127 …int32_t (*handler)(const struct HuksKeyNode *keyNode, const struct HksParamSet *paramSet, uint32_t…
Dhks_keyblob.h57 void HksFreeKeyNode(struct HksKeyNode **keyNode);
/base/security/huks/services/huks_standard/huks_engine/main/core/src/
Dhks_keynode.c121 static int32_t AddKeyNode(struct HuksKeyNode *keyNode) in AddKeyNode() argument
132 AddNodeAfterDoubleListHead(&g_keyNodeList, &keyNode->listHead); in AddKeyNode()
144 struct HuksKeyNode *keyNode = (struct HuksKeyNode *)HksMalloc(sizeof(struct HuksKeyNode)); in HksCreateKeyNode() local
145 HKS_IF_NULL_LOGE_RETURN(keyNode, NULL, "malloc hks keyNode failed") in HksCreateKeyNode()
147 int32_t ret = GenerateKeyNodeHandle(&keyNode->handle); in HksCreateKeyNode()
149 HksFree(keyNode); in HksCreateKeyNode()
157 HksFree(keyNode); in HksCreateKeyNode()
167 HksFree(keyNode); in HksCreateKeyNode()
178 HksFree(keyNode); in HksCreateKeyNode()
182 ret = AddKeyNode(keyNode); in HksCreateKeyNode()
[all …]
Dhks_core_service_three_stage.c191 static int32_t SignVerifyAuth(const struct HuksKeyNode *keyNode, const struct HksParamSet *paramSet) in SignVerifyAuth() argument
199 return HksThreeStageAuth(HKS_AUTH_ID_SIGN_VERIFY_ECC, keyNode); in SignVerifyAuth()
205 … ret = HksCheckParamsetOneAndPatamsetTwoExist(keyNode->keyBlobParamSet, keyNode->runtimeParamSet, in SignVerifyAuth()
209 return HksThreeStageAuth(HKS_AUTH_ID_SIGN_VERIFY_RSA, keyNode); in SignVerifyAuth()
211 return HksThreeStageAuth(HKS_AUTH_ID_SIGN_VERIFY_ED25519, keyNode); in SignVerifyAuth()
216 static int32_t AgreeAuth(const struct HuksKeyNode *keyNode, const struct HksParamSet *paramSet) in AgreeAuth() argument
224 return HksThreeStageAuth(HKS_AUTH_ID_AGREE, keyNode); in AgreeAuth()
229 static int32_t HmacAuth(const struct HuksKeyNode *keyNode, const struct HksParamSet *paramSet) in HmacAuth() argument
236 return HksThreeStageAuth(HKS_AUTH_ID_MAC_HMAC, keyNode); in HmacAuth()
238 return HksThreeStageAuth(HKS_AUTH_ID_MAC_SM3, keyNode); in HmacAuth()
[all …]
Dhks_secure_access.c55 struct HuksKeyNode *keyNode; member
280 static int32_t HksVerifyKeyChallenge(const struct HuksKeyNode *keyNode, const struct HksUserAuthTok… in HksVerifyKeyChallenge() argument
284 int32_t ret = HksGetParam(keyNode->authRuntimeParamSet, HKS_TAG_KEY_INIT_CHALLENGE, &challenge); in HksVerifyKeyChallenge()
299 static int32_t HksVerifyKeyTimestamp(const struct HuksKeyNode *keyNode, const struct HksUserAuthTok… in HksVerifyKeyTimestamp() argument
303 int32_t ret = HksGetParam(keyNode->keyBlobParamSet, HKS_TAG_AUTH_TIMEOUT, &timeOut); in HksVerifyKeyTimestamp()
309 ret = HksGetParam(keyNode->authRuntimeParamSet, HKS_TAG_KEY_ACCESS_TIME, &accessTime); in HksVerifyKeyTimestamp()
386 static int32_t VerifyCustomChallenge(const struct HuksKeyNode *keyNode, const struct HksUserAuthTok… in VerifyCustomChallenge() argument
389 int32_t ret = GetChallengePos(keyNode->authRuntimeParamSet, &pos); in VerifyCustomChallenge()
392 return HksVerifyKeyChallenge(keyNode, authToken, pos, BYTES_PER_POS); in VerifyCustomChallenge()
395 static int32_t VerifyNormalChallenge(const struct HuksKeyNode *keyNode, const struct HksUserAuthTok… in VerifyNormalChallenge() argument
[all …]
Dhks_core_service.c175 struct HksKeyNode *keyNode = HksGenerateKeyNode(&tempKey); in GetAgreeBaseKey() local
178 … HKS_IF_NULL_LOGE_RETURN(keyNode, HKS_ERROR_BAD_STATE, "generating keynode with agree key failed") in GetAgreeBaseKey()
181 int32_t ret = HksCheckKeybBlobIsSupportUserAuth(keyNode->paramSet, &isSupportUserAuth); in GetAgreeBaseKey()
184 HksFreeKeyNode(&keyNode); in GetAgreeBaseKey()
190 HksFreeKeyNode(&keyNode); in GetAgreeBaseKey()
194 ret = HksGetRawKey(keyNode->paramSet, keyOut); in GetAgreeBaseKey()
197 HksFreeKeyNode(&keyNode); in GetAgreeBaseKey()
312 static int32_t CipherAuth(const struct HksKeyNode *keyNode, const struct HksParamSet *paramSet) in CipherAuth() argument
319 return HksAuth(HKS_AUTH_ID_SYM_CIPHER, keyNode, paramSet); in CipherAuth()
321 return HksAuth(HKS_AUTH_ID_ASYM_CIPHER, keyNode, paramSet); in CipherAuth()
[all …]
Dhks_auth.c155 int32_t HksAuth(uint32_t authId, const struct HksKeyNode *keyNode, const struct HksParamSet *paramS… in HksAuth() argument
158 int32_t ret = HksCheckKeybBlobIsSupportUserAuth(keyNode->paramSet, &isSupportUserAuth); in HksAuth()
171 return AuthPolicy(&g_authPolicyList[i], keyNode->paramSet, paramSet); in HksAuth()
177 int32_t HksThreeStageAuth(uint32_t authId, const struct HuksKeyNode *keyNode) in HksThreeStageAuth() argument
181 … return AuthPolicy(&g_authPolicyList[i], keyNode->keyBlobParamSet, keyNode->runtimeParamSet); in HksThreeStageAuth()
Dhks_keyblob.c61 void HksFreeKeyNode(struct HksKeyNode **keyNode) in HksFreeKeyNode() argument
63 if ((keyNode == NULL) || (*keyNode == NULL) || ((*keyNode)->refCnt == 0)) { in HksFreeKeyNode()
67 (*keyNode)->refCnt--; in HksFreeKeyNode()
68 if (((*keyNode)->status == HKS_KEYNODE_INACTIVE) && ((*keyNode)->refCnt == 0)) { in HksFreeKeyNode()
69 CleanKey((*keyNode)->paramSet); in HksFreeKeyNode()
70 HksFreeParamSet(&(*keyNode)->paramSet); in HksFreeKeyNode()
71 HKS_FREE_PTR(*keyNode); in HksFreeKeyNode()
72 *keyNode = NULL; in HksFreeKeyNode()
434 struct HksKeyNode *keyNode = (struct HksKeyNode *)HksMalloc(sizeof(struct HksKeyNode)); in HksGenerateKeyNode() local
435 if (keyNode == NULL) { in HksGenerateKeyNode()
[all …]
Dhks_upgrade_key.c298 struct HksKeyNode *keyNode = NULL; in HksUpgradeKey() local
300 keyNode = HksGenerateKeyNode(oldKey); in HksUpgradeKey()
301 if (keyNode == NULL) { in HksUpgradeKey()
307 … ret = HksGetParamSet(keyNode->paramSet, keyNode->paramSet->paramSetSize, &oldKeyBlobParamSet); in HksUpgradeKey()
326 HksFreeKeyNode(&keyNode); in HksUpgradeKey()
Dhks_sm_import_wrap_key.c103 …2_t GetPublicKeyAndSignDataLength(const struct HksBlob *wrappedKeyData, struct HksKeyNode *keyNode, in GetPublicKeyAndSignDataLength() argument
106 if ((dataParams == NULL) || (keyNode == NULL)) { in GetPublicKeyAndSignDataLength()
120 … ret = GetHksPubKeyInnerFormat(keyNode->paramSet, &peerPubKeyPart, &dataParams->peerPublicKey); in GetPublicKeyAndSignDataLength()
178 struct HksKeyNode *keyNode, struct HksSmWrappedKeyDataBlob *dataParams, uint32_t *partOffset) in DecryptKekWithSm2() argument
202 ret = HksGetRawKey(keyNode->paramSet, &rawKey); in DecryptKekWithSm2()
479 struct HksKeyNode *keyNode, const struct HksBlob *wrappedKeyData, struct HksBlob *keyOut) in HksSmImportWrappedKeyWithVerify() argument
488 ret = GetPublicKeyAndSignDataLength(wrappedKeyData, keyNode, &dataParams, &partOffset); in HksSmImportWrappedKeyWithVerify()
492 ret = DecryptKekWithSm2(wrappedKeyData, paramSet, keyNode, &dataParams, &partOffset); in HksSmImportWrappedKeyWithVerify()
523 struct HksKeyNode *keyNode, const struct HksBlob *wrappedKeyData, struct HksBlob *keyOut) in HksSmImportWrappedKeyWithoutVerify() argument
533 ret = DecryptKekWithSm2(wrappedKeyData, paramSet, keyNode, &dataParams, &partOffset); in HksSmImportWrappedKeyWithoutVerify()
Dhks_keyblob_lite.c307 struct HksKeyNode *keyNode = (struct HksKeyNode *)HksMalloc(sizeof(struct HksKeyNode)); in HksGenerateKeyNode() local
308 HKS_IF_NULL_LOGE_RETURN(keyNode, NULL, "malloc keynode failed") in HksGenerateKeyNode()
310 keyNode->refCnt = 1; in HksGenerateKeyNode()
311 keyNode->status = HKS_KEYNODE_INACTIVE; in HksGenerateKeyNode()
312 keyNode->handle = 0; in HksGenerateKeyNode()
327 keyNode->paramSet = keyBlobParamSet; in HksGenerateKeyNode()
331 HKS_FREE_PTR(keyNode); in HksGenerateKeyNode()
335 return keyNode; in HksGenerateKeyNode()
/base/security/huks/test/unittest/huks_standard_test/module_test/service_test/huks_engine/core/src/
Dhks_keynode_test.cpp82 struct HuksKeyNode *keyNode = HksCreateKeyNode(nullptr, paramSet); variable
83 EXPECT_EQ(keyNode == nullptr, true) << "HksKeyNodeTest001 HksCreateKeyNode not failed";
123 struct HuksKeyNode *keyNode = reinterpret_cast<HuksKeyNode *>(HksMalloc(sizeof(HuksKeyNode))); variable
124 ASSERT_EQ(keyNode == nullptr, false) << "keyNode malloc failed.";
125 FreeParamsForBuildKeyNode(&blob, &runtimeParamSet, &keyBlobParamSet, keyNode);
Dhks_keyblob_test.cpp183 struct HksKeyNode *keyNode = HksGenerateKeyNode(&keyBlob); variable
184 ASSERT_EQ(keyNode, nullptr);
Dhks_secure_access_test.cpp392 struct HuksKeyNode keyNode = { { nullptr, nullptr }, paramSet, nullptr, nullptr, 0 }; variable
393 ret = HksCoreSecureAccessInitParams(&keyNode, paramSet, &token);
/base/security/huks/services/huks_standard/huks_engine/main/device_cert_manager/include/
Ddcm_attest.h123 int32_t CreateAttestCertChain(struct HksKeyNode *keyNode, const struct HksParamSet *paramSet,
/base/security/huks/services/huks_standard/huks_engine/main/device_cert_manager/src/
Ddcm_attest.c1276 static int32_t GetCertAndKey(const struct HksKeyNode *keyNode, struct HksAttestSpec *attestSpec) in GetCertAndKey() argument
1284 ret = HksGetRawKey(keyNode->paramSet, &attestSpec->attestKey); in GetCertAndKey()
1330 static int32_t BuildAttestSpec(const struct HksKeyNode *keyNode, const struct HksParamSet *paramSet, in BuildAttestSpec() argument
1340 HksFillUsageSpec(keyNode->paramSet, &attestSpec->usageSpec); in BuildAttestSpec()
1347 ret = BuildAttestClaims(paramSet, keyNode->paramSet, attestSpec); in BuildAttestSpec()
1355 ret = GetCertAndKey(keyNode, attestSpec); in BuildAttestSpec()
1444 int32_t CreateAttestCertChain(struct HksKeyNode *keyNode, const struct HksParamSet *paramSet, in CreateAttestCertChain() argument
1448 int32_t ret = BuildAttestSpec(keyNode, paramSet, &attestSpec); in CreateAttestCertChain()