Home
last modified time | relevance | path

Searched refs:authId (Results 1 – 25 of 48) sorted by relevance

12

/base/security/huks/test/reliability/src/
Dapi_pressure_test.cpp466 void ImportKeyTest(const struct HksBlob *authId, const struct HksParamSet *paramInSet);
467 void ExportPublicKeyTest(const struct HksBlob *authId, const struct HksParamSet *paramInSet);
469 void GetKeyParamSetTest(const struct HksBlob *authId, const struct HksParamSet *paramInSet);
470 void KeyExistTest(const struct HksBlob *authId, const struct HksParamSet *paramInSet);
472 …void SignTest(const struct HksBlob *authId, const struct HksParamSet *paramInSet, const struct Hks…
473 …void VerifyTest(const struct HksBlob *authId, const struct HksParamSet *paramInSet, const struct H…
475 void EncryptTest(const struct HksBlob *authId, const struct HksParamSet *paramInSet);
476 void DecryptTest(const struct HksBlob *authId, const struct HksParamSet *paramInSet,
478 void AgreeKeyTest(const struct HksBlob *authId);
479 void DeriveKeyTest(const struct HksBlob *authId, const struct HksParamSet *paramInSet);
[all …]
Dpressure_test.cpp66 …int32_t LocalHksGenerate(const uint32_t keyLen, const struct HksBlob *authId, const struct HksPara…
70 int32_t PressureTest::LocalHksGenerate(const uint32_t keyLen, const struct HksBlob *authId, in LocalHksGenerate() argument
86 if (HksGenerateKey(authId, paramSetIn, paramOutSet) != HKS_SUCCESS) { in LocalHksGenerate()
176 struct HksBlob authId = { strlen(GENERATE_KEY), (uint8_t *)GENERATE_KEY }; variable
196 int32_t ret = HksGenerateKey(&authId, paramInSet, NULL);
201 HksDeleteKey(&authId, paramInSet);
215 struct HksBlob authId = { strlen(GENERATE_KEY), (uint8_t *)GENERATE_KEY }; variable
233 HksGenerateKey(&authId, paramInSet, NULL);
237 HksExportPublicKey(&authId, paramInSet, &pubKey);
248 HksDeleteKey(&authId, paramInSet);
[all …]
/base/security/huks/test/unittest/huks_standard_test/three_stage_test/src/
Dhks_export_test_mt.cpp35 struct HksBlob authId = { strlen(keyAliasString), (uint8_t *)keyAliasString }; variable
46 ret = HksGenerateKey(&authId, paramInSet, nullptr); in RunTestCase()
76 EXPECT_EQ(HksDeleteKey(&authId, nullptr), HKS_SUCCESS);
91 EXPECT_EQ(HksDeleteKey(&authId, nullptr), HKS_SUCCESS);
104 EXPECT_EQ(HksDeleteKey(&authId, nullptr), HKS_SUCCESS);
119 EXPECT_EQ(HksDeleteKey(&authId, nullptr), HKS_SUCCESS);
137 EXPECT_EQ(HksDeleteKey(&authId, nullptr), HKS_SUCCESS);
153 EXPECT_EQ(HksDeleteKey(&authId, nullptr), HKS_SUCCESS);
166 EXPECT_EQ(HksExportPublicKey(&authId, nullptr, &publicKey), HKS_ERROR_INSUFFICIENT_DATA);
168 EXPECT_EQ(HksDeleteKey(&authId, nullptr), HKS_SUCCESS);
[all …]
Dhks_export_test.cpp44 struct HksBlob authId = { strlen(keyAliasString), (uint8_t *)keyAliasString }; in RunTestCase() local
53 ret = HksGenerateKey(&authId, paramInSet, nullptr); in RunTestCase()
62 ret = HksExportPublicKey(&authId, nullptr, &publicKey); in RunTestCase()
66 (void)HksDeleteKey(&authId, nullptr); in RunTestCase()
/base/security/device_auth/services/frameworks/src/module/
Ddev_auth_module_manager.c65 …ol IsParamsForDasTokenManagerValid(const char *pkgName, const char *serviceType, Uint8Buff *authId, in IsParamsForDasTokenManagerValid() argument
72 if (pkgName == NULL || serviceType == NULL || authId == NULL || authId->val == NULL) { in IsParamsForDasTokenManagerValid()
77 if (HcStrlen(pkgName) == 0 || HcStrlen(serviceType) == 0 || authId->length == 0) { in IsParamsForDasTokenManagerValid()
88 int32_t RegisterLocalIdentity(const char *pkgName, const char *serviceType, Uint8Buff *authId, int … in RegisterLocalIdentity() argument
91 if (!IsParamsForDasTokenManagerValid(pkgName, serviceType, authId, userType, moduleType)) { in RegisterLocalIdentity()
101 int32_t res = dasModule->registerLocalIdentity(pkgName, serviceType, authId, userType); in RegisterLocalIdentity()
109 int32_t UnregisterLocalIdentity(const char *pkgName, const char *serviceType, Uint8Buff *authId, in… in UnregisterLocalIdentity() argument
112 if (!IsParamsForDasTokenManagerValid(pkgName, serviceType, authId, userType, moduleType)) { in UnregisterLocalIdentity()
122 int32_t res = dasModule->unregisterLocalIdentity(pkgName, serviceType, authId, userType); in UnregisterLocalIdentity()
130 int32_t DeletePeerAuthInfo(const char *pkgName, const char *serviceType, Uint8Buff *authId, int use… in DeletePeerAuthInfo() argument
[all …]
/base/security/device_auth/services/authenticators/src/account_unrelated/
Ddas_module.c32 …sterDasLocalIdentity(const char *pkgName, const char *serviceType, Uint8Buff *authId, int userType) in RegisterDasLocalIdentity() argument
34 return RegisterLocalIdentityInTask(pkgName, serviceType, authId, userType); in RegisterDasLocalIdentity()
37 …sterDasLocalIdentity(const char *pkgName, const char *serviceType, Uint8Buff *authId, int userType) in UnregisterDasLocalIdentity() argument
39 return UnregisterLocalIdentityInTask(pkgName, serviceType, authId, userType); in UnregisterDasLocalIdentity()
42 …eleteDasPeerAuthInfo(const char *pkgName, const char *serviceType, Uint8Buff *authId, int userType) in DeleteDasPeerAuthInfo() argument
44 return DeletePeerAuthInfoInTask(pkgName, serviceType, authId, userType); in DeleteDasPeerAuthInfo()
47 static int32_t GetDasPublicKey(const char *pkgName, const char *serviceType, Uint8Buff *authId, int… in GetDasPublicKey() argument
50 return GetPublicKeyInTask(pkgName, serviceType, authId, userType, returnPk); in GetDasPublicKey()
Ddas_task_common.c204 const Uint8Buff *authId, Uint8Buff *keyAliasHash) in CombineKeyAlias() argument
208 keyAliasBuff.length = serviceId->length + authId->length + keyType->length; in CombineKeyAlias()
231 …if (memcpy_s(keyAliasBuff.val + usedLen, totalLen - usedLen, authId->val, authId->length) != EOK) { in CombineKeyAlias()
248 const Uint8Buff *authId, Uint8Buff *outKeyAlias) in CombineKeyAliasForIso() argument
253 int32_t res = CombineKeyAlias(serviceId, keyType, authId, outKeyAlias); in CombineKeyAliasForIso()
262 const Uint8Buff *authId, Uint8Buff *outKeyAlias) in CombineKeyAliasForPake() argument
277 res = CombineKeyAlias(serviceId, keyType, authId, &keyAliasHash); in CombineKeyAliasForPake()
301 const KeyAliasType keyType, const Uint8Buff *authId, Uint8Buff *outKeyAlias) in GenerateKeyAlias() argument
307 CHECK_PTR_RETURN_ERROR_CODE(authId, "authId"); in GenerateKeyAlias()
308 CHECK_PTR_RETURN_ERROR_CODE(authId->val, "authId->val"); in GenerateKeyAlias()
[all …]
/base/security/device_auth/services/frameworks/inc/module/
Ddev_auth_module_manager.h37 Uint8Buff *authId; member
50 int32_t RegisterLocalIdentity(const char *pkgName, const char *serviceType, Uint8Buff *authId, int …
52 int32_t UnregisterLocalIdentity(const char *pkgName, const char *serviceType, Uint8Buff *authId, in…
54 int32_t DeletePeerAuthInfo(const char *pkgName, const char *serviceType, Uint8Buff *authId, int use…
/base/security/huks/services/huks_standard/huks_engine/main/core/include/
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);
/base/security/huks/services/huks_standard/huks_engine/main/core/src/
Dhks_auth.c26 uint32_t authId; member
154 int32_t HksAuth(uint32_t authId, const struct HksKeyNode *keyNode, const struct HksParamSet *paramS… in HksAuth() argument
157 if (authId == g_authPolicyList[i].authId) { in HksAuth()
164 int32_t HksThreeStageAuth(uint32_t authId, const struct HuksKeyNode *keyNode) in HksThreeStageAuth() argument
167 if (authId == g_authPolicyList[i].authId) { in HksThreeStageAuth()
/base/security/device_auth/services/authenticators/src/account_unrelated/pake_task/
Dpake_task_common.c137 const char *authId = GetStringFromJson(in, FIELD_SELF_AUTH_ID); in FillAuthId() local
138 if (authId == NULL) { in FillAuthId()
142 uint32_t authIdLen = strlen(authId); in FillAuthId()
153 …(params->baseParams.idSelf.val, params->baseParams.idSelf.length, authId, strlen(authId)) != EOK) { in FillAuthId()
159 authId = GetStringFromJson(in, FIELD_PEER_AUTH_ID); in FillAuthId()
160 if (authId == NULL) { in FillAuthId()
164 authIdLen = strlen(authId); in FillAuthId()
175 …(params->baseParams.idPeer.val, params->baseParams.idPeer.length, authId, strlen(authId)) != EOK) { in FillAuthId()
/base/security/device_auth/services/authenticators/src/account_unrelated/pake_task/standard_exchange_task/
Ddas_standard_token_manager.c21 …egisterLocalIdentity(const char *pkgName, const char *serviceType, Uint8Buff *authId, int userType) in RegisterLocalIdentity() argument
29 int32_t res = GenerateKeyAlias(&pkgNameBuff, &serviceTypeBuff, keyType, authId, &keyAliasBuff); in RegisterLocalIdentity()
41 …ExtraInfo exInfo = { *authId, -1, -1 }; /* UserType and pairType are not required when generating … in RegisterLocalIdentity()
52 …egisterLocalIdentity(const char *pkgName, const char *serviceType, Uint8Buff *authId, int userType) in UnregisterLocalIdentity() argument
60 …int32_t res = GenerateKeyAlias(&pkgNameBuff, &serviceTypeBuff, keyType, authId, &pakeKeyAliasBuff); in UnregisterLocalIdentity()
170 static int32_t GetPublicKey(const char *pkgName, const char *serviceType, Uint8Buff *authId, int us… in GetPublicKey() argument
179 int32_t res = GenerateKeyAlias(&pkgNameBuff, &serviceTypeBuff, keyType, authId, &keyAliasBuff); in GetPublicKey()
/base/security/device_auth/services/authenticators/inc/account_unrelated/
Ddas_task_main.h39 int32_t RegisterLocalIdentityInTask(const char *pkgName, const char *serviceType, Uint8Buff *authId
40 …LocalIdentityInTask(const char *pkgName, const char *serviceType, Uint8Buff *authId, int userType);
Ddas_task_common.h25 const Uint8Buff *authId, Uint8Buff *outKeyAlias);
/base/security/device_auth/services/authenticators/src/account_unrelated/iso_task/
Diso_task_common.c294 const char *authId = GetStringFromJson(in, FIELD_SELF_AUTH_ID); in FillAuthId() local
295 if (authId == NULL) { in FillAuthId()
299 uint32_t authIdLen = strlen(authId); in FillAuthId()
311 authId, strlen(authId)) != EOK) { in FillAuthId()
320 authId = GetStringFromJson(in, FIELD_PEER_AUTH_ID); in FillAuthId()
321 if (authId == NULL) { in FillAuthId()
325 authIdLen = strlen(authId); in FillAuthId()
337 authId, strlen(authId)) != EOK) { in FillAuthId()
538 Uint8Buff authId = { NULL, 0 }; in GenerateKeyAliasInIso() local
540 authId.val = params->baseParams.authIdPeer.val; in GenerateKeyAliasInIso()
[all …]
/base/security/device_auth/services/group_manager/src/session/bind_session/
Dbind_session_common.c61 const char *authId = GetStringFromJson(session->params, FIELD_AUTH_ID); in AddDevInfoToSendData() local
62 if (authId == NULL) { in AddDevInfoToSendData()
71 if (AddStringToJson(data, FIELD_PEER_DEVICE_ID, authId) != HC_SUCCESS) { in AddDevInfoToSendData()
165 const char *authId = GetStringFromJson(session->params, FIELD_AUTH_ID); in AddGroupAndDevInfoToParams() local
166 if (authId == NULL) { in AddGroupAndDevInfoToParams()
179 if (AddStringToJson(moduleParams, FIELD_SELF_AUTH_ID, authId) != HC_SUCCESS) { in AddGroupAndDevInfoToParams()
303 if (AddStringToJson(params, FIELD_AUTH_ID, StringGet(&devAuthParams->authId)) != HC_SUCCESS) { in AddDevInfoToParams()
442 …kAuthIdAndUserTypeValid(int32_t osAccountId, int userType, const char *groupId, const char *authId) in CheckAuthIdAndUserTypeValid() argument
464 const char *oriAuthId = StringGet(&deviceInfo->authId); in CheckAuthIdAndUserTypeValid()
465 …if ((deviceInfo->devType != userType) || ((oriAuthId != NULL) && (strcmp(oriAuthId, authId) != 0))… in CheckAuthIdAndUserTypeValid()
[all …]
/base/security/huks/test/unittest/huks_standard_test/interface_inner_test/alg_module_test/src/
Dhks_rsa_common_mt.cpp166 struct HksBlob authId = { in EncryptServiceTestCase() local
202 EXPECT_EQ(HksImportKey(&authId, paramInSet, &x509Key), HKS_SUCCESS); in EncryptServiceTestCase()
206 … EXPECT_EQ(HksEncrypt(&authId, paramInSet, &plainText, &cipherText), testCaseParams.encryptResult); in EncryptServiceTestCase()
221 (void)HksDeleteKey(&authId, nullptr); in EncryptServiceTestCase()
294 struct HksBlob authId = { in DecryptServiceTestCase() local
309 EXPECT_EQ(HksGenerateKey(&authId, paramInSet, paramSetOut), HKS_SUCCESS); in DecryptServiceTestCase()
313 EXPECT_EQ(HksExportPublicKey(&authId, paramInSet, &opensslRsaKeyInfo), HKS_SUCCESS); in DecryptServiceTestCase()
338 …EXPECT_EQ(HksDecrypt(&authId, paramInSet, &cipherText, &decryptedText), testCaseParams.decryptResu… in DecryptServiceTestCase()
346 (void)HksDeleteKey(&authId, nullptr); in DecryptServiceTestCase()
419 struct HksBlob authId = { .size = testCaseParams.alias.length(), in SignServiceTestCase() local
[all …]
Dhks_hmac_mt.cpp281 …void LocalHmacScenario(int32_t scenario, struct HksBlob *authId, const TestCaseParams &testCasePar… in LocalHmacScenario() argument
300 … EXPECT_EQ(HksGenerateKey(authId, paramInSet, paramOutSet), testCaseParams.generateKeyResult); in LocalHmacScenario()
302 EXPECT_EQ(HmacGenerateKey(HMAC_KEY_SIZE, authId), testCaseParams.generateKeyResult); in LocalHmacScenario()
319 HksFree(authId->data); in LocalHmacScenario()
330 struct HksBlob authId = { (uint32_t)strlen(HMAC_KEY), (uint8_t *)HMAC_KEY }; in RunTestCase() local
347 LocalHmacScenario(scenario, &authId, testCaseParams, &macForHuks, &message); in RunTestCase()
349 EXPECT_EQ(HksGenerateKey(&authId, paramInSet, NULL), testCaseParams.generateKeyResult); in RunTestCase()
350 … EXPECT_EQ(HksMac(&authId, paramInSet, &message, &macForHuks), testCaseParams.hmacResult); in RunTestCase()
353 (void)HksDeleteKey(&authId, nullptr); in RunTestCase()
Dhks_aes_decrypt_mt.cpp442 …struct HksBlob authId = { .size = AUTHID_KEY_SIZE, .data = (uint8_t *)HksMalloc(AUTHID_KEY_SIZE) }; in RunTestCase() local
443 ASSERT_NE(authId.data, nullptr); in RunTestCase()
454 EXPECT_EQ(GenerateAesKey(keySize, &authId), testCaseParams.generateKeyResult); in RunTestCase()
470 …AesGcmEncrypt(paramInSet, &plainText, &cipherText, &authId, &tagAead), testCaseParams.encryptResul… in RunTestCase()
475 … EXPECT_EQ(AesEncrypt(paramInSet, &plainText, &cipherText, &authId), testCaseParams.encryptResult); in RunTestCase()
477 …EXPECT_EQ(HksDecrypt(&authId, paramInSet, &cipherText, &plainTextDecrypt), testCaseParams.decryptR… in RunTestCase()
483 HksFree(authId.data); in RunTestCase()
Dhks_aes_encrypt_mt.cpp439 …struct HksBlob authId = { .size = AUTHID_KEY_SIZE, .data = (uint8_t *)HksMalloc(AUTHID_KEY_SIZE) }; in RunTestCase() local
440 ASSERT_NE(authId.data, nullptr); in RunTestCase()
451 EXPECT_EQ(GenerateAesKey(keySize, &authId), testCaseParams.generateKeyResult); in RunTestCase()
463 … EXPECT_EQ(HksEncrypt(&authId, paramInSet, &plainText, &cipherText), testCaseParams.encryptResult); in RunTestCase()
470 … EXPECT_EQ(AesGcmDecrypt(paramInSet, &cipherText, &plainTextDecrypt, &authId, &tagAead), in RunTestCase()
475 … AesDecrypt(paramInSet, &cipherText, &plainTextDecrypt, &authId), testCaseParams.decryptResult); in RunTestCase()
481 HksFree(authId.data); in RunTestCase()
/base/security/device_auth/services/group_manager/src/group_operation/
Dgroup_operation_common.c84 params.authId = deviceId; in GetTrustedDeviceEntryById()
278 params.authId = peerDeviceId; in GetRelatedGroups()
430 const char *authId = StringGet(&deviceInfo->authId); in AddAuthIdToReturn() local
431 if (authId == NULL) { in AddAuthIdToReturn()
435 if (AddStringToJson(json, FIELD_AUTH_ID, authId) != HC_SUCCESS) { in AddAuthIdToReturn()
752 const char *authId = GetStringFromJson(jsonParams, FIELD_DEVICE_ID); in AddAuthIdToParamsOrDefault() local
754 if (authId == NULL) { in AddAuthIdToParamsOrDefault()
761 authId = udid; in AddAuthIdToParamsOrDefault()
763 if (!StringSetPointer(&devParams->authId, authId)) { in AddAuthIdToParamsOrDefault()
772 const char *authId = GetStringFromJson(jsonParams, FIELD_DEVICE_ID); in AddAuthIdToParams() local
[all …]
/base/security/device_auth/services/authenticators/src/account_unrelated/iso_task/lite_exchange_task/
Ddas_lite_token_manager.c22 …egisterLocalIdentity(const char *pkgName, const char *serviceType, Uint8Buff *authId, int userType) in UnregisterLocalIdentity() argument
31 …int32_t res = GenerateKeyAlias(&pkgNameBuff, &serviceTypeBuff, KEY_ALIAS_AUTH_TOKEN, authId, &isoK… in UnregisterLocalIdentity()
/base/security/device_auth/services/data_manager/inc/
Ddata_manager.h47 HcString authId; /* id by service defined for authentication */ member
71 const char *authId; member
/base/security/device_auth/services/data_manager/src/
Ddata_manager.c60 TlvString authId; member
95 TLV_MEMBER(TlvString, authId, 0x4103)
270 if (!StringSet(&returnEntry->authId, entry->authId)) { in GenerateDeviceEntryFromEntry()
332 if (!StringSet(&deviceEntry->authId, device->authId.data)) { in GenerateDeviceEntryFromTlv()
559 if (!StringSet(&element->authId.data, entry->authId)) { in SetDeviceElement()
704 if ((params->authId != NULL) && (strcmp(params->authId, StringGet(&entry->authId)) != 0)) { in CompareQueryDeviceParams()
804 .authId = NULL, in InitQueryDeviceParams()
859 ptr->authId = CreateString(); in CreateDeviceEntry()
870 DeleteString(&deviceEntry->authId); in DestroyDeviceEntry()
/base/security/device_auth/services/group_auth/src/group_auth_manager/
Dgroup_auth_data_operation.c38 if (!StringSet(&returnEntry->authId, entry->authId)) { in GaDeepCopyDeviceEntry()
193 params.authId = deviceId; in GaGetTrustedDeviceEntryById()

12