-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
KLine SSL Issue 177 #207
base: master
Are you sure you want to change the base?
KLine SSL Issue 177 #207
Conversation
Check for ban after SSL stuff done with, now get KLine/AKill info instead of SSL error instead.
ban = check_userbanned(acptr, UBAN_IP|UBAN_CIDR4|UBAN_WILDUSER, 0); | ||
if(ban) | ||
{ | ||
int loc = (ban->flags & UBAN_LOCAL) ? 1 : 0; | ||
|
||
ircstp->is_ref++; | ||
ircstp->is_ref_1++; | ||
exit_banned_client(acptr, loc, loc ? 'K' : 'A', ban->reason, 0); | ||
|
||
return NULL; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like check_userbanned will be postponed until SERVER or USER is parsed even for non-SSL connections. Couldn't we just silently return here if it is a banned SSL connection, and add another ban check when the SSL handshake is finished?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True. By skipping this part, one less look through the banlist for a match, especially if the ban is placed on user@host, as we don't have the user info here yet.
if(!(ban = check_userbanned(sptr, UBAN_IP|UBAN_CIDR4, UBAN_WILDUSER))) | ||
if(!(ban = check_userbanned(sptr, UBAN_IP|UBAN_CIDR4, 0))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is removing UBAN_WILDUSER necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you look in check_userbanned, with the flag, during my tests, only bans on *@host instead of both and *user@host are being matched.
Check for ban after SSL stuff done with, now get KLine/AKill info instead of SSL error instead.