Add forgot define enabling banlist redundant check

This commit is contained in:
Gioacchino Mazzurco 2019-05-14 14:28:27 +02:00
parent 1599689eab
commit 0eee4adaa8
No known key found for this signature in database
GPG Key ID: A1FBCA3872E87051
2 changed files with 14 additions and 8 deletions

View File

@ -1240,9 +1240,11 @@ int pqissl::accept_locked( SSL *ssl, int fd,
constexpr int success = 1; constexpr int success = 1;
#ifdef RS_PQISSL_BANLIST_REDUNDANT_CHECK #ifdef RS_PQISSL_BANLIST_REDUNDANT_CHECK
/* TODO: It make no sense to check banlist at this point, as we are actively /* At this point, as we are actively attempting the connection, we decide
* attempting the connection, we decide the address to which to connect to, * the address to which to connect to, banned addresses should never get
* banned addresses should never get here */ * here as the filtering for banned addresses happens much before, this
* check is therefore redundant, and if it trigger something really fishy
* must be happening (a bug somewhere else in the code). */
uint32_t check_result; uint32_t check_result;
uint32_t checking_flags = RSBANLIST_CHECKING_FLAGS_BLACKLIST; uint32_t checking_flags = RSBANLIST_CHECKING_FLAGS_BLACKLIST;
@ -1253,11 +1255,13 @@ int pqissl::accept_locked( SSL *ssl, int fd,
checking_flags, checking_flags,
&check_result ) ) &check_result ) )
{ {
std::cerr << __PRETTY_FUNCTION__ RsErr() << __PRETTY_FUNCTION__
<< " (SS) refusing incoming SSL connection from blacklisted " << " Refusing incoming SSL connection from blacklisted "
<< "foreign address " << "foreign address " << foreign_addr
<< sockaddr_storage_iptostring(foreign_addr) << ". Reason: " << check_result << ". This should never happen "
<< ". Reason: " << check_result << "." << std::endl; << "at this point! Please report full log to developers!"
<< std::endl;
print_stacktrace();
RsServer::notify()->AddFeedItem( RsServer::notify()->AddFeedItem(
RS_FEED_ITEM_SEC_IP_BLACKLISTED, RS_FEED_ITEM_SEC_IP_BLACKLISTED,

View File

@ -33,6 +33,8 @@
#define RS_PQISSL_AUTH_REDUNDANT_CHECK 1 #define RS_PQISSL_AUTH_REDUNDANT_CHECK 1
#define RS_PQISSL_BANLIST_REDUNDANT_CHECK 1
#define WAITING_NOT 0 #define WAITING_NOT 0
#define WAITING_DELAY 1 #define WAITING_DELAY 1