From abb461fefe998a83eb7b0e0699528271432523b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=AE=87=E6=99=96?= Date: Tue, 15 Jul 2025 08:07:04 +0000 Subject: [PATCH 01/13] =?UTF-8?q?=E5=91=8A=E8=AD=A6=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 王宇晖 --- commondependency/include/multiple_user_connector.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commondependency/include/multiple_user_connector.h b/commondependency/include/multiple_user_connector.h index 878375602..47b4dcb0c 100644 --- a/commondependency/include/multiple_user_connector.h +++ b/commondependency/include/multiple_user_connector.h @@ -130,7 +130,7 @@ public: std::vector &backgroundUserVec); DM_EXPORT static DMAccountInfo GetCurrentDMAccountInfo(); DM_EXPORT static void GetCallingTokenId(uint32_t &tokenId); - DM_EXPORT static int32_t GetUserIdByDisplayId(uint64_t displayId); + DM_EXPORT static int32_t GetUserIdByDisplayId(int32_t displayId); private: static int32_t oldUserId_; static std::string accountId_; -- Gitee From d9bd76ca4c4cc98952f984aef78922c026dd268f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=AE=87=E6=99=96?= Date: Tue, 15 Jul 2025 08:11:14 +0000 Subject: [PATCH 02/13] =?UTF-8?q?=E5=91=8A=E8=AD=A6=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 王宇晖 --- commondependency/src/multiple_user_connector.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/commondependency/src/multiple_user_connector.cpp b/commondependency/src/multiple_user_connector.cpp index 4855dd1b1..cb73734c0 100644 --- a/commondependency/src/multiple_user_connector.cpp +++ b/commondependency/src/multiple_user_connector.cpp @@ -408,9 +408,9 @@ DM_EXPORT void MultipleUserConnector::GetCallingTokenId(uint32_t &tokenId) #endif } -DM_EXPORT int32_t MultipleUserConnector::GetUserIdByDisplayId(uint64_t displayId) +DM_EXPORT int32_t MultipleUserConnector::GetUserIdByDisplayId(int32_t displayId) { - LOGI("displayId %{public}" PRIu64, displayId); + LOGI("displayId %{public}" PRId32, displayId); int32_t userId = -1; #if !(defined(__LITEOS_M__) || defined(LITE_DEVICE)) if (displayId == -1) { @@ -418,7 +418,8 @@ DM_EXPORT int32_t MultipleUserConnector::GetUserIdByDisplayId(uint64_t displayId return userId; } #ifdef OS_ACCOUNT_PART_EXISTS - int32_t ret = OHOS::AccountSA::OsAccountManager::GetForegroundOsAccountLocalId(displayId, userId); + int32_t ret = OHOS::AccountSA::OsAccountManager::GetForegroundOsAccountLocalId( + static_cast(displayId, userId)); if (ret != DM_OK) { LOGE("GetForegroundOsAccountLocalId failed ret %{public}d.", ret); } -- Gitee From 47705b95753a78a99cca39a1e87572eca72160d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=AE=87=E6=99=96?= Date: Tue, 15 Jul 2025 08:12:49 +0000 Subject: [PATCH 03/13] =?UTF-8?q?=E5=91=8A=E8=AD=A6=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 王宇晖 --- .../src/authentication_v2/auth_stages/auth_negotiate.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/implementation/src/authentication_v2/auth_stages/auth_negotiate.cpp b/services/implementation/src/authentication_v2/auth_stages/auth_negotiate.cpp index 0faacf702..69c6f4bf8 100644 --- a/services/implementation/src/authentication_v2/auth_stages/auth_negotiate.cpp +++ b/services/implementation/src/authentication_v2/auth_stages/auth_negotiate.cpp @@ -134,7 +134,7 @@ int32_t AuthSinkNegotiateStateMachine::RespQueryAcceseeIds(std::shared_ptraccessee.userId = MultipleUserConnector::GetUserIdByDisplayId( - static_cast(context->accessee.displayId)); + context->accessee.displayId); if (context->accessee.userId < 0) { LOGE("get userId failed."); return ERR_DM_GET_LOCAL_USERID_FAILED; -- Gitee From e8ced5623e71e26e388befa93963ba03debc3b39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=AE=87=E6=99=96?= Date: Tue, 15 Jul 2025 08:16:08 +0000 Subject: [PATCH 04/13] =?UTF-8?q?=E5=91=8A=E8=AD=A6=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 王宇晖 --- .../auth_stages/auth_credential.cpp | 29 +++++++++++-------- 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/services/implementation/src/authentication_v2/auth_stages/auth_credential.cpp b/services/implementation/src/authentication_v2/auth_stages/auth_credential.cpp index 4bada104f..f94330b0c 100644 --- a/services/implementation/src/authentication_v2/auth_stages/auth_credential.cpp +++ b/services/implementation/src/authentication_v2/auth_stages/auth_credential.cpp @@ -157,7 +157,7 @@ int32_t AuthSrcCredentialAuthDoneState::Action(std::shared_ptr co // first time joinLnn, auth lnnCredential if (context->accesser.isGenerateLnnCredential == true && context->isAppCredentialVerified == false && - context->accesser.bindLevel != USER) { + context->accesser.bindLevel != static_cast(USER)) { context->isAppCredentialVerified = true; DerivativeSessionKey(context); msgType = MSG_TYPE_REQ_CREDENTIAL_AUTH_START; @@ -174,7 +174,8 @@ int32_t AuthSrcCredentialAuthDoneState::Action(std::shared_ptr co return ERR_DM_FAILED; } // First-time authentication and Lnn credential process - } else if (context->accesser.isGenerateLnnCredential == true && context->accesser.bindLevel != USER) { + } else if (context->accesser.isGenerateLnnCredential == true && + context->accesser.bindLevel != static_cast(USER)) { int32_t skId = 0; int32_t ret = context->authMessageProcessor->SaveSessionKeyToDP(context->accesser.userId, skId); if (ret != DM_OK) { @@ -315,7 +316,8 @@ int32_t AuthSinkCredentialAuthNegotiateState::Action(std::shared_ptraccessee.isGenerateLnnCredential == true && context->accessee.bindLevel != USER && + if (context->accessee.isGenerateLnnCredential == true && + context->accessee.bindLevel != static_cast(USER) && context->isAppCredentialVerified == true) { ret = context->authMessageProcessor->SaveSessionKeyToDP(context->accessee.userId, skId); if (ret != DM_OK) { @@ -546,7 +548,7 @@ int32_t AuthSrcCredentialExchangeState::Action(std::shared_ptr co return DM_OK; } // First authentication, generate LNN credentials and public key - if (context->accesser.isGenerateLnnCredential && context->accesser.bindLevel != USER) { + if (context->accesser.isGenerateLnnCredential && context->accesser.bindLevel != static_cast(USER)) { ret = GenerateCredIdAndPublicKey(DM_AUTH_SCOPE_LNN, context); if (ret != DM_OK) { LOGE("AuthSrcCredentialExchangeState::Action() error, generate user credId and publicKey failed."); @@ -555,9 +557,10 @@ int32_t AuthSrcCredentialExchangeState::Action(std::shared_ptr co } DmAuthScope authorizedScope = DM_AUTH_SCOPE_INVALID; - if (context->accesser.bindLevel == APP || context->accesser.bindLevel == SERVICE) { + if (context->accesser.bindLevel == static_cast(APP) || + context->accesser.bindLevel == static_cast(SERVICE)) { authorizedScope = DM_AUTH_SCOPE_APP; - } else if (context->accesser.bindLevel == USER) { + } else if (context->accesser.bindLevel == static_cast(USER)) { authorizedScope = DM_AUTH_SCOPE_USER; } @@ -591,7 +594,7 @@ int32_t AuthSinkCredentialExchangeState::Action(std::shared_ptr c } // First authentication lnn cred - if (context->accessee.isGenerateLnnCredential && context->accessee.bindLevel != USER) { + if (context->accessee.isGenerateLnnCredential && context->accessee.bindLevel != static_cast(USER)) { // Generate credentials and public key ret = GenerateCredIdAndPublicKey(DM_AUTH_SCOPE_LNN, context); if (ret != DM_OK) { @@ -614,9 +617,10 @@ int32_t AuthSinkCredentialExchangeState::Action(std::shared_ptr c } DmAuthScope authorizedScope = DM_AUTH_SCOPE_INVALID; - if (context->accessee.bindLevel == APP || context->accessee.bindLevel == SERVICE) { + if (context->accessee.bindLevel == static_cast(APP) || + context->accessee.bindLevel == static_cast(SERVICE)) { authorizedScope = DM_AUTH_SCOPE_APP; - } else if (context->accessee.bindLevel == USER) { + } else if (context->accessee.bindLevel == static_cast(USER)) { authorizedScope = DM_AUTH_SCOPE_USER; } // Generate transport credentials and public key @@ -663,7 +667,7 @@ int32_t AuthSrcCredentialAuthStartState::Action(std::shared_ptr c if (IsNeedAgreeCredential(context)) { // First authentication - if (context->accesser.isGenerateLnnCredential && context->accesser.bindLevel != USER) { + if (context->accesser.isGenerateLnnCredential && context->accesser.bindLevel != static_cast(USER)) { // Agree lnn credentials and public key tmpCredId = context->accesser.lnnCredentialId; ret = AgreeCredential(DM_AUTH_SCOPE_LNN, context); @@ -678,9 +682,10 @@ int32_t AuthSrcCredentialAuthStartState::Action(std::shared_ptr c } DmAuthScope authorizedScope = DM_AUTH_SCOPE_INVALID; - if (context->accesser.bindLevel == APP || context->accesser.bindLevel == SERVICE) { + if (context->accesser.bindLevel == static_cast(APP) || + context->accesser.bindLevel == static_cast(SERVICE)) { authorizedScope = DM_AUTH_SCOPE_APP; - } else if (context->accesser.bindLevel == USER) { + } else if (context->accesser.bindLevel == static_cast(USER)) { authorizedScope = DM_AUTH_SCOPE_USER; } -- Gitee From 26b8b3e40e3b436305ba3e95c126f4e63cc75fbc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=AE=87=E6=99=96?= Date: Tue, 15 Jul 2025 08:19:06 +0000 Subject: [PATCH 05/13] =?UTF-8?q?=E5=91=8A=E8=AD=A6=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 王宇晖 --- .../src/dependency/hichain/hichain_auth_connector.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/implementation/src/dependency/hichain/hichain_auth_connector.cpp b/services/implementation/src/dependency/hichain/hichain_auth_connector.cpp index b659af1ad..85f05060c 100644 --- a/services/implementation/src/dependency/hichain/hichain_auth_connector.cpp +++ b/services/implementation/src/dependency/hichain/hichain_auth_connector.cpp @@ -256,7 +256,7 @@ int32_t HiChainAuthConnector::AuthCredential(int32_t osAccountId, int64_t authRe int32_t HiChainAuthConnector::AuthCredentialPinCode(int32_t osAccountId, int64_t authReqId, const std::string &pinCode) { LOGI("start, pinCode: %{public}s", GetAnonyString(pinCode).c_str()); - if (pinCode.size() < MIN_PINCODE_SIZE) { + if (static_cast(pinCode.size()) < MIN_PINCODE_SIZE) { LOGE("HiChainAuthConnector::AuthCredentialPinCode failed, pinCode size is %{public}zu.", pinCode.size()); return ERR_DM_FAILED; } -- Gitee From 79d61b94a444d9e9fe8a5c8de2a3864f30b97803 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=AE=87=E6=99=96?= Date: Tue, 15 Jul 2025 08:19:59 +0000 Subject: [PATCH 06/13] =?UTF-8?q?=E5=91=8A=E8=AD=A6=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 王宇晖 --- .../implementation/src/dependency/softbus/softbus_connector.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/services/implementation/src/dependency/softbus/softbus_connector.cpp b/services/implementation/src/dependency/softbus/softbus_connector.cpp index db5974f1b..90606a916 100644 --- a/services/implementation/src/dependency/softbus/softbus_connector.cpp +++ b/services/implementation/src/dependency/softbus/softbus_connector.cpp @@ -221,6 +221,7 @@ int32_t SoftbusConnector::SyncLocalAclListProcess(const DevUserInfo &localDevUse case DM_VERSION_INT_5_1_0: ret = SyncLocalAclList5_1_0(localDevUserInfo.deviceId, remoteDevUserInfo.deviceId, localAcl, remoteAclHashList); + break; default: LOGE("versionNum is invaild, ver: %{public}d", versionNum); break; -- Gitee From b9254b3f13d7e9e01c0b3561c9140243be43b7f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=AE=87=E6=99=96?= Date: Tue, 15 Jul 2025 08:23:55 +0000 Subject: [PATCH 07/13] update commondependency/src/multiple_user_connector.cpp. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 王宇晖 --- commondependency/src/multiple_user_connector.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commondependency/src/multiple_user_connector.cpp b/commondependency/src/multiple_user_connector.cpp index cb73734c0..4c3598ff8 100644 --- a/commondependency/src/multiple_user_connector.cpp +++ b/commondependency/src/multiple_user_connector.cpp @@ -419,7 +419,7 @@ DM_EXPORT int32_t MultipleUserConnector::GetUserIdByDisplayId(int32_t displayId) } #ifdef OS_ACCOUNT_PART_EXISTS int32_t ret = OHOS::AccountSA::OsAccountManager::GetForegroundOsAccountLocalId( - static_cast(displayId, userId)); + static_cast(displayId), userId); if (ret != DM_OK) { LOGE("GetForegroundOsAccountLocalId failed ret %{public}d.", ret); } -- Gitee From 891344d789eed240f3ad2f149b2012bcba8040d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=AE=87=E6=99=96?= Date: Tue, 15 Jul 2025 09:28:50 +0000 Subject: [PATCH 08/13] update services/implementation/src/authentication_v2/auth_stages/auth_credential.cpp. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 王宇晖 --- .../src/authentication_v2/auth_stages/auth_credential.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/services/implementation/src/authentication_v2/auth_stages/auth_credential.cpp b/services/implementation/src/authentication_v2/auth_stages/auth_credential.cpp index f94330b0c..3d7e7843a 100644 --- a/services/implementation/src/authentication_v2/auth_stages/auth_credential.cpp +++ b/services/implementation/src/authentication_v2/auth_stages/auth_credential.cpp @@ -636,7 +636,6 @@ int32_t AuthSinkCredentialExchangeState::Action(std::shared_ptr c if (ret != DM_OK) { context->hiChainAuthConnector->DeleteCredential(osAccountId, tmpCredId); context->SetCredentialId(DM_AUTH_LOCAL_SIDE, authorizedScope, ""); - LOGE("AuthSinkCredentialExchangeState::Action failed, agree app cred failed."); return ret; } @@ -712,7 +711,6 @@ int32_t AuthSrcCredentialAuthStartState::Action(std::shared_ptr c } if (context->authStateMachine->WaitExpectEvent(ON_TRANSMIT) != ON_TRANSMIT) { - LOGE("AuthSrcCredentialAuthStartState::Action failed, ON_TRANSMIT event not arrived."); return ERR_DM_FAILED; } -- Gitee From b8c38e08f1d96a798f5671b0072c26a043e1f175 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=AE=87=E6=99=96?= Date: Tue, 29 Jul 2025 03:41:49 +0000 Subject: [PATCH 09/13] update services/implementation/src/authentication_v2/auth_stages/auth_negotiate.cpp. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 王宇晖 --- .../src/authentication_v2/auth_stages/auth_negotiate.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/implementation/src/authentication_v2/auth_stages/auth_negotiate.cpp b/services/implementation/src/authentication_v2/auth_stages/auth_negotiate.cpp index 69c6f4bf8..0faacf702 100644 --- a/services/implementation/src/authentication_v2/auth_stages/auth_negotiate.cpp +++ b/services/implementation/src/authentication_v2/auth_stages/auth_negotiate.cpp @@ -134,7 +134,7 @@ int32_t AuthSinkNegotiateStateMachine::RespQueryAcceseeIds(std::shared_ptraccessee.userId = MultipleUserConnector::GetUserIdByDisplayId( - context->accessee.displayId); + static_cast(context->accessee.displayId)); if (context->accessee.userId < 0) { LOGE("get userId failed."); return ERR_DM_GET_LOCAL_USERID_FAILED; -- Gitee From 5dc392c3b200a3bb08da0f0f4c415229adcee89f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=AE=87=E6=99=96?= Date: Tue, 29 Jul 2025 03:43:26 +0000 Subject: [PATCH 10/13] update commondependency/include/multiple_user_connector.h. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 王宇晖 --- commondependency/include/multiple_user_connector.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commondependency/include/multiple_user_connector.h b/commondependency/include/multiple_user_connector.h index 47b4dcb0c..878375602 100644 --- a/commondependency/include/multiple_user_connector.h +++ b/commondependency/include/multiple_user_connector.h @@ -130,7 +130,7 @@ public: std::vector &backgroundUserVec); DM_EXPORT static DMAccountInfo GetCurrentDMAccountInfo(); DM_EXPORT static void GetCallingTokenId(uint32_t &tokenId); - DM_EXPORT static int32_t GetUserIdByDisplayId(int32_t displayId); + DM_EXPORT static int32_t GetUserIdByDisplayId(uint64_t displayId); private: static int32_t oldUserId_; static std::string accountId_; -- Gitee From 2fcca8aec9dc857a7b5bbdbdfd3a60f7d868833e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=AE=87=E6=99=96?= Date: Tue, 29 Jul 2025 03:45:15 +0000 Subject: [PATCH 11/13] update commondependency/src/multiple_user_connector.cpp. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 王宇晖 --- commondependency/src/multiple_user_connector.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/commondependency/src/multiple_user_connector.cpp b/commondependency/src/multiple_user_connector.cpp index 5e74951f0..1d3e7cea8 100644 --- a/commondependency/src/multiple_user_connector.cpp +++ b/commondependency/src/multiple_user_connector.cpp @@ -413,12 +413,12 @@ DM_EXPORT void MultipleUserConnector::GetCallingTokenId(uint32_t &tokenId) #endif } -DM_EXPORT int32_t MultipleUserConnector::GetUserIdByDisplayId(int32_t displayId) +DM_EXPORT int32_t MultipleUserConnector::GetUserIdByDisplayId(uint64_t displayId) { - LOGI("displayId %{public}" PRId32, displayId); + LOGI("displayId %{public}" PRIu64, displayId); int32_t userId = -1; #if !(defined(__LITEOS_M__) || defined(LITE_DEVICE)) - if (displayId == -1) { + if (static_cast(displayId) == -1) { userId = GetFirstForegroundUserId(); return userId; } -- Gitee From d678207944af59a3b52ff27d412b909d7caa6ea8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=AE=87=E6=99=96?= Date: Tue, 29 Jul 2025 06:23:03 +0000 Subject: [PATCH 12/13] update commondependency/src/multiple_user_connector.cpp. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 王宇晖 --- commondependency/src/multiple_user_connector.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/commondependency/src/multiple_user_connector.cpp b/commondependency/src/multiple_user_connector.cpp index 1d3e7cea8..10f231285 100644 --- a/commondependency/src/multiple_user_connector.cpp +++ b/commondependency/src/multiple_user_connector.cpp @@ -423,8 +423,7 @@ DM_EXPORT int32_t MultipleUserConnector::GetUserIdByDisplayId(uint64_t displayId return userId; } #ifdef OS_ACCOUNT_PART_EXISTS - int32_t ret = OHOS::AccountSA::OsAccountManager::GetForegroundOsAccountLocalId( - static_cast(displayId), userId); + int32_t ret = OHOS::AccountSA::OsAccountManager::GetForegroundOsAccountLocalId(displayId, userId); if (ret != DM_OK) { LOGE("GetForegroundOsAccountLocalId failed ret %{public}d.", ret); } -- Gitee From 68dc3f9f71ff9d0c8f57c21387163b82a889efdb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=AE=87=E6=99=96?= Date: Tue, 29 Jul 2025 06:38:33 +0000 Subject: [PATCH 13/13] update services/implementation/src/authentication_v2/auth_stages/auth_credential.cpp. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 王宇晖 --- .../authentication_v2/auth_stages/auth_credential.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/services/implementation/src/authentication_v2/auth_stages/auth_credential.cpp b/services/implementation/src/authentication_v2/auth_stages/auth_credential.cpp index 9876b820e..bf0f85689 100644 --- a/services/implementation/src/authentication_v2/auth_stages/auth_credential.cpp +++ b/services/implementation/src/authentication_v2/auth_stages/auth_credential.cpp @@ -651,7 +651,7 @@ int32_t AuthSrcCredentialAuthStartState::AgreeAndDeleteCredential(std::shared_pt std::string tmpCredId = ""; int32_t osAccountId = context->accesser.userId; // First authentication - if (context->accesser.isGenerateLnnCredential && context->accesser.bindLevel != USER) { + if (context->accesser.isGenerateLnnCredential && context->accesser.bindLevel != static_cast(USER)) { // Agree lnn credentials and public key tmpCredId = context->accesser.lnnCredentialId; ret = AgreeCredential(DM_AUTH_SCOPE_LNN, context); @@ -664,10 +664,11 @@ int32_t AuthSrcCredentialAuthStartState::AgreeAndDeleteCredential(std::shared_pt ffrt::submit([=]() { context->hiChainAuthConnector->DeleteCredential(osAccountId, tmpCredId);}); } DmAuthScope authorizedScope = DM_AUTH_SCOPE_INVALID; - if (context->accesser.bindLevel == APP || context->accesser.bindLevel == SERVICE) { + if (context->accesser.bindLevel == static_cast(APP) || + context->accesser.bindLevel == static_cast(SERVICE)) { authorizedScope = DM_AUTH_SCOPE_APP; } - if (context->accesser.bindLevel == USER) { + if (context->accesser.bindLevel == static_cast(USER)) { authorizedScope = DM_AUTH_SCOPE_USER; } // Agree transport credentials and public key @@ -731,7 +732,7 @@ int32_t AuthSrcSKDeriveState::Action(std::shared_ptr context) CHECK_NULL_RETURN(context, ERR_DM_POINT_NULL); CHECK_NULL_RETURN(context->authMessageProcessor, ERR_DM_POINT_NULL); // First authentication lnn cred - if (context->accesser.isGenerateLnnCredential && context->accesser.bindLevel != USER) { + if (context->accesser.isGenerateLnnCredential && context->accesser.bindLevel != static_cast(USER)) { int32_t skId = 0; // derive lnn sk std::string suffix = context->accesser.lnnCredentialId + context->accessee.lnnCredentialId; @@ -843,7 +844,7 @@ int32_t AuthSinkSKDeriveState::Action(std::shared_ptr context) CHECK_NULL_RETURN(context, ERR_DM_POINT_NULL); CHECK_NULL_RETURN(context->authMessageProcessor, ERR_DM_POINT_NULL); // First authentication lnn cred - if (context->accessee.isGenerateLnnCredential && context->accessee.bindLevel != USER) { + if (context->accessee.isGenerateLnnCredential && context->accessee.bindLevel != static_cast(USER)) { int32_t skId = 0; // derive lnn sk std::string suffix = context->accesser.lnnCredentialId + context->accessee.lnnCredentialId; -- Gitee