mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-28 17:09:34 -05:00
moved discarding of banned identities from lobbies before signature checking, so as to avoid to time stamp their GXSId keys
This commit is contained in:
parent
502b137ccd
commit
0c138d70ad
@ -138,6 +138,12 @@ bool DistributedChatService::handleRecvChatLobbyMsgItem(RsChatMsgItem *ci)
|
|||||||
std::cerr << std::endl;
|
std::cerr << std::endl;
|
||||||
return false ;
|
return false ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(rsReputations->isIdentityBanned(cli->signature.keyId))
|
||||||
|
{
|
||||||
|
std::cerr << "(WW) Received lobby msg/item from banned identity " << cli->signature.keyId << ". Dropping it." << std::endl;
|
||||||
|
return false ;
|
||||||
|
}
|
||||||
if(!checkSignature(cli,cli->PeerId())) // check the object's signature and possibly request missing keys
|
if(!checkSignature(cli,cli->PeerId())) // check the object's signature and possibly request missing keys
|
||||||
{
|
{
|
||||||
std::cerr << "Signature mismatched for this lobby event item. Item will be dropped: " << std::endl;
|
std::cerr << "Signature mismatched for this lobby event item. Item will be dropped: " << std::endl;
|
||||||
@ -184,11 +190,6 @@ bool DistributedChatService::handleRecvChatLobbyMsgItem(RsChatMsgItem *ci)
|
|||||||
return false ;
|
return false ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(rsReputations->isIdentityBanned(cli->signature.keyId))
|
|
||||||
{
|
|
||||||
std::cerr << "(WW) Received lobby msg/item from banned identity " << cli->signature.keyId << ". Dropping it." << std::endl;
|
|
||||||
return false ;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!bounceLobbyObject(cli,cli->PeerId())) // forwards the message to friends, keeps track of subscribers, etc.
|
if(!bounceLobbyObject(cli,cli->PeerId())) // forwards the message to friends, keeps track of subscribers, etc.
|
||||||
return false;
|
return false;
|
||||||
@ -648,6 +649,11 @@ void DistributedChatService::handleRecvChatLobbyEventItem(RsChatLobbyEventItem *
|
|||||||
#endif
|
#endif
|
||||||
time_t now = time(NULL) ;
|
time_t now = time(NULL) ;
|
||||||
|
|
||||||
|
if(rsReputations->isIdentityBanned(item->signature.keyId))
|
||||||
|
{
|
||||||
|
std::cerr << "(WW) Received lobby msg/item from banned identity " << item->signature.keyId << ". Dropping it." << std::endl;
|
||||||
|
return ;
|
||||||
|
}
|
||||||
if(!checkSignature(item,item->PeerId())) // check the object's signature and possibly request missing keys
|
if(!checkSignature(item,item->PeerId())) // check the object's signature and possibly request missing keys
|
||||||
{
|
{
|
||||||
std::cerr << "Signature mismatched for this lobby event item: " << std::endl;
|
std::cerr << "Signature mismatched for this lobby event item: " << std::endl;
|
||||||
@ -675,11 +681,6 @@ void DistributedChatService::handleRecvChatLobbyEventItem(RsChatLobbyEventItem *
|
|||||||
return ;
|
return ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(rsReputations->isIdentityBanned(item->signature.keyId))
|
|
||||||
{
|
|
||||||
std::cerr << "(WW) Received lobby msg/item from banned identity " << item->signature.keyId << ". Dropping it." << std::endl;
|
|
||||||
return ;
|
|
||||||
}
|
|
||||||
addTimeShiftStatistics((int)now - (int)item->sendTime) ;
|
addTimeShiftStatistics((int)now - (int)item->sendTime) ;
|
||||||
|
|
||||||
if(now+100 > (time_t) item->sendTime + MAX_KEEP_MSG_RECORD) // the message is older than the max cache keep minus 100 seconds ! It's too old, and is going to make an echo!
|
if(now+100 > (time_t) item->sendTime + MAX_KEEP_MSG_RECORD) // the message is older than the max cache keep minus 100 seconds ! It's too old, and is going to make an echo!
|
||||||
|
Loading…
Reference in New Issue
Block a user