mirror of
https://gitee.com/openharmony/communication_dsoftbus
synced 2024-12-20 00:21:45 +00:00
!3112 修复:dsoftbus在对报文加密后对密钥清零 和 删除br连接问题
Merge pull request !3112 from xuhengxiang/master
This commit is contained in:
commit
533bcf2434
@ -174,8 +174,10 @@ static int32_t TransProxyEncryptPacketData(int32_t channelId, int32_t seq, Proxy
|
|||||||
SoftBusLog(SOFTBUS_LOG_TRAN, SOFTBUS_LOG_ERROR, "memcpy_s key error.");
|
SoftBusLog(SOFTBUS_LOG_TRAN, SOFTBUS_LOG_ERROR, "memcpy_s key error.");
|
||||||
return SOFTBUS_ERR;
|
return SOFTBUS_ERR;
|
||||||
}
|
}
|
||||||
|
(void)memset_s(sessionKey, sizeof(sessionKey), 0, sizeof(sessionKey));
|
||||||
int32_t ret = SoftBusEncryptDataWithSeq(&cipherKey, dataInfo->inData, dataInfo->inLen,
|
int32_t ret = SoftBusEncryptDataWithSeq(&cipherKey, dataInfo->inData, dataInfo->inLen,
|
||||||
dataInfo->outData, &(dataInfo->outLen), seq);
|
dataInfo->outData, &(dataInfo->outLen), seq);
|
||||||
|
(void)memset_s(&cipherKey, sizeof(AesGcmCipherKey), 0, sizeof(AesGcmCipherKey));
|
||||||
if (ret != SOFTBUS_OK || dataInfo->outLen != checkLen) {
|
if (ret != SOFTBUS_OK || dataInfo->outLen != checkLen) {
|
||||||
SoftBusLog(SOFTBUS_LOG_TRAN, SOFTBUS_LOG_ERROR, "Trans Proxy encrypt error. %d ", ret);
|
SoftBusLog(SOFTBUS_LOG_TRAN, SOFTBUS_LOG_ERROR, "Trans Proxy encrypt error. %d ", ret);
|
||||||
return SOFTBUS_ENCRYPT_ERR;
|
return SOFTBUS_ENCRYPT_ERR;
|
||||||
|
@ -271,7 +271,7 @@ void TransDelSessionConnById(int32_t channelId)
|
|||||||
}
|
}
|
||||||
LIST_FOR_EACH_ENTRY_SAFE(item, next, &g_sessionConnList->list, SessionConn, node) {
|
LIST_FOR_EACH_ENTRY_SAFE(item, next, &g_sessionConnList->list, SessionConn, node) {
|
||||||
if (item->channelId == channelId) {
|
if (item->channelId == channelId) {
|
||||||
if (item->listenMod == DIRECT_CHANNEL_SERVER_P2P && item->authId != AUTH_INVALID_ID) {
|
if (item->listenMod == DIRECT_CHANNEL_SERVER_P2P && item->authId != AUTH_INVALID_ID && !item->serverSide) {
|
||||||
AuthCloseConn(item->authId);
|
AuthCloseConn(item->authId);
|
||||||
}
|
}
|
||||||
ListDelete(&item->node);
|
ListDelete(&item->node);
|
||||||
|
Loading…
Reference in New Issue
Block a user