diff --git a/services/legacy/creds_manager/src/creds_manager.c b/services/legacy/creds_manager/src/creds_manager.c index d9a09b6a575b5e05d72bf42deb70f55bc8b5ccda..aba8221f84fb044395e04665dce3f335675ed38c 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 aa45f4201d15c3d90de2df4a71d23652713b2f8a..f43581d405cba1ebef2edc0fe408d657a851898f 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)