diff --git a/LICENSE b/LICENSE old mode 100755 new mode 100644 diff --git a/OAT.xml b/OAT.xml old mode 100755 new mode 100644 diff --git a/README_ZH.md b/README_zh.md similarity index 100% rename from README_ZH.md rename to README_zh.md diff --git a/interfaces/innerkits/napi/BUILD.gn b/interfaces/innerkits/napi/BUILD.gn old mode 100755 new mode 100644 diff --git a/interfaces/innerkits/napi/include/auth_build.h b/interfaces/innerkits/napi/include/auth_build.h old mode 100755 new mode 100644 diff --git a/interfaces/innerkits/napi/include/auth_common.h b/interfaces/innerkits/napi/include/auth_common.h old mode 100755 new mode 100644 diff --git a/interfaces/innerkits/napi/include/auth_object.h b/interfaces/innerkits/napi/include/auth_object.h old mode 100755 new mode 100644 diff --git a/interfaces/innerkits/napi/include/authapi_callback.h b/interfaces/innerkits/napi/include/authapi_callback.h old mode 100755 new mode 100644 diff --git a/interfaces/innerkits/napi/include/result_convert.h b/interfaces/innerkits/napi/include/result_convert.h old mode 100755 new mode 100644 diff --git a/interfaces/innerkits/napi/include/user_auth_impl.h b/interfaces/innerkits/napi/include/user_auth_impl.h old mode 100755 new mode 100644 diff --git a/interfaces/innerkits/napi/src/auth_build.cpp b/interfaces/innerkits/napi/src/auth_build.cpp old mode 100755 new mode 100644 diff --git a/interfaces/innerkits/native/BUILD.gn b/interfaces/innerkits/native/BUILD.gn old mode 100755 new mode 100644 diff --git a/interfaces/innerkits/native/include/iuser_auth.h b/interfaces/innerkits/native/include/iuser_auth.h old mode 100755 new mode 100644 diff --git a/interfaces/innerkits/native/include/iuserauth_callback.h b/interfaces/innerkits/native/include/iuserauth_callback.h old mode 100755 new mode 100644 diff --git a/interfaces/innerkits/native/include/user_auth.h b/interfaces/innerkits/native/include/user_auth.h old mode 100755 new mode 100644 diff --git a/interfaces/innerkits/native/include/userauth_async_stub.h b/interfaces/innerkits/native/include/userauth_async_stub.h old mode 100755 new mode 100644 diff --git a/interfaces/innerkits/native/include/userauth_callback.h b/interfaces/innerkits/native/include/userauth_callback.h old mode 100755 new mode 100644 diff --git a/interfaces/innerkits/native/include/userauth_info.h b/interfaces/innerkits/native/include/userauth_info.h index 18bdd0e7c..0efd4179e 100644 --- a/interfaces/innerkits/native/include/userauth_info.h +++ b/interfaces/innerkits/native/include/userauth_info.h @@ -132,7 +132,7 @@ struct FreezInfo { AuthType authType; }; -struct UserInfo { +struct CallerInfo { uint64_t callerUID; int32_t userID {0}; std::string pkgName; diff --git a/interfaces/innerkits/native/include/userauth_proxy.h b/interfaces/innerkits/native/include/userauth_proxy.h old mode 100755 new mode 100644 diff --git a/services/include/userauth_adapter.h b/services/include/userauth_adapter.h index 91c28c0ef..22f2cbb8a 100644 --- a/services/include/userauth_adapter.h +++ b/services/include/userauth_adapter.h @@ -42,14 +42,14 @@ public: * after the callback of the coAuth is called to obtain the scheduling token * and the authentication result is successful. * */ - void CoauthSetPropAuthInfo(UserInfo userInfo, int32_t resultCode, + void CoauthSetPropAuthInfo(CallerInfo callerInfo, int32_t resultCode, UserAuthToken authToken, SetPropertyRequest requset); /* Set the executor authentication properties for freez or unfreez */ - void SetPropAuthInfo(UserInfo userInfo, int32_t resultCode, UserAuthToken authToken, + void SetPropAuthInfo(CallerInfo callerInfo, int32_t resultCode, UserAuthToken authToken, SetPropertyRequest requset, std::vector templateIds); /* get the executor authentication properties for Coauth */ - void GetPropAuthInfoCoauth(UserInfo userInfo, int32_t resultCode, + void GetPropAuthInfoCoauth(CallerInfo callerInfo, int32_t resultCode, UserAuthToken authToken, GetPropertyRequest requset, sptr &callback); int32_t GenerateSolution(AuthSolution param, std::vector &sessionIds); int32_t RequestAuthResult(uint64_t contextId, std::vector scheduleToken, UserAuthToken &authToken, @@ -70,7 +70,7 @@ private: ~UserAuthAdapter() = default; int32_t GetEachExecutorProp(GetPropertyRequest &requset, ExecutorProperty &result, uint32_t &value, std::shared_ptr pAuthAttributes); - int32_t SetProPropAuthInfo(OHOS::UserIAM::AuthResPool::AuthAttributes &authAttributes, UserInfo userInfo, + int32_t SetProPropAuthInfo(OHOS::UserIAM::AuthResPool::AuthAttributes &authAttributes, CallerInfo callerInfo, SetPropertyRequest requset, std::vector templateIds, std::shared_ptr &setPropCallback); }; diff --git a/services/include/userauth_async_proxy.h b/services/include/userauth_async_proxy.h old mode 100755 new mode 100644 diff --git a/services/include/userauth_datamgr.h b/services/include/userauth_datamgr.h old mode 100755 new mode 100644 diff --git a/services/include/userauth_stub.h b/services/include/userauth_stub.h old mode 100755 new mode 100644 diff --git a/services/src/userauth_adapter.cpp b/services/src/userauth_adapter.cpp index 10769f767..340305638 100644 --- a/services/src/userauth_adapter.cpp +++ b/services/src/userauth_adapter.cpp @@ -62,15 +62,15 @@ void UserAuthAdapter::GetPropAuthInfo(int32_t userID, uint64_t callerUID, std::s USERAUTH_HILOGI(MODULE_SERVICE, "UserAuth GetPropAuthInfo is end!"); } -void UserAuthAdapter::SetPropAuthInfo(UserInfo userInfo, int32_t resultCode, +void UserAuthAdapter::SetPropAuthInfo(CallerInfo callerInfo, int32_t resultCode, UserAuthToken authToken, SetPropertyRequest requset, std::vector templateIds) { USERAUTH_HILOGI(MODULE_SERVICE, "UserAuth SetPropAuthInfo is start!"); using namespace AuthResPool; FreezInfo freezInfo; - freezInfo.callerID = userInfo.callerUID; + freezInfo.callerID = callerInfo.callerUID; freezInfo.authType = requset.authType; - freezInfo.pkgName = userInfo.pkgName; + freezInfo.pkgName = callerInfo.pkgName; freezInfo.resultCode = resultCode; std::shared_ptr setPropCallback = @@ -80,7 +80,7 @@ void UserAuthAdapter::SetPropAuthInfo(UserInfo userInfo, int32_t resultCode, return; } AuthAttributes authAttributes; - int32_t ret = SetProPropAuthInfo(authAttributes, userInfo, requset, templateIds, setPropCallback); + int32_t ret = SetProPropAuthInfo(authAttributes, callerInfo, requset, templateIds, setPropCallback); if (ret != SUCCESS) { return; } @@ -89,7 +89,7 @@ void UserAuthAdapter::SetPropAuthInfo(UserInfo userInfo, int32_t resultCode, } int32_t UserAuthAdapter::SetProPropAuthInfo(OHOS::UserIAM::AuthResPool::AuthAttributes &authAttributes, - UserInfo userInfo, SetPropertyRequest requset, std::vector templateIds, + CallerInfo callerInfo, SetPropertyRequest requset, std::vector templateIds, std::shared_ptr &setPropCallback) { uint32_t value; @@ -110,7 +110,7 @@ int32_t UserAuthAdapter::SetProPropAuthInfo(OHOS::UserIAM::AuthResPool::AuthAttr setPropCallback->OnResult(ret, extraInfo); return ret; } - ret = authAttributes.SetUint64Value(AUTH_CALLER_UID, userInfo.callerUID); + ret = authAttributes.SetUint64Value(AUTH_CALLER_UID, callerInfo.callerUID); if (ret != SUCCESS) { USERAUTH_HILOGE(MODULE_SERVICE, "UserAuth SetUint32Value AUTH_CALLER_UID ERROR!"); std::vector extraInfo; @@ -118,9 +118,9 @@ int32_t UserAuthAdapter::SetProPropAuthInfo(OHOS::UserIAM::AuthResPool::AuthAttr return ret; } std::vector pkgNameValue; - userInfo.pkgName.resize(userInfo.pkgName.size()); + callerInfo.pkgName.resize(callerInfo.pkgName.size()); pkgNameValue.clear(); - pkgNameValue.assign(userInfo.pkgName.begin(), userInfo.pkgName.end()); + pkgNameValue.assign(callerInfo.pkgName.begin(), callerInfo.pkgName.end()); ret = authAttributes.SetUint8ArrayValue(AUTH_CALLER_NAME, pkgNameValue); if (ret != SUCCESS) { USERAUTH_HILOGE(MODULE_SERVICE, "UserAuth SetUint8ArrayValue->AUTH_CALLER_NAME ERROR!"); @@ -137,14 +137,14 @@ int32_t UserAuthAdapter::SetProPropAuthInfo(OHOS::UserIAM::AuthResPool::AuthAttr } return ret; } -void UserAuthAdapter::GetPropAuthInfoCoauth(UserInfo userInfo, int32_t resultCode, +void UserAuthAdapter::GetPropAuthInfoCoauth(CallerInfo callerInfo, int32_t resultCode, UserAuthToken authToken, GetPropertyRequest requset, sptr &callback) { USERAUTH_HILOGI(MODULE_SERVICE, "UserAuth GetPropAuthInfoCoauth is start!"); using namespace UserIDM; std::shared_ptr getInfoCallback = std::make_shared(callback, - userInfo.callerUID, userInfo.pkgName, resultCode, authToken, requset); - int32_t ret = UserIDMClient::GetInstance().GetAuthInfo(userInfo.userID, + callerInfo.callerUID, callerInfo.pkgName, resultCode, authToken, requset); + int32_t ret = UserIDMClient::GetInstance().GetAuthInfo(callerInfo.userID, static_cast(requset.authType), getInfoCallback); if (ret != SUCCESS) { USERAUTH_HILOGE(MODULE_SERVICE, "UserAuth GetPropAuthInfoCoauth ERROR!"); @@ -152,14 +152,14 @@ void UserAuthAdapter::GetPropAuthInfoCoauth(UserInfo userInfo, int32_t resultCod USERAUTH_HILOGI(MODULE_SERVICE, "UserAuth GetPropAuthInfoCoauth is end!"); } -void UserAuthAdapter::CoauthSetPropAuthInfo(UserInfo userInfo, int32_t resultCode, +void UserAuthAdapter::CoauthSetPropAuthInfo(CallerInfo callerInfo, int32_t resultCode, UserAuthToken authToken, SetPropertyRequest requset) { USERAUTH_HILOGI(MODULE_SERVICE, "UserAuth CoauthSetPropAuthInfo is start!"); using namespace UserIDM; std::shared_ptr setPropCallback = std::make_shared( - userInfo.callerUID, userInfo.pkgName, resultCode, authToken, requset); - int32_t ret = UserIDMClient::GetInstance().GetAuthInfo(userInfo.userID, + callerInfo.callerUID, callerInfo.pkgName, resultCode, authToken, requset); + int32_t ret = UserIDMClient::GetInstance().GetAuthInfo(callerInfo.userID, static_cast(requset.authType), setPropCallback); if (ret != SUCCESS) { USERAUTH_HILOGE(MODULE_SERVICE, "UserAuth CoauthSetPropAuthInfo ERROR!"); diff --git a/services/src/userauth_async_proxy.cpp b/services/src/userauth_async_proxy.cpp old mode 100755 new mode 100644 diff --git a/services/src/userauth_excallback_impl.cpp b/services/src/userauth_excallback_impl.cpp index eb2ebda10..7f2e5a26f 100644 --- a/services/src/userauth_excallback_impl.cpp +++ b/services/src/userauth_excallback_impl.cpp @@ -120,11 +120,11 @@ void UserAuthCallbackImplCoAuth::OnFinishHandleExtend(int32_t userID, SetPropert USERAUTH_HILOGD(MODULE_SERVICE, "RequestAuthResult SUCCESS"); setPropertyRequest.authType = UserAuth::FACE; setPropertyRequest.key = SetPropertyType::THAW_TEMPLATE; - UserInfo userInfo; - userInfo.callerUID = callerUid_; - userInfo.userID = userID; - userInfo.pkgName = pkgName_; - UserAuthAdapter::GetInstance().CoauthSetPropAuthInfo(userInfo, ret, authToken, setPropertyRequest); + CallerInfo callerInfo; + callerInfo.callerUID = callerUid_; + callerInfo.userID = userID; + callerInfo.pkgName = pkgName_; + UserAuthAdapter::GetInstance().CoauthSetPropAuthInfo(callerInfo, ret, authToken, setPropertyRequest); } } @@ -148,12 +148,12 @@ void UserAuthCallbackImplCoAuth::OnFinishHandle(uint32_t resultCode, std::vector SetPropertyRequest setPropertyRequest; GetPropertyRequest getPropertyRequest; AuthResult authResult; - UserInfo userInfo; + CallerInfo callerInfo; int32_t ret = GENERAL_ERROR; std::lock_guard lock(mutex_); - userInfo.callerUID = callerUid_; - userInfo.userID = userID_; - userInfo.pkgName = pkgName_; + callerInfo.callerUID = callerUid_; + callerInfo.userID = userID_; + callerInfo.pkgName = pkgName_; USERAUTH_HILOGD(MODULE_SERVICE, "OnFinishHandle scheduleTokensize:%{public}d, resultCode:%{public}u", scheduleToken.size(), resultCode); callbackNowCount_++; @@ -178,7 +178,7 @@ void UserAuthCallbackImplCoAuth::OnFinishHandle(uint32_t resultCode, std::vector USERAUTH_HILOGD(MODULE_SERVICE, "UserAuthCallbackImplCoAuth resultCode == LOCKED"); setPropertyRequest.authType = FACE; setPropertyRequest.key = SetPropertyType::FREEZE_TEMPLATE; - UserAuthAdapter::GetInstance().CoauthSetPropAuthInfo(userInfo, resultCode, authToken, + UserAuthAdapter::GetInstance().CoauthSetPropAuthInfo(callerInfo, resultCode, authToken, setPropertyRequest); } if (ret == SUCCESS) { @@ -187,7 +187,7 @@ void UserAuthCallbackImplCoAuth::OnFinishHandle(uint32_t resultCode, std::vector getPropertyRequest.authType = authType_; getPropertyRequest.keys.push_back(UserAuth::REMAIN_TIMES); getPropertyRequest.keys.push_back(UserAuth::FREEZING_TIME); - UserAuthAdapter::GetInstance().GetPropAuthInfoCoauth(userInfo, resultCode, + UserAuthAdapter::GetInstance().GetPropAuthInfoCoauth(callerInfo, resultCode, authToken, getPropertyRequest, callback_); DealFinishData(sessionIds); } @@ -283,10 +283,10 @@ UserAuthCallbackImplIDMCothGetPorpFreez::UserAuthCallbackImplIDMCothGetPorpFreez void UserAuthCallbackImplIDMCothGetPorpFreez::OnGetInfo(std::vector& info) { - UserInfo userInfo; - userInfo.callerUID = callerUid_; - userInfo.userID = 0; - userInfo.pkgName = pkgName_; + CallerInfo callerInfo; + callerInfo.callerUID = callerUid_; + callerInfo.userID = 0; + callerInfo.pkgName = pkgName_; USERAUTH_HILOGD(MODULE_SERVICE, "UserAuthCallbackImplIDMCothGetPorpFreez OnGetInfo enter"); std::vector templateIds; @@ -303,7 +303,7 @@ void UserAuthCallbackImplIDMCothGetPorpFreez::OnGetInfo(std::vector