aboutsummaryrefslogtreecommitdiffstats
path: root/irc_cap.c
diff options
context:
space:
mode:
authordequis <dx@dxzone.com.ar>2015-09-11 19:07:10 -0300
committerdequis <dx@dxzone.com.ar>2015-10-08 05:34:18 -0300
commit58b63de6f1dd84a4923c623dafd548512ecdf054 (patch)
treec6ded487de0a9538b412819b3f24f6925a3c1135 /irc_cap.c
parent2f736927554d588d00d31f367cd07b9845036e09 (diff)
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
Diffstat (limited to 'irc_cap.c')
-rw-r--r--irc_cap.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/irc_cap.c b/irc_cap.c
index 79732409..4cfc158b 100644
--- a/irc_cap.c
+++ b/irc_cap.c
@@ -37,6 +37,7 @@ typedef struct {
} cap_info_t;
static const cap_info_t supported_caps[] = {
+ {"sasl", CAP_SASL},
{"multi-prefix", CAP_MULTI_PREFIX},
{NULL},
};
@@ -169,6 +170,12 @@ void irc_cmd_cap(irc_t *irc, char **cmd)
} else if (g_strcasecmp(cmd[1], "END") == 0) {
irc->status &= ~USTATUS_CAP_PENDING;
+
+ if (irc->status & USTATUS_SASL_PLAIN_PENDING) {
+ irc_send_num(irc, 906, ":SASL authentication aborted");
+ irc->status &= ~USTATUS_SASL_PLAIN_PENDING;
+ }
+
irc_check_login(irc);
} else {