/base/security/huks/test/reliability/src/ |
D | api_pressure_test.cpp | 466 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 …]
|
D | pressure_test.cpp | 66 …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/ |
D | hks_export_test_mt.cpp | 35 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 …]
|
D | hks_export_test.cpp | 44 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/ |
D | dev_auth_module_manager.c | 65 …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/ |
D | das_module.c | 32 …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()
|
D | das_task_common.c | 204 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/ |
D | dev_auth_module_manager.h | 37 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/ |
D | hks_auth.h | 41 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/ |
D | hks_auth.c | 26 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/ |
D | pake_task_common.c | 137 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/ |
D | das_standard_token_manager.c | 21 …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/ |
D | das_task_main.h | 39 int32_t RegisterLocalIdentityInTask(const char *pkgName, const char *serviceType, Uint8Buff *authId… 40 …LocalIdentityInTask(const char *pkgName, const char *serviceType, Uint8Buff *authId, int userType);
|
D | das_task_common.h | 25 const Uint8Buff *authId, Uint8Buff *outKeyAlias);
|
/base/security/device_auth/services/authenticators/src/account_unrelated/iso_task/ |
D | iso_task_common.c | 294 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/ |
D | bind_session_common.c | 61 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/ |
D | hks_rsa_common_mt.cpp | 166 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 …]
|
D | hks_hmac_mt.cpp | 281 …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()
|
D | hks_aes_decrypt_mt.cpp | 442 …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()
|
D | hks_aes_encrypt_mt.cpp | 439 …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/ |
D | group_operation_common.c | 84 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/ |
D | das_lite_token_manager.c | 22 …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/ |
D | data_manager.h | 47 HcString authId; /* id by service defined for authentication */ member 71 const char *authId; member
|
/base/security/device_auth/services/data_manager/src/ |
D | data_manager.c | 60 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/ |
D | group_auth_data_operation.c | 38 if (!StringSet(&returnEntry->authId, entry->authId)) { in GaDeepCopyDeviceEntry() 193 params.authId = deviceId; in GaGetTrustedDeviceEntryById()
|