summaryrefslogtreecommitdiff
path: root/lisp/erc/erc-sasl.el
Commit message (Collapse)AuthorAgeFilesLines
* ; Fix wrong error name in erc-server-908 doc string.F. Jason Park2023-03-031-2/+3
| | | | | | * lisp/erc/erc-sasl.el (erc-server-908): Correct well-known name for 908 numeric in doc string. (erc--register-connection): Fold overlong line.
* ; Prepare to update ERC version to 5.5F. Jason Park2023-02-141-20/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * doc/misc/erc.texi: Mention in various places that ERC is also available from GNU ELPA. * etc/ERC-NEWS: Mention Compat dependency and shorten title for auth-source section. * lisp/erc/erc-backend.el: (erc-server-reconnect-function, erc-tags-format): Update package version to 5.5. (erc--parse-message-tags): Downcase warning "type" to remain consistent with all other ERC warnings. * lisp/erc/erc-button.el: (erc-button-alist): Change package-version to 5.5. * lisp/erc/erc-match.el (erc-match-quote-when-adding): Update package version to 5.5. * lisp/erc/erc-sasl.el: Mention actual info node in Commentary. (erc-sasl): Update package version to 5.5. (erc-sasl-password): Reword doc string. (erc-sasl-auth-source-function): Capitalize "info" in doc string. * lisp/erc/erc-services.el (erc-auth-source-services-function): Update package version to 5.5. Capitalize "info" in doc string. Change choice type from const to function-item. * lisp/erc/erc.el (erc-password): Capitalize "info" in doc string. (erc-inhibit-multiline-input, erc-ask-about-multiline-input, erc-prompt-hidden, erc-hide-prompt, erc-unhide-query-prompt, erc-join-buffer, erc-reconnect-display, erc-kill-server-hook, erc-kill-channel-hook, erc-kill-buffer-hook, erc-url-connect-function): Update package version to 5.5. (erc-auth-source-server-function, erc-auth-source-join-function): Update package version to 5.5. Change choice type from const to function-item. Capitalize "info" in doc string. (erc-tls): Capitalize "info" in doc string.
* Don't casemap erc-sasl-user when set to :nickF. Jason Park2023-02-031-6/+5
| | | | | | | | | | | * lisp/erc/erc-sasl.el (erc-sasl-user): Fix doc string. (erc-sasl--get-user): Don't apply casemapping when the option `erc-sasl-user' is set to `:nick'. While many servers and auth-services providers perform case-folding when comparing SASL usernames, only some recognize RFC1459 mappings, which ERC previously applied blindly. Instead, ERC now behaves like other clients in leaving such preparation in the hands of the server. This bug was introduced with changes new to ERC 5.5 and Emacs 29 (bug#29108).
* ; Add 2023 to copyright years.Eli Zaretskii2023-01-011-1/+1
|
* Warn of absent networks module in ERCF. Jason Park2022-12-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * doc/misc/erc.texi: Add linkable note in Modules chapter about some modules being required. Also tweak markup in auth-source section. * etc/ERC-NEWS: Mention the special role of `networks'. * lisp/erc/erc-backend.el (erc--server-post-connect-hook): Add internal hook for core modules to perform post-network-process, pre-protocol config validation even when they haven't been loaded. (erc--register-connection): Run `erc--server-post-connect-hook'. * lisp/erc/erc-networks.el (erc-networks--bouncer-targets, erc-networks-on-MOTD-end): Fix comments and doc strings. Also change former from constant to internal variable in case adjustment needed between releases. (erc-networks--warn-on-connect): New function to warn about the `networks' module being absent from `erc-modules'. This could probably run at any time up to and including when the logical IRC connection is established, but doing so at the process/protocol boundary seems ideal. * lisp/erc/erc-sasl.el (erc--register-connection): Defer to base method instead of calling `erc-login' explicitly. * lisp/erc/erc.el (erc-generate-new-buffer-name): Don't reconcile buffer names when networks module not in play. (erc-format-target-and/or-network): Don't assume networks module loaded. * test/lisp/erc/erc-scenarios-base-unstable.el: (erc-scenarios-networks-no-module): New test. * test/lisp/erc/resources/networks/no-module/basic.eld: New test data file. (Bug#60331.)
* Don't send erc-sasl-user as USER command argumentF. Jason Park2022-12-141-6/+19
| | | | | | | | | | | | | | | | * lisp/erc/erc-sasl.el (erc-sasl--send-cap-ls): Add internal switch for sending an opening "CAP LS". The rationale for not enabling this by default is twofold: one, it more strongly implies that ERC supports IRCv3 client capability negotiation, which is somewhat disingenuous; and, two, We'd still be "faking it" by firing and forgetting, and more balls in the air makes things less predictable. (erc--register-connection): Possibly send a "CAP LS" before anything depending on the value of `erc-sasl--send-cap-ls'. Also, don't attempt to send `erc-session-username' when it holds an SASL username because the latter may contain protocol-defying characters. * test/lisp/erc/resources/base/local-modules/fourth.eld: change user parameter of "USER" command to reflect nick when `erc-sasl-user' is set to `:user'. (Bug#59976.)
* Add dedicated auth-source section in ERC manualF. Jason Park2022-12-141-1/+1
| | | | | | | | | | | | | | | | | | * doc/misc/erc.texi: Move auth-source description from the Password subheading of the Advanced chapter's Connecting section to the new Integrations section as a new node, Auth-Source, and give it a bit more structure. Fix various misuses of xref vs. pxref. Convert URL subheading to subsection and add anchor. Prefer "backend" as a single word, based on usage in other manuals. Also replace loud "warning" in SASL troubleshooting section. * etc/ERC-NEWS: Re-link auth-source mention. * lisp/erc/erc-sasl.el (erc-sasl-auth-source-function): Update info node in doc string. * lisp/erc/erc-services.el (erc-auth-source-services-function): Re-link auth-source info node in doc string. * lisp/erc/erc.el (erc-password, erc-auth-source-server-function, erc-auth-source-join-function): Re-link auth-source info node in doc strings.
* Simplify erc-sasl's auth-source APIF. Jason Park2022-11-291-30/+47
| | | | | | | | | | | | | | | | * doc/misc/erc.texi: Revise descriptions in SASL chapter to reflect simplified auth-source options. * lisp/erc/erc-sasl.el (erc-sasl-password, erc-sasl-auth-source-function): Revise doc strings. (erc-sasl-auth-source-password-as-host): New function to serve as more useful choice for option `erc-sasl-auth-source-function'. (erc-sasl--read-password): Promote auth-source to pole position, above an explicit string and `:password'. * test/lisp/erc/erc-sasl-tests.el (erc-sasl--read-password--basic): Massage tests to conform to simplified `erc-sasl-password' API. (Bug#29108.)
* Add erc-sasl-auth-source-function to cached optionsF. Jason Park2022-11-281-4/+6
| | | | | | | | | | | | * lisp/erc/erc-sasl.el (erc-sasl--read-password): Consult cached options instead of `erc-sasl-auth-source-function'. (erc-sasl--init): Add `erc-sasl-auth-source-function' to `erc-sasl--options'. * test/lisp/erc/erc-sasl-tests.el (erc-sasl--read-password--basic, erc-sasl--read-password--auth-source): Look for original value of `erc-sasl-auth-source-function' in `erc-sasl--options' under the `authfn' key.
* Accept functions in place of passwords in ERCF. Jason Park2022-11-231-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/erc/erc-backend.el (erc-session-password): Add comment explaining type is now string, nil, or function. * lisp/erc/erc-compat.el (erc-compat--29-auth-source-pass-search): Use obfuscation from auth-source function when available. * lisp/erc/erc-sasl.el (erc-sasl--read-password, erc-server-AUTHENTICATE): Use `erc--unfun'. * lisp/erc/erc-services.el (erc-nickserv-get-password, erc-nickserv-send-identify): Use `erc--unfun'. * lisp/erc/erc.el (erc--unfun): New function for unwrapping a password couched in a getter. (erc--debug-irc-protocol-mask-secrets): Add variable to indicate whether to mask passwords in debug logs. (erc--mask-secrets): New function to swap masked secret with question marks in debug logs. (erc-log-irc-protocol): Conditionally mask secrets when `erc--debug-irc-protocol-mask-secrets' is non-nil. (erc--auth-source-search): Don't unwrap secret from function before returning. (erc-server-join-channel, erc-login): Use `erc--unfun'. * test/lisp/erc/erc-services-tests.el (erc-services-tests--wrap-search): Add helper for `erc--unfun'. (erc-services-tests--auth-source-standard, erc-services-tests--auth-source-announced, erc-services-tests--auth-source-overrides, erc-nickserv-get-password): Use `erc--unfun'. * test/lisp/erc/erc-tests.el (erc--debug-irc-protocol-mask-secrets): Add test for masking secrets with `erc--unfun' and friends.
* Add non-IRCv3 SASL module to ERCF. Jason Park2022-11-231-0/+417
* doc/misc/erc.texi: Add SASL section in Advanced Usage chapter to document the new SASL module. * etc/ERC-NEWS: Mention addition of erc-sasl module for SASL support. * lisp/erc/erc-compat.el (erc-compat--29-sasl-scram-construct-gs2-header, erc-compat--29-sasl-scram-client-first-message, erc-compat--29-sasl-scram--client-final-message): Fix encoding bug and add minimal authorization support with copies of SASL functions introduced in Emacs 29. * lisp/erc/erc.el (erc-modules): Add `sasl'. * lisp/erc/erc-sasl.el: New file (bug#29108). * test/lisp/erc/erc-sasl-tests.el: New file. * test/lisp/erc/erc-scenarios-sasl.el: New file. * test/lisp/erc/resources/sasl/plain-failed.eld: New file. * test/lisp/erc/resources/sasl/plain.eld: New file. * test/lisp/erc/resources/sasl/scram-sha-1.eld: New file. * test/lisp/erc/resources/sasl/scram-sha-256.eld: New file. * test/lisp/erc/resources/sasl/external.eld: New file.