AuthGetLatestIdByUuid just by OpenSession

Signed-off-by: bingo <wangbaoguang@huawei.com>
This commit is contained in:
bingo 2022-09-14 14:49:57 +08:00
parent 87457655e3
commit 615c36e3ee

View File

@ -871,11 +871,6 @@ int32_t TransProxyCreateChanInfo(ProxyChannelInfo *chan, int32_t channelId, cons
{
chan->myId = channelId;
chan->channelId = channelId;
chan->authId = AuthGetLatestIdByUuid(appInfo->peerData.deviceId, chan->type == CONNECT_TCP);
if (chan->authId == AUTH_INVALID_ID) {
SoftBusLog(SOFTBUS_LOG_TRAN, SOFTBUS_LOG_ERROR, "get authId for cipher err");
return SOFTBUS_ERR;
}
if (GenerateRandomStr(chan->identity, sizeof(chan->identity)) != SOFTBUS_OK) {
SoftBusLog(SOFTBUS_LOG_TRAN, SOFTBUS_LOG_ERROR, "GenerateRandomStr err");
@ -883,6 +878,11 @@ int32_t TransProxyCreateChanInfo(ProxyChannelInfo *chan, int32_t channelId, cons
}
if (appInfo->appType != APP_TYPE_AUTH) {
chan->authId = AuthGetLatestIdByUuid(appInfo->peerData.deviceId, chan->type == CONNECT_TCP);
if (chan->authId == AUTH_INVALID_ID) {
SoftBusLog(SOFTBUS_LOG_TRAN, SOFTBUS_LOG_ERROR, "get authId for cipher err");
return SOFTBUS_ERR;
}
if (SoftBusGenerateRandomArray((unsigned char *)appInfo->sessionKey, sizeof(appInfo->sessionKey))
!= SOFTBUS_OK) {
SoftBusLog(SOFTBUS_LOG_TRAN, SOFTBUS_LOG_ERROR, "GenerateRandomArray err");