From f9817cf817ed8337bfa55e30e7d32d5d1a74c2c7 Mon Sep 17 00:00:00 2001 From: Kévin Le Gouguec Date: Fri, 9 Oct 2020 23:18:13 +0200 Subject: Note down ERC itch --- itches/emacs/tracker.org | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/itches/emacs/tracker.org b/itches/emacs/tracker.org index ba198b0..bec0311 100644 --- a/itches/emacs/tracker.org +++ b/itches/emacs/tracker.org @@ -154,6 +154,54 @@ Fixed by Dmitry. :TestAdded: t :END: My commit message ran afoul of debbugs.el's =M-m= again. +*** ERC +**** TODO Support SASL authentication +Got bitten by this when trying to connect to irc.freenode.net from +=alyon-654-1-454-60.w109-213.abo.wanadoo.fr=: +#+begin_quote +ERROR from irc.freenode.net: Closing Link: +alyon-654-1-454-60.w109-213.abo.wanadoo.fr (SASL access only) +#+end_quote + +This was requested in [[bug:29108]]. Lars closed this report because +while there is a third-party package to implement the feature, its +author did not respond when prompted for copyright assignment. + +I did not have the patience to look at the package; instead I went +straight to [[https://ircv3.net/specs/extensions/sasl-3.1][the description of SASL on ircv3.net]] and the [[https://tools.ietf.org/html/rfc4616#section-2][RFC for the +=PLAIN= mechanism]], and cobbled this silly patch: + +#+begin_src diff +diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el +index 1d5506e281..0da677ac18 100644 +--- a/lisp/erc/erc.el ++++ b/lisp/erc/erc.el +@@ -6052,7 +6052,17 @@ erc-login + erc-session-server + erc-session-user-full-name)) + (if erc-session-password +- (erc-server-send (format "PASS %s" erc-session-password)) ++ (progn ++ (erc-server-send "CAP REQ :sasl") ++ (erc-server-send "AUTHENTICATE PLAIN") ++ (erc-server-send ++ (concat "AUTHENTICATE " (base64-encode-string ++ (string-join (list ++ (user-login-name) ++ (erc-current-nick) ++ erc-session-password) ++ "\0")))) ++ (erc-server-send "CAP END")) + (message "Logging in without password")) + (erc-server-send (format "NICK %s" (erc-current-nick))) + (erc-server-send +#+end_src + +AFAICT this is enough to get me authenticated on Freenode. It looks +like it's not too hard to implement? + +Ideally Emacs's builtin =sasl.el= should be reused; that would let ERC +support better SASL mechanisms than =PLAIN=. *** Gnus **** DONE [[bug:40520]] Prevent duplicate thread titles :PROPERTIES: -- cgit v1.2.3