summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKernc <kerncece@gmail.com>2016-09-22 01:24:53 +0200
committerKernc <kerncece@gmail.com>2016-09-22 01:24:53 +0200
commitdd1ad260c75b7f6ae39123b382af36eb11f1cd54 (patch)
tree624bc6d7dfc57fe1b8ebba9fac14e47aa88b2368
parent229656ecfaa996a439c746a725eaa338a1fef1e6 (diff)
downloadpidgin-dd1ad260c75b7f6ae39123b382af36eb11f1cd54.tar.gz
IRC: Skip EXTERNAL SASL auth mechanism
Makes Freenode and other servers that prefer SASL EXTERNAL fingerprint authentication work again. Ref: "Cannot connect to IRC (Freenode)" https://pidgin.im/pipermail/support/2016-September/029627.html
-rw-r--r--libpurple/protocols/irc/msgs.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/libpurple/protocols/irc/msgs.c b/libpurple/protocols/irc/msgs.c
index c44ff38768..99baf4ca2e 100644
--- a/libpurple/protocols/irc/msgs.c
+++ b/libpurple/protocols/irc/msgs.c
@@ -1574,6 +1574,8 @@ irc_msg_cap(struct irc_conn *irc, const char *name, const char *from, char **arg
int id = 0;
PurpleConnection *gc = purple_account_get_connection(irc->account);
const char *mech_list = NULL;
+ char *pos;
+ size_t index;
if (strncmp(args[2], "sasl ", 6))
return;
@@ -1637,6 +1639,15 @@ irc_msg_cap(struct irc_conn *irc, const char *name, const char *from, char **arg
}
irc->sasl_mechs = g_string_new(mech_list);
+ /* Drop EXTERNAL mechanism since we don't support it */
+ if ((pos = strstr(irc->sasl_mechs->str, "EXTERNAL"))) {
+ index = pos - irc->sasl_mechs->str;
+ g_string_erase(irc->sasl_mechs, index, strlen("EXTERNAL"));
+ /* Remove space which separated this mech from the next */
+ if ((irc->sasl_mechs->str)[index] == ' ') {
+ g_string_erase(irc->sasl_mechs, index, 1);
+ }
+ }
irc_auth_start_cyrus(irc);
}