mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-01-24 14:23:36 -05:00
added early discarding of incoming connection attempt (before SSL handshake) for blacklisted IPs
This commit is contained in:
parent
617a863f12
commit
2f4f44ee48
@ -35,6 +35,7 @@
|
|||||||
|
|
||||||
#include "util/rsdebug.h"
|
#include "util/rsdebug.h"
|
||||||
#include "util/rsstring.h"
|
#include "util/rsstring.h"
|
||||||
|
#include "retroshare/rsbanlist.h"
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
const int pqissllistenzone = 49787;
|
const int pqissllistenzone = 49787;
|
||||||
@ -373,12 +374,17 @@ int pqissllistenbase::acceptconnection()
|
|||||||
#endif
|
#endif
|
||||||
/********************************** WINDOWS/UNIX SPECIFIC PART ******************/
|
/********************************** WINDOWS/UNIX SPECIFIC PART ******************/
|
||||||
|
|
||||||
{
|
if(rsBanList != NULL && !rsBanList->isAddressAccepted(remote_addr, RSBANLIST_CHECKING_FLAGS_BLACKLIST))
|
||||||
std::string out;
|
{
|
||||||
out += "Accepted Connection from ";
|
std::cerr << "(II) pqissllistenner::acceptConnection(): early denying connection attempt from blacklisted IP " << sockaddr_storage_iptostring(remote_addr) << std::endl;
|
||||||
out += sockaddr_storage_tostring(remote_addr);
|
return false ;
|
||||||
pqioutput(PQL_DEBUG_BASIC, pqissllistenzone, out);
|
}
|
||||||
}
|
{
|
||||||
|
std::string out;
|
||||||
|
out += "Accepted Connection from ";
|
||||||
|
out += sockaddr_storage_tostring(remote_addr);
|
||||||
|
pqioutput(PQL_DEBUG_BASIC, pqissllistenzone, out);
|
||||||
|
}
|
||||||
|
|
||||||
// Negotiate certificates. SSL stylee.
|
// Negotiate certificates. SSL stylee.
|
||||||
// Allow negotiations for secure transaction.
|
// Allow negotiations for secure transaction.
|
||||||
|
Loading…
Reference in New Issue
Block a user