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 dec020fc2b619e50412e942f7cad11ae646e3404..65056e146f532dbe8071bd9007c74957f6c25980 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,8 +270,12 @@ 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].Get()); + jsonObjLog[TAG_KEY_VALUE] = GetAnonyString(jsonObj[TAG_KEY_VALUE].Get()); + LOGI("AuthCredentialAgreeState::CreateAuthParamsString leave, param: %{public}s.", jsonObjLog.Dump().c_str()); + return param; } // Generate credential ID and public key @@ -310,8 +315,8 @@ 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(), - authContext->GetPublicKey(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; } @@ -336,8 +341,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) {