From 58b63de6f1dd84a4923c623dafd548512ecdf054 Mon Sep 17 00:00:00 2001 From: dequis Date: Fri, 11 Sep 2015 19:07:10 -0300 Subject: IRCv3 SASL capability + PLAIN method Only plain, no other methods. We don't have built-in SSL to implement EXTERNAL (certfp) and nothing else is worth implementing. The actual authentication is pretty much like sending a server password (when the server's authmode isn't closed), which means it happens in cmd_identify, but this code also calls storage_check_pass() to send the required success/failure replies. SASL doesn't give us much benefit other than standards compliance, but some clients might appreciate it. And having a fifth way to do the same thing doesn't hurt! Now we have: - identify in &bitlbee - identify to nickserv (alias for root) - 'nickserv' and 'ns' irc commands - server password - sasl plain --- root_commands.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'root_commands.c') diff --git a/root_commands.c b/root_commands.c index 7e1dc2a7..b5d0aef1 100644 --- a/root_commands.c +++ b/root_commands.c @@ -162,6 +162,12 @@ static void cmd_identify(irc_t *irc, char **cmd) irc->status |= USTATUS_IDENTIFIED; irc_umode_set(irc, "+R", 1); + if (irc->caps & CAP_SASL) { + irc_user_t *iu = irc->user; + irc_send_num(irc, 900, "%s!%s@%s %s :You are now logged in as %s", + iu->nick, iu->user, iu->host, iu->nick, iu->nick); + } + bitlbee_whatsnew(irc); /* The following code is a bit hairy now. With takeover @@ -238,6 +244,12 @@ static void cmd_register(irc_t *irc, char **cmd) irc->status |= USTATUS_IDENTIFIED; irc_umode_set(irc, "+R", 1); + if (irc->caps & CAP_SASL) { + irc_user_t *iu = irc->user; + irc_send_num(irc, 900, "%s!%s@%s %s :You are now logged in as %s", + iu->nick, iu->user, iu->host, iu->nick, iu->nick); + } + /* Set this var now, or anyone who logs in to his/her newly created account for the first time gets the whatsnew story. */ -- cgit v1.2.3