mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-07 16:45:11 -04:00
switch from rsDht to rsBanList to decide on adding friend IP
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@8328 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
db40002dda
commit
e65785e1bc
6 changed files with 109 additions and 92 deletions
|
@ -1313,17 +1313,11 @@ int pqissl::Authorise_SSL_Connection()
|
|||
|
||||
uint32_t check_result ;
|
||||
|
||||
if(!rsBanList->isAddressAccepted(remote_addr,RSBANLIST_CHECKING_FLAGS_BLACKLIST,check_result))
|
||||
if(!rsBanList->isAddressAccepted(remote_addr,RSBANLIST_CHECKING_FLAGS_BLACKLIST,&check_result))
|
||||
{
|
||||
std::cerr << "(SS) connection attempt from banned IP address. Refusing it. Reason: " << check_result << ". Attack??" << std::endl;
|
||||
reset_locked();
|
||||
return 0 ;
|
||||
}
|
||||
if(rsDht->isAddressBanned(remote_addr))
|
||||
{
|
||||
std::cerr << "(SS) connection attempt from banned IP address. Refusing it. Attack??" << std::endl;
|
||||
reset_locked();
|
||||
return 0 ;
|
||||
}
|
||||
// check it's the right one.
|
||||
if (certCorrect)
|
||||
|
@ -1361,7 +1355,7 @@ int pqissl::accept_locked(SSL *ssl, int fd, const struct sockaddr_storage &forei
|
|||
{
|
||||
uint32_t check_result;
|
||||
|
||||
if(!rsBanList->isAddressAccepted(foreign_addr,RSBANLIST_CHECKING_FLAGS_BLACKLIST,check_result))
|
||||
if(!rsBanList->isAddressAccepted(foreign_addr,RSBANLIST_CHECKING_FLAGS_BLACKLIST,&check_result))
|
||||
{
|
||||
std::cerr << "(SS) refusing incoming SSL connection from blacklisted foreign address " << sockaddr_storage_iptostring(foreign_addr)
|
||||
<< ". Reason: " << check_result << "." << std::endl;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue