From 4bca2e62c099798d8ae4a551385561369560bef2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E8=B7=83=E8=80=80?= Date: Thu, 23 Jan 2025 10:16:55 +0800 Subject: [PATCH 1/2] IS pseudonym enable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 张跃耀 --- services/legacy/creds_manager/src/creds_manager.c | 9 ++++++++- .../session_manager/src/session/v2/dev_session_util.c | 6 +++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/services/legacy/creds_manager/src/creds_manager.c b/services/legacy/creds_manager/src/creds_manager.c index d9a09b6a..7492d93b 100644 --- a/services/legacy/creds_manager/src/creds_manager.c +++ b/services/legacy/creds_manager/src/creds_manager.c @@ -17,6 +17,7 @@ #include "identity_operation.h" #include "asy_token_manager.h" #include "cert_operation.h" +#include "pseudonym_manager.h" #define FIELD_SP_CMDS "spCmds" @@ -305,7 +306,8 @@ static int32_t GetCertInfoIS(int32_t osAccountId, const CJson *credAuthInfo, Cer LOGE("unsupport algorithm type!"); return ret; } - certInfo->isPseudonym = false; + certInfo->isPseudonym = !(GetPseudonymInstance() + ->isNeedRefreshPseudonymId(osAccountId, userId)); return HC_SUCCESS; } @@ -388,6 +390,11 @@ static int32_t SetProtocolEntityIS(IdentityInfo *info) #ifdef ENABLE_ACCOUNT_AUTH_EC_SPEKE entity->protocolType = ALG_EC_SPEKE; entity->expandProcessCmds = 0; +#ifdef ENABLE_PSEUDONYM + if (!(info->proof.certinfo.isPseudonym)) { + entity->expandProcessCmds |= CMD_MK_AGREE; + } +#endif #else LOGE("ec speke not support!"); HcFree(entity); diff --git a/services/session_manager/src/session/v2/dev_session_util.c b/services/session_manager/src/session/v2/dev_session_util.c index aa45f420..f43581d4 100644 --- a/services/session_manager/src/session/v2/dev_session_util.c +++ b/services/session_manager/src/session/v2/dev_session_util.c @@ -75,18 +75,18 @@ static int32_t GetUserIdByISInfo(const CJson *context, char **returnUserId) CJson *credAuthInfo = GetObjFromJson(context, FIELD_SELF_CREDENTIAL_OBJ); if (credAuthInfo == NULL) { LOGE("Get self credAuthInfo fail."); - return IS_ERR_JSON_GET; + return HC_ERR_JSON_GET; } const char *userId = GetStringFromJson(credAuthInfo, FIELD_USER_ID); if (userId == NULL) { LOGE("Failed to get user ID!"); - return IS_ERR_JSON_GET; + return HC_ERR_JSON_GET; } if (DeepCopyString(userId, returnUserId) != HC_SUCCESS) { LOGE("Failed to copy userId!"); return HC_ERR_ALLOC_MEMORY; } - return IS_SUCCESS; + return HC_SUCCESS; } static int32_t GetPdidByContext(const CJson *context, bool isCredAuth, char **returnPdid) -- Gitee From 1fbd4c4c0b22687c954dcf3a56bd962bc287b2d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E8=B7=83=E8=80=80?= Date: Thu, 23 Jan 2025 10:40:36 +0800 Subject: [PATCH 2/2] IS pseudonym enable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 张跃耀 --- services/legacy/creds_manager/src/creds_manager.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/legacy/creds_manager/src/creds_manager.c b/services/legacy/creds_manager/src/creds_manager.c index 7492d93b..aba8221f 100644 --- a/services/legacy/creds_manager/src/creds_manager.c +++ b/services/legacy/creds_manager/src/creds_manager.c @@ -391,7 +391,7 @@ static int32_t SetProtocolEntityIS(IdentityInfo *info) entity->protocolType = ALG_EC_SPEKE; entity->expandProcessCmds = 0; #ifdef ENABLE_PSEUDONYM - if (!(info->proof.certinfo.isPseudonym)) { + if (!(info->proof.certInfo.isPseudonym)) { entity->expandProcessCmds |= CMD_MK_AGREE; } #endif -- Gitee