/base/useriam/pin_auth/services/modules/inputters/src/ |
D | pin_auth_manager.cpp | 26 bool PinAuthManager::RegisterInputer(uint32_t tokenId, const sptr<InputerGetData> &inputer) in RegisterInputer() argument 29 IAM_LOGI("start, tokenId = %{public}u", tokenId); in RegisterInputer() 30 if (pinAuthInputerMap_.find(tokenId) != pinAuthInputerMap_.end()) { in RegisterInputer() 38 pinAuthInputerMap_.emplace(tokenId, inputer); in RegisterInputer() 39 …tr<IRemoteObject::DeathRecipient> dr = new (std::nothrow) ResPinauthInputerDeathRecipient(tokenId); in RegisterInputer() 43 pinAuthDeathMap_.emplace(tokenId, dr); in RegisterInputer() 52 void PinAuthManager::UnRegisterInputer(uint32_t tokenId) in UnRegisterInputer() argument 55 IAM_LOGI("start, tokenId = %{public}u", tokenId); in UnRegisterInputer() 56 if (pinAuthInputerMap_.find(tokenId) != pinAuthInputerMap_.end()) { in UnRegisterInputer() 57 if (pinAuthDeathMap_.find(tokenId) != pinAuthDeathMap_.end()) { in UnRegisterInputer() [all …]
|
/base/security/access_token/interfaces/innerkits/nativetoken/test/unittest/src/ |
D | nativetoken_kit_test.cpp | 156 uint64_t tokenId; in Start() local 178 tokenId = GetAccessTokenId(&infoInstance); in Start() 182 return tokenId; in Start() 198 uint64_t tokenId; variable 213 tokenId = GetAccessTokenId(&infoInstance); 214 ASSERT_EQ(tokenId, 0); 216 tokenId = GetAccessTokenId(&infoInstance); 217 ASSERT_EQ(tokenId, 0); 222 tokenId = GetAccessTokenId(&infoInstance); 223 ASSERT_EQ(tokenId, 0); [all …]
|
/base/security/access_token/interfaces/innerkits/accesstoken/test/unittest/accesstoken_mock_test/ |
D | accesstoken_kit_test.cpp | 77 AccessTokenID tokenId = 123; variable 78 AccessTokenID localTokenId = AccessTokenKit::AllocLocalTokenID(remoteDevice, tokenId); 92 AccessTokenID tokenId = 123; variable 94 … AccessTokenKit::UpdateHapToken(tokenId, appIDDesc, apiVersion, g_infoManagerTestPolicyPrams)); 105 AccessTokenID tokenId = 123; variable 106 ASSERT_EQ(AccessTokenError::ERR_SA_WORK_ABNORMAL, AccessTokenKit::DeleteToken(tokenId)); 117 AccessTokenID tokenId = 123; variable 118 ASSERT_EQ(TOKEN_INVALID, AccessTokenKit::GetTokenType(tokenId)); 129 AccessTokenID tokenId = 123; variable 131 … ASSERT_EQ(AccessTokenError::ERR_SA_WORK_ABNORMAL, AccessTokenKit::CheckNativeDCap(tokenId, dcap)); [all …]
|
/base/security/access_token/services/privacymanager/test/unittest/ |
D | permission_record_manager_test.cpp | 156 …AccessTokenID tokenId = AccessTokenKit::GetHapTokenID(g_InfoParms1.userID, g_InfoParms1.bundleName, in TearDown() local 158 AccessTokenKit::DeleteToken(tokenId); in TearDown() 159 tokenId = AccessTokenKit::GetHapTokenID(g_InfoParms2.userID, g_InfoParms2.bundleName, in TearDown() 161 AccessTokenKit::DeleteToken(tokenId); in TearDown() 173 virtual void StateChangeNotify(AccessTokenID tokenId, bool isShow) in StateChangeNotify() argument 270 g_recordA1.tokenId = tokenId1; 271 g_recordA2.tokenId = tokenId1; 272 g_recordB1.tokenId = tokenId2; 273 g_recordB2.tokenId = tokenId2; 297 …AccessTokenID tokenId = AccessTokenKit::GetHapTokenID(g_InfoParms1.userID, g_InfoParms1.bundleName, variable [all …]
|
D | privacy_manager_service_test.cpp | 111 …AccessTokenID tokenId = AccessTokenKit::GetHapTokenID(g_InfoParms1.userID, g_InfoParms1.bundleName, in TearDown() local 113 AccessTokenKit::DeleteToken(tokenId); in TearDown() 114 tokenId = AccessTokenKit::GetHapTokenID(g_InfoParms2.userID, g_InfoParms2.bundleName, in TearDown() 116 AccessTokenKit::DeleteToken(tokenId); in TearDown() 176 …AccessTokenID tokenId = AccessTokenKit::GetHapTokenID(g_InfoParms1.userID, g_InfoParms1.bundleName, variable 179 std::string tokenIdStr = std::to_string(tokenId); 186 privacyManagerService_->AddPermissionUsedRecord(tokenId, permission, 1, 0); 191 privacyManagerService_->AddPermissionUsedRecord(tokenId, permission, 1, 0); 203 AccessTokenID tokenId = AccessTokenKit::GetNativeTokenId("privacy_service"); variable 204 ASSERT_NE(INVALID_TOKENID, tokenId); [all …]
|
/base/security/access_token/services/privacymanager/include/record/ |
D | permission_record_manager.h | 50 …AccessTokenID tokenId, const std::string& permissionName, int32_t successCount, int32_t failCount); 51 void RemovePermissionUsedRecords(AccessTokenID tokenId, const std::string& deviceID); 55 int32_t StartUsingPermission(AccessTokenID tokenId, const std::string& permissionName); 56 int32_t StartUsingPermission(AccessTokenID tokenId, const std::string& permissionName, 58 int32_t StopUsingPermission(AccessTokenID tokenId, const std::string& permissionName); 63 void CallbackExecute(AccessTokenID tokenId, const std::string& permissionName, int32_t status); 65 bool IsAllowedUsingPermission(AccessTokenID tokenId, const std::string& permissionName); 69 void NotifyAppStateChange(AccessTokenID tokenId, ActiveChangeType status); 70 void NotifyCameraFloatWindowChange(AccessTokenID tokenId, bool isShowing); 82 int32_t GetPermissionRecord(AccessTokenID tokenId, const std::string& permissionName, [all …]
|
/base/security/access_token/services/privacymanager/src/record/ |
D | permission_record_manager.cpp | 81 record.tokenId, record.opCode, record.status, record.timestamp); in AddRecord() 85 int32_t PermissionRecordManager::GetPermissionRecord(AccessTokenID tokenId, const std::string& perm… in GetPermissionRecord() argument 89 if (AccessTokenKit::GetHapTokenInfo(tokenId, tokenInfo) != Constant::SUCCESS) { in GetPermissionRecord() 90 ACCESSTOKEN_LOG_ERROR(LABEL, "invalid tokenId(%{public}d)", tokenId); in GetPermissionRecord() 101 record.status = GetAppStatus(tokenId); in GetPermissionRecord() 103 record.tokenId = tokenId; in GetPermissionRecord() 113 int32_t PermissionRecordManager::AddPermissionUsedRecord(AccessTokenID tokenId, const std::string& … in AddPermissionUsedRecord() argument 119 int32_t result = GetPermissionRecord(tokenId, permissionName, successCount, failCount, record); in AddPermissionUsedRecord() 132 void PermissionRecordManager::RemovePermissionUsedRecords(AccessTokenID tokenId, const std::string&… in RemovePermissionUsedRecords() argument 135 std::string device = GetDeviceId(tokenId); in RemovePermissionUsedRecords() [all …]
|
/base/security/access_token/interfaces/innerkits/accesstoken/test/unittest/src/ |
D | accesstoken_deny_test.cpp | 98 AccessTokenID tokenId = 123; variable 99 AccessTokenID localTokenId = AccessTokenKit::AllocLocalTokenID(remoteDevice, tokenId); 113 AccessTokenID tokenId = 123; variable 115 AccessTokenKit::UpdateHapToken(tokenId, appIDDesc, apiVersion, g_PolicyPrams)); 126 AccessTokenID tokenId = 123; variable 127 ASSERT_EQ(AccessTokenError::ERR_PERMISSION_DENIED, AccessTokenKit::DeleteToken(tokenId)); 138 AccessTokenID tokenId = 123; variable 140 …ASSERT_EQ(AccessTokenError::ERR_PERMISSION_DENIED, AccessTokenKit::CheckNativeDCap(tokenId, dcap)); 154 AccessTokenID tokenId = AccessTokenKit::GetHapTokenID(userID, bundleName, instIndex); variable 155 ASSERT_EQ(INVALID_TOKENID, tokenId); [all …]
|
/base/useriam/pin_auth/services/sa/src/ |
D | pin_auth_service.cpp | 79 uint32_t tokenId = this->GetFirstTokenID(); in GetTokenId() local 80 if (tokenId == 0) { in GetTokenId() 81 tokenId = this->GetCallingTokenID(); in GetTokenId() 83 return tokenId; in GetTokenId() 109 uint32_t tokenId = GetTokenId(); in CheckPermission() local 110 return AccessTokenKit::VerifyAccessToken(tokenId, permission) == RET_SUCCESS; in CheckPermission() 124 uint32_t tokenId = GetTokenId(); in RegisterInputer() local 125 return PinAuthManager::GetInstance().RegisterInputer(tokenId, inputer); in RegisterInputer() 135 uint32_t tokenId = GetTokenId(); in UnRegisterInputer() local 136 PinAuthManager::GetInstance().UnRegisterInputer(tokenId); in UnRegisterInputer()
|
/base/security/access_token/tools/accesstoken/src/ |
D | atm_command.cpp | 114 uint32_t tokenId = 0; in RunAsDumpCommand() local 136 results = RunAsCommandExistentOptionArgument(option, type, tokenId, permissionName); in RunAsDumpCommand() 142 results = RunCommandByOperationType(type, tokenId, permissionName); in RunAsDumpCommand() 151 uint32_t tokenId = 0; in RunAsPermCommand() local 173 result = RunAsCommandExistentOptionArgument(option, type, tokenId, permissionName); in RunAsPermCommand() 179 result = RunCommandByOperationType(type, tokenId, permissionName); in RunAsPermCommand() 185 uint32_t& tokenId, std::string& permissionName) in RunCommandByOperationType() argument 191 AccessTokenKit::DumpTokenInfo(tokenId, dumpInfo); in RunCommandByOperationType() 194 dumpInfo = DumpRecordInfo(tokenId, permissionName); in RunCommandByOperationType() 198 ret = ModifyPermission(type, tokenId, permissionName); in RunCommandByOperationType() [all …]
|
/base/security/access_token/services/accesstokenmanager/main/cpp/src/token/ |
D | accesstoken_id_manager.cpp | 61 AccessTokenID tokenId = *it; in RegisterTokenId() local 62 AccessTokenIDInner *idInnerExist = reinterpret_cast<AccessTokenIDInner *>(&tokenId); in RegisterTokenId() 85 AccessTokenID tokenId = *(AccessTokenID *)&innerId; in CreateTokenId() local 86 return tokenId; in CreateTokenId() 91 AccessTokenID tokenId = 0; in CreateAndRegisterTokenId() local 94 tokenId = CreateTokenId(type, dlpType); in CreateAndRegisterTokenId() 95 if (tokenId == INVALID_TOKENID) { in CreateAndRegisterTokenId() 100 int ret = RegisterTokenId(tokenId, type); in CreateAndRegisterTokenId() 107 tokenId = INVALID_TOKENID; in CreateAndRegisterTokenId() 110 return tokenId; in CreateAndRegisterTokenId()
|
/base/security/access_token/services/privacymanager/src/service/ |
D | privacy_manager_service.cpp | 76 … AccessTokenID tokenId, const std::string& permissionName, int32_t successCount, int32_t failCount) in AddPermissionUsedRecord() argument 79 tokenId, permissionName, successCount, failCount); in AddPermissionUsedRecord() 82 int32_t PrivacyManagerService::StartUsingPermission(AccessTokenID tokenId, const std::string& permi… in StartUsingPermission() argument 84 return PermissionRecordManager::GetInstance().StartUsingPermission(tokenId, permissionName); in StartUsingPermission() 87 int32_t PrivacyManagerService::StartUsingPermission(AccessTokenID tokenId, const std::string& permi… in StartUsingPermission() argument 90 …return PermissionRecordManager::GetInstance().StartUsingPermission(tokenId, permissionName, callba… in StartUsingPermission() 93 int32_t PrivacyManagerService::StopUsingPermission(AccessTokenID tokenId, const std::string& permis… in StopUsingPermission() argument 95 return PermissionRecordManager::GetInstance().StopUsingPermission(tokenId, permissionName); in StopUsingPermission() 98 int32_t PrivacyManagerService::RemovePermissionUsedRecords(AccessTokenID tokenId, const std::string… in RemovePermissionUsedRecords() argument 100 PermissionRecordManager::GetInstance().RemovePermissionUsedRecords(tokenId, deviceID); in RemovePermissionUsedRecords() [all …]
|
/base/security/access_token/interfaces/innerkits/privacy/test/unittest/privacy_mock_test/ |
D | privacy_kit_test.cpp | 58 AccessTokenID tokenId = 0xff; variable 62 …int32_t ret = PrivacyKit::AddPermissionUsedRecord(tokenId, permissionName, successCount, failCount… 74 AccessTokenID tokenId = 0xff; variable 76 int32_t ret = PrivacyKit::StartUsingPermission(tokenId, permissionName); 88 virtual void StateChangeNotify(AccessTokenID tokenId, bool isShow) in StateChangeNotify() argument 115 AccessTokenID tokenId = 0xff; variable 117 int32_t ret = PrivacyKit::StopUsingPermission(tokenId, permissionName); 129 AccessTokenID tokenId = 0xff; variable 131 int32_t ret = PrivacyKit::RemovePermissionUsedRecords(tokenId, device); 215 AccessTokenID tokenId = 0xff; variable [all …]
|
/base/security/access_token/test/fuzztest/access_token/dumptokeninfo_fuzzer/ |
D | dumptokeninfo_fuzzer.cpp | 31 AccessTokenID tokenId = 0; in DumpTokenInfoFuzzTest() local 36 tokenId = static_cast<AccessTokenID>(size); in DumpTokenInfoFuzzTest() 39 AccessTokenKit::DumpTokenInfo(tokenId, dumpInfo); in DumpTokenInfoFuzzTest() 41 return tokenId != 0; in DumpTokenInfoFuzzTest()
|
/base/useriam/user_auth_framework/services/ipc/src/ |
D | ipc_common.cpp | 50 uint32_t tokenId = GetAccessTokenId(stub); in GetCallingUserId() local 52 ATokenTypeEnum callingType = AccessTokenKit::GetTokenTypeFlag(tokenId); in GetCallingUserId() 58 int result = AccessTokenKit::GetHapTokenInfo(tokenId, hapTokenInfo); in GetCallingUserId() 114 uint32_t tokenId = stub.GetFirstTokenID(); in GetAccessTokenId() local 115 if (tokenId == 0) { in GetAccessTokenId() 116 tokenId = stub.GetCallingTokenID(); in GetAccessTokenId() 118 return tokenId; in GetAccessTokenId() 123 uint32_t tokenId = stub.GetCallingTokenID(); in CheckNativeCallingProcessWhiteList() local 125 ATokenTypeEnum callingType = AccessTokenKit::GetTokenTypeFlag(tokenId); in CheckNativeCallingProcessWhiteList() 131 int result = AccessTokenKit::GetNativeTokenInfo(tokenId, nativeTokenInfo); in CheckNativeCallingProcessWhiteList()
|
/base/theme/screenlock_mgr/utils/src/ |
D | screenlock_appinfo.cpp | 23 bool ScreenLockAppInfo::GetAppInfoByToken(std::uint32_t tokenId, AppInfo &appInfo) in GetAppInfoByToken() argument 25 int32_t tokenType = AccessTokenKit::GetTokenTypeFlag(tokenId); in GetAppInfoByToken() 29 if (AccessTokenKit::GetHapTokenInfo(tokenId, hapInfo) != 0) { in GetAppInfoByToken() 40 if (AccessTokenKit::GetNativeTokenInfo(tokenId, tokenInfo) != 0) { in GetAppInfoByToken()
|
/base/security/access_token/services/accesstokenmanager/main/cpp/src/permission/ |
D | permission_definition_cache.cpp | 45 bool PermissionDefinitionCache::Insert(const PermissionDef& info, AccessTokenID tokenId) in Insert() argument 55 permissionDefinitionMap_[info.permissionName].tokenId = tokenId; in Insert() 131 … genericValues.Put(TokenFiledConst::FIELD_TOKEN_ID, static_cast<int32_t>(it->second.tokenId)); in StorePermissionDef() 139 AccessTokenID tokenId) in GetDefPermissionsByTokenId() argument 144 if (tokenId == it->second.tokenId) { in GetDefPermissionsByTokenId() 155 AccessTokenID tokenId = (AccessTokenID)defValue.GetInt(TokenFiledConst::FIELD_TOKEN_ID); in RestorePermDefInfo() local 158 ACCESSTOKEN_LOG_ERROR(LABEL, "tokenId 0x%{public}x permDef is wrong.", tokenId); in RestorePermDefInfo() 161 Insert(def, tokenId); in RestorePermDefInfo()
|
/base/security/access_token/interfaces/innerkits/privacy/test/unittest/src/ |
D | permission_deny_test.cpp | 61 uint32_t tokenId = AccessTokenKit::GetHapTokenID(100, "com.ohos.camera", 0); in SetUp() local 62 SetSelfTokenID(tokenId); in SetUp() 68 AccessTokenID tokenId = AccessTokenKit::GetHapTokenID(g_InfoParms.userID, in TearDown() local 71 AccessTokenKit::DeleteToken(tokenId); in TearDown() 105 virtual void StateChangeNotify(AccessTokenID tokenId, bool isShow) in StateChangeNotify() argument 146 request.tokenId = g_testTokenId; 183 uint32_t tokenId = AccessTokenKit::GetHapTokenID(100, "com.ohos.camera", 0); variable 186 SetSelfTokenID(tokenId); 194 SetSelfTokenID(tokenId);
|
/base/security/access_token/services/privacymanager/include/service/ |
D | privacy_manager_service.h | 40 …AccessTokenID tokenId, const std::string& permissionName, int32_t successCount, int32_t failCount)… 41 int32_t StartUsingPermission(AccessTokenID tokenId, const std::string& permissionName) override; 42 int32_t StartUsingPermission(AccessTokenID tokenId, const std::string& permissionName, 44 int32_t StopUsingPermission(AccessTokenID tokenId, const std::string& permissionName) override; 45 … int32_t RemovePermissionUsedRecords(AccessTokenID tokenId, const std::string& deviceID) override; 53 … bool IsAllowedUsingPermission(AccessTokenID tokenId, const std::string& permissionName) override;
|
/base/security/access_token/services/accesstokenmanager/test/unittest/cpp/src/ |
D | accesstoken_info_manager_test.cpp | 537 …AccessTokenID tokenId = 537919487; // 537919487 is max hap tokenId: 001 00 0 000000 11111111111111… variable 538 ASSERT_EQ(RET_SUCCESS, AccessTokenIDManager::GetInstance().RegisterTokenId(tokenId, TOKEN_HAP)); 539 …ASSERT_EQ(RET_FAILED, AccessTokenInfoManager::GetInstance().RemoveHapTokenInfo(tokenId)); // count… 541 AccessTokenInfoManager::GetInstance().hapTokenInfoMap_[tokenId] = nullptr; 542 …ASSERT_EQ(RET_FAILED, AccessTokenInfoManager::GetInstance().RemoveHapTokenInfo(tokenId)); // info … 543 AccessTokenInfoManager::GetInstance().hapTokenInfoMap_.erase(tokenId); 549 AccessTokenInfoManager::GetInstance().hapTokenInfoMap_[tokenId] = info; 551 ASSERT_EQ(RET_SUCCESS, AccessTokenInfoManager::GetInstance().RemoveHapTokenInfo(tokenId)); 553 …ASSERT_EQ(RET_SUCCESS, AccessTokenIDManager::GetInstance().RegisterTokenId(tokenId, TOKEN_HAP)); /… 555 AccessTokenInfoManager::GetInstance().hapTokenInfoMap_[tokenId] = info; [all …]
|
/base/useriam/pin_auth/services/modules/inputters/inc/ |
D | pin_auth_manager.h | 37 bool RegisterInputer(uint32_t tokenId, const sptr<InputerGetData> &inputer); 38 void UnRegisterInputer(uint32_t tokenId); 39 sptr<InputerGetData> GetInputerLock(uint32_t tokenId); 47 explicit ResPinauthInputerDeathRecipient(uint32_t tokenId);
|
/base/notification/distributed_notification_service/frameworks/test/moduletest/mock/ |
D | remote_native_token.cpp | 22 uint64_t tokenId; in SetNativeToken() local 36 tokenId = GetAccessTokenId(&infoInstance); in SetNativeToken() 37 SetSelfTokenID(tokenId); in SetNativeToken()
|
/base/powermgr/power_manager/utils/permission/src/ |
D | permission.cpp | 37 AccessTokenID tokenId = IPCSkeleton::GetCallingTokenID(); in IsTokenAplMatch() local 40 ATokenTypeEnum type = AccessTokenKit::GetTokenTypeFlag(tokenId); in IsTokenAplMatch() 44 AccessTokenKit::GetNativeTokenInfo(tokenId, info); in IsTokenAplMatch() 101 AccessTokenID tokenId = IPCSkeleton::GetCallingTokenID(); in IsSystemHap() local 104 ATokenTypeEnum type = AccessTokenKit::GetTokenTypeFlag(tokenId); in IsSystemHap() 144 AccessTokenID tokenId = IPCSkeleton::GetCallingTokenID(); in IsPermissionGranted() local 147 ATokenTypeEnum type = AccessTokenKit::GetTokenTypeFlag(tokenId); in IsPermissionGranted() 153 result = AccessTokenKit::VerifyAccessToken(tokenId, perm); in IsPermissionGranted()
|
/base/security/access_token/test/fuzztest/access_token/getnativetokenid_fuzzer/ |
D | getnativetokenid_fuzzer.cpp | 31 AccessTokenID tokenId = 0; in GetNativeTokenIdFuzzTest() local 38 tokenId = AccessTokenKit::GetNativeTokenId(testName); in GetNativeTokenIdFuzzTest() 40 return tokenId != 0; in GetNativeTokenIdFuzzTest()
|
/base/security/access_token/tools/accesstoken/include/ |
D | atm_command.h | 49 OptType& type, uint32_t& tokenId, std::string& permissionName); 51 uint32_t& tokenId, std::string& permissionName); 54 ErrCode ModifyPermission(const OptType& type, uint32_t& tokenId, std::string& permissionName); 56 std::string DumpRecordInfo(uint32_t tokenId, const std::string& permissionName);
|