From 2ed1639751a2e211262020c448153ea0cc056cdb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8F=B2=E6=99=93=E6=99=93?= Date: Thu, 15 May 2025 17:33:45 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 史晓晓 --- .../auth_stages/auth_credential.cpp | 15 ++++++++++----- 1 file changed, 10 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 dec020fc2..5c8f952c5 100644 --- a/services/implementation/src/authentication_v2/auth_stages/auth_credential.cpp +++ b/services/implementation/src/authentication_v2/auth_stages/auth_credential.cpp @@ -269,8 +269,14 @@ std::string AuthCredentialAgreeState::CreateAuthParamsString(DmAuthScope authori } jsonObj[TAG_CREDENTIAL_OWNER] = DM_AUTH_CREDENTIAL_OWNER; - LOGI("AuthCredentialAgreeState::CreateAuthParamsString leave."); - return jsonObj.Dump(); + std:string param(jsonObj.Dump()); + JsonObject jsonObjLog(param); + jsonObjLog[TAG_LOWER_DEVICE_ID] = GetAnonyString(jsonObj[TAG_LOWER_DEVICE_ID]); + jsonObjLog[TAG_KEY_VALUE] = GetAnonyString(jsonObj[TAG_KEY_VALUE]); + + LOGI("AuthCredentialAgreeState::CreateAuthParamsString leave, param: %{public}s.", jsonObjLog.Dump().c_str()); + + return param; } // Generate credential ID and public key @@ -311,7 +317,7 @@ int32_t AuthCredentialAgreeState::GenerateCredIdAndPublicKey(DmAuthScope authori (void)authContext->SetPublicKey(DM_AUTH_LOCAL_SIDE, authorizedScope, publicKey); LOGI("AuthCredentialAgreeState::GenerateCredIdAndPublicKey credId=%{public}s, publicKey=%{public}s.\n", authContext->GetCredentialId(DM_AUTH_LOCAL_SIDE, authorizedScope).c_str(), - authContext->GetPublicKey(DM_AUTH_LOCAL_SIDE, authorizedScope).c_str()); + GetAnonyString(authContext->GetPublicKey(DM_AUTH_LOCAL_SIDE, authorizedScope)).c_str()); LOGI("AuthCredentialAgreeState::GenerateCredIdAndPublicKey leave."); return DM_OK; } @@ -336,8 +342,7 @@ int32_t AuthCredentialAgreeState::AgreeCredential(DmAuthScope authorizedScope, authContext->accesser.userId : authContext->accessee.userId; std::string selfCredId = authContext->GetCredentialId(DM_AUTH_LOCAL_SIDE, authorizedScope); std::string credId; - LOGI("AuthCredentialAgreeState::AgreeCredential agree with accountId %{public}d and param %{public}s.", - osAccountId, authParamsString.c_str()); + LOGI("AuthCredentialAgreeState::AgreeCredential agree with accountId %{public}d.", osAccountId); int32_t ret = authContext->hiChainAuthConnector->AgreeCredential(osAccountId, selfCredId, authParamsString, credId); if (ret != DM_OK) { -- Gitee From 2764a5c861a2d0784393fac8303e718343916696 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8F=B2=E6=99=93=E6=99=93?= Date: Thu, 15 May 2025 21:17:58 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=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_credential.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 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 5c8f952c5..f05a0f23c 100644 --- a/services/implementation/src/authentication_v2/auth_stages/auth_credential.cpp +++ b/services/implementation/src/authentication_v2/auth_stages/auth_credential.cpp @@ -16,6 +16,7 @@ #include #include #include +#include "dm_anonymous.h" #include "dm_auth_context.h" #include "dm_auth_manager_base.h" #include "dm_auth_message_processor.h" @@ -269,10 +270,10 @@ std::string AuthCredentialAgreeState::CreateAuthParamsString(DmAuthScope authori } jsonObj[TAG_CREDENTIAL_OWNER] = DM_AUTH_CREDENTIAL_OWNER; - std:string param(jsonObj.Dump()); + std::string param(jsonObj.Dump()); JsonObject jsonObjLog(param); - jsonObjLog[TAG_LOWER_DEVICE_ID] = GetAnonyString(jsonObj[TAG_LOWER_DEVICE_ID]); - jsonObjLog[TAG_KEY_VALUE] = GetAnonyString(jsonObj[TAG_KEY_VALUE]); + jsonObjLog[TAG_LOWER_DEVICE_ID] = GetAnonyString(jsonObj[TAG_LOWER_DEVICE_ID].Get()); + jsonObjLog[TAG_KEY_VALUE] = GetAnonyString(jsonObj[TAG_KEY_VALUE].Get()); LOGI("AuthCredentialAgreeState::CreateAuthParamsString leave, param: %{public}s.", jsonObjLog.Dump().c_str()); -- Gitee From 992acaacfce0931547e417e67cfae71f35ab7425 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8F=B2=E6=99=93=E6=99=93?= Date: Thu, 15 May 2025 22:01:03 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=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_credential.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 f05a0f23c..413e620d7 100644 --- a/services/implementation/src/authentication_v2/auth_stages/auth_credential.cpp +++ b/services/implementation/src/authentication_v2/auth_stages/auth_credential.cpp @@ -317,7 +317,7 @@ int32_t AuthCredentialAgreeState::GenerateCredIdAndPublicKey(DmAuthScope authori (void)authContext->SetCredentialId(DM_AUTH_LOCAL_SIDE, authorizedScope, credId); (void)authContext->SetPublicKey(DM_AUTH_LOCAL_SIDE, authorizedScope, publicKey); LOGI("AuthCredentialAgreeState::GenerateCredIdAndPublicKey credId=%{public}s, publicKey=%{public}s.\n", - authContext->GetCredentialId(DM_AUTH_LOCAL_SIDE, authorizedScope).c_str(), + GetAnonyString(authContext->GetCredentialId(DM_AUTH_LOCAL_SIDE, authorizedScope)).c_str(), GetAnonyString(authContext->GetPublicKey(DM_AUTH_LOCAL_SIDE, authorizedScope)).c_str()); LOGI("AuthCredentialAgreeState::GenerateCredIdAndPublicKey leave."); return DM_OK; -- Gitee From 2264d613ffab25daa80342f3b33f61ba6f0790c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8F=B2=E6=99=93=E6=99=93?= Date: Thu, 15 May 2025 22:11:30 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=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_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 413e620d7..65056e146 100644 --- a/services/implementation/src/authentication_v2/auth_stages/auth_credential.cpp +++ b/services/implementation/src/authentication_v2/auth_stages/auth_credential.cpp @@ -274,9 +274,7 @@ std::string AuthCredentialAgreeState::CreateAuthParamsString(DmAuthScope authori JsonObject jsonObjLog(param); jsonObjLog[TAG_LOWER_DEVICE_ID] = GetAnonyString(jsonObj[TAG_LOWER_DEVICE_ID].Get()); jsonObjLog[TAG_KEY_VALUE] = GetAnonyString(jsonObj[TAG_KEY_VALUE].Get()); - LOGI("AuthCredentialAgreeState::CreateAuthParamsString leave, param: %{public}s.", jsonObjLog.Dump().c_str()); - return param; } -- Gitee