mirror of
https://gitee.com/openharmony/communication_dsoftbus
synced 2024-12-18 15:28:15 +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.");
|
||||
return SOFTBUS_ERR;
|
||||
}
|
||||
(void)memset_s(sessionKey, sizeof(sessionKey), 0, sizeof(sessionKey));
|
||||
int32_t ret = SoftBusEncryptDataWithSeq(&cipherKey, dataInfo->inData, dataInfo->inLen,
|
||||
dataInfo->outData, &(dataInfo->outLen), seq);
|
||||
(void)memset_s(&cipherKey, sizeof(AesGcmCipherKey), 0, sizeof(AesGcmCipherKey));
|
||||
if (ret != SOFTBUS_OK || dataInfo->outLen != checkLen) {
|
||||
SoftBusLog(SOFTBUS_LOG_TRAN, SOFTBUS_LOG_ERROR, "Trans Proxy encrypt error. %d ", ret);
|
||||
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) {
|
||||
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);
|
||||
}
|
||||
ListDelete(&item->node);
|
||||
|
Loading…
Reference in New Issue
Block a user