From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: "J.P." Newsgroups: gmane.emacs.bugs Subject: bug#29108: 25.3; ERC SASL support Date: Wed, 28 Jul 2021 15:42:48 -0700 Message-ID: <874kcedpqv.fsf@neverwas.me> References: <87h8ud92zl.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24647"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 29108@debbugs.gnu.org To: Ulrich Mueller Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jul 29 00:44:13 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m8sHb-0006E7-A2 for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 29 Jul 2021 00:44:11 +0200 Original-Received: from localhost ([::1]:34662 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m8sHa-0002NH-8M for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 28 Jul 2021 18:44:10 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43618) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m8sHS-0002N6-Me for bug-gnu-emacs@gnu.org; Wed, 28 Jul 2021 18:44:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:44468) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m8sHS-0002ER-Ac for bug-gnu-emacs@gnu.org; Wed, 28 Jul 2021 18:44:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1m8sHR-0004uo-Vf for bug-gnu-emacs@gnu.org; Wed, 28 Jul 2021 18:44:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: "J.P." Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 28 Jul 2021 22:44:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 29108 X-GNU-PR-Package: emacs Original-Received: via spool by 29108-submit@debbugs.gnu.org id=B29108.162751218318823 (code B ref 29108); Wed, 28 Jul 2021 22:44:01 +0000 Original-Received: (at 29108) by debbugs.gnu.org; 28 Jul 2021 22:43:03 +0000 Original-Received: from localhost ([127.0.0.1]:56014 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m8sGV-0004tX-8Y for submit@debbugs.gnu.org; Wed, 28 Jul 2021 18:43:03 -0400 Original-Received: from mail-109-mta213.mxroute.com ([136.175.109.213]:39089) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m8sGS-0004t1-Oz for 29108@debbugs.gnu.org; Wed, 28 Jul 2021 18:43:01 -0400 Original-Received: from filter004.mxroute.com ([149.28.56.236] filter004.mxroute.com) (Authenticated sender: mN4UYu2MZsgR) by mail-109-mta213.mxroute.com (ZoneMTA) with ESMTPSA id 17aef48ebe3000e209.001 for <29108@debbugs.gnu.org> (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES128-GCM-SHA256); Wed, 28 Jul 2021 22:42:51 +0000 X-Zone-Loop: d10d178c898e2617ad65884a731b4df3833f912a27df X-Originating-IP: [149.28.56.236] In-Reply-To: (Ulrich Mueller's message of "Wed, 28 Jul 2021 18:59:34 +0200") X-AuthUser: masked@neverwas.me X-Zone-Spam-Resolution: no action X-Zone-Spam-Status: No, score=-0.1, required=15, tests=[ARC_NA=0, URIBL_BLOCKED=0, FROM_HAS_DN=0, RCPT_COUNT_THREE=0, TO_DN_SOME=0, MIME_GOOD=-0.1, FROM_EQ_ENVFROM=0, MIME_TRACE=0, RCVD_COUNT_ZERO=0, NEURAL_SPAM=0, MID_RHS_MATCH_FROM=0] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:210846 Archived-At: Ulrich Mueller writes: > ERC is a little behind the times by not supporting SASL, so please > pretty please can we have this? Hi Ulrich, I have a patch for this that I'll be introducing in the next few days as part of a larger change set bringing much needed life support to ERC generally. It lays the foundation for moving us to IRCv3. If you would like a preview, you can check this out [1]. > Not sure if it helps, but archive.org has a partial copy of the original > git repository: > https://web.archive.org/web/20180611034438if_/https://github.com/jane-lx/erc-sasl I'm well acquainted with this patch. IMO, it's a hack, but nothing wrong with that [2]. If you'd like to take what I have for a spin, please follow the steps posted here [3], except change the bug number in all URLs from 48598 to 99999. The stuff there is a bit stale (many improvements since), but I'll be updating it all shortly. More to follow in the next 72 or so. Please stay tuned. Thanks, J.P. [1] https://gitlab.com/jpneverwas/erc-v3/-/blob/master/erc-v3-sasl.el [2] Some info posted to #erc about this a few months back: *** #erc was created on 2021-05-19 07:01:11 Okay people, so I redid my rather horrendous joke of an SASL extension using the upstream sasl.el library and was able to implement all of the recommended mechanisms currently in use or soon to be. Turns out alphachat is running the latest atheme, so I signed up and successfully validated against its service (and captured logs) for both SCRAM-SHA-256 and ECDSA-NIST256P-CHALLENGE. a [14:07] The main ugly point right now is I'm currently shelling out to openssl for the latter (ecdsa). I see two possible ways around this. The first is adding gnutls_privkey_sign_hash() and anything it requires to src/gnutls.c. The other is shelling out to a comparable gnutls-based command-line tool. After a cursory search, I was unable to find one that does the job. Anyone here familiar with that suite? So once we add the basic v3 building blocks for CAP and its subcommands to ERC proper (and a couple tiny sasl.el patches I'll open soon), adding full featured SASL support should go pretty smoothly. Unlike how rcirc and Circe (and the older non-GNU ERC patches) do things, this approach properly delegates to a black-box service for the subprotocol, which is the way rfc4422 designed it. [14:08] This makes it super easy to add other mechanisms in the future. All the gory details are hidden away behind the sasl.el-provided state machine, so you just feed it whatever arrives from the server, and it coughs out the next thing to send. Take a look if you want: https://gitlab.com/jpneverwas/erc-v3/-/blob/master/erc-v3-sasl.el (replace "blob" with "raw" for no JS) [3] https://lists.gnu.org/archive/html/emacs-erc/2021-06/msg00019.html