mirror of
https://gitee.com/openharmony/communication_dsoftbus
synced 2024-11-30 04:10:59 +00:00
!5673 fix:modify udidhash is empty
Merge pull request !5673 from 房冬/master
This commit is contained in:
commit
9157498762
@ -648,7 +648,10 @@ static void UpdateUdidHashIfEmpty(AuthFsm *authFsm, AuthSessionInfo *info)
|
||||
{
|
||||
if (info->connInfo.type == AUTH_LINK_TYPE_BLE && strlen(info->udid) != 0 &&
|
||||
authFsm->info.connInfo.info.bleInfo.deviceIdHash[0] == '\0') {
|
||||
AUTH_LOGW(AUTH_FSM, "udidhash is empty");
|
||||
char *anonyUdid = NULL;
|
||||
Anonymize(info->udid, &anonyUdid);
|
||||
AUTH_LOGW(AUTH_FSM, "udidhash is empty, udid=%{public}s", anonyUdid);
|
||||
AnonymizeFree(anonyUdid);
|
||||
if (SoftBusGenerateStrHash((unsigned char *)info->udid, strlen(info->udid),
|
||||
(unsigned char *)authFsm->info.connInfo.info.bleInfo.deviceIdHash) != SOFTBUS_OK) {
|
||||
AUTH_LOGE(AUTH_FSM, "generate udidhash fail");
|
||||
|
@ -912,6 +912,7 @@ static int32_t VerifyExchangeIdTypeAndInfo(AuthSessionInfo *info, int32_t idType
|
||||
if (GetPeerUdidByNetworkId(info->udid, peerUdid) != SOFTBUS_OK) {
|
||||
AUTH_LOGE(AUTH_FSM, "get peer udid fail, peer networkId=%s", anonyUdid);
|
||||
info->idType = EXCHANGE_FAIL;
|
||||
(void)memset_s(info->udid, sizeof(info->udid), 0, sizeof(info->udid));
|
||||
} else {
|
||||
if (memcpy_s(info->udid, UDID_BUF_LEN, peerUdid, UDID_BUF_LEN) != EOK) {
|
||||
AUTH_LOGE(AUTH_FSM, "copy peer udid fail");
|
||||
|
Loading…
Reference in New Issue
Block a user