Support SCRAM-SHA-256 authentication mechanism
Categories
(Chat Core :: XMPP, enhancement)
Tracking
(Not tracked)
People
(Reporter: Neustradamus, Assigned: clokep)
Details
Attachments
(2 files)
|
16.92 KB,
patch
|
florian
:
review+
|
Details | Diff | Splinter Review |
|
11.30 KB,
patch
|
Details | Diff | Splinter Review |
User Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:56.0) Gecko/20100101 Firefox/56.0
Steps to reproduce:
My request is for all actual Thunderbird stable branches in more than trunk.
Can you add SCRAM-SHA-1(-PLUS) and SCRAM-SHA-256(-PLUS) support?
After SCRAM-SHA-1(-PLUS):
Now there is SCRAM-SHA-256(-PLUS):
- https://tools.ietf.org/html/rfc7677 since 2015-11-02
- https://tools.ietf.org/html/rfc8600 since 2019-06-21: https://mailarchive.ietf.org/arch/msg/ietf-announce/suJMmeMhuAOmGn_PJYgX5Vm8lNA
"When using the SASL SCRAM mechanism, the SCRAM-SHA-256-PLUS variant SHOULD be preferred over the SCRAM-SHA-256 variant, and SHA-256 variants [RFC7677] SHOULD be preferred over SHA-1 variants [RFC5802]".
Actual results:
Expected results:
| Assignee | ||
Comment 1•6 years ago
|
||
What protocol is this in reference to? XMPP?
| Reporter | ||
Comment 2•6 years ago
|
||
Yes!
But SCRAM is not only for XMPP, for other parts, there is already a ticket here: https://bugzilla.mozilla.org/show_bug.cgi?id=1503382.
| Assignee | ||
Comment 3•6 years ago
|
||
The code for XMPP authentication is in https://searchfox.org/comm-central/source/chat/protocols/xmpp/xmpp-authmechs.jsm.
We currently support PLAIN and SCRAM-SHA-1. It shouldn't be too hard to add the other ones. The prioritization of these is weirdly defined right now (with the assumption that only two will ever exist, I think).
| Assignee | ||
Updated•6 years ago
|
| Assignee | ||
Comment 4•6 years ago
|
||
This adds support for SCRAM-SHA-256. It pretty much abstracts the SCRAM-SHA-1 support to allow choosing a hashing algorithm. The diff is pretty messy due to whitespace changes. Using hg diff -w helps quite a bit on it.
Tests are included for SCRAM-SHA-256 and slightly expanded for PLAIN and SCRAM-SHA-1.
I'm unsure if I need to worry about ordering of the supported mechanisms since I think the server will send us them in the order we care to use them? I'm not 100% sure on that though.
I think adding SCRAM-SHA-1-PLUS and SCRAM-SHA-256-PLUS needs to be a separate bug. I frankly don't really know what the improvement is there.
| Assignee | ||
Comment 5•6 years ago
|
||
Neustradamus: Is there a server I can test this against?
| Assignee | ||
Updated•6 years ago
|
| Reporter | ||
Comment 6•6 years ago
|
||
Thanks for your job Patrick!
Easy to add for mail section?
A lot of informations here and it is not only SCRAM-SHA-1(-PLUS) and SCRAM-SHA-256(-PLUS): https://github.com/scram-xmpp/info/issues/1
PLUS variants are complicated?
XMPP servers which already support it: Metronome IM, Tigase, Jackal :)
To test:
- lightwitch.org has up-to-date Metronome IM
- jackal.im I think too?
- tigase.im no sure
Note: It has been added in Cyrus SASL (there are SCRAM-SHA-1(-PLUS), SCRAM-SHA-224(-PLUS), SCRAM-SHA-256(-PLUS), SCRAM-SHA-384(-PLUS), SCRAM-SHA-512(-PLUS) : https://github.com/cyrusimap/cyrus-sasl/commits/master
| Assignee | ||
Comment 7•6 years ago
|
||
(In reply to Neustradamus from comment #6)
Thanks for your job Patrick!
Easy to add for mail section?
I have no idea, but please keep bugs to an individual task.
PLUS variants are complicated?
Frankly I don't understand the PLUS variants.
XMPP servers which already support it: Metronome IM, Tigase, Jackal :)
To test:
- lightwitch.org has up-to-date Metronome IM
- jackal.im I think too?
- tigase.im no sure
I'll try to test on one of these at some point.
| Assignee | ||
Comment 8•6 years ago
|
||
I tested this patch on lightwitch.org and confirmed that SCRAM-SHA-256 was used (and worked).
| Reporter | ||
Comment 9•6 years ago
|
||
About -PLUS variants, Channel-Binding Support is needed in NSS: https://bugzilla.mozilla.org/show_bug.cgi?id=563276
| Assignee | ||
Comment 10•6 years ago
|
||
I played with implementing SCRAM-SHA-512 a bit, but was unable to get logins to work using that. I've seen other reports of this happening as well. There's no RFC for SCRAM-SHA-512, so there's no official test vectors, which makes it a bit hard to test.
Florian -- I think this is ready for a final review.
| Assignee | ||
Comment 11•6 years ago
|
||
| Assignee | ||
Comment 12•6 years ago
|
||
This is attachment 9090115 [details] [diff] [review], but with -w enabled to ignore whitespace.
Comment 13•6 years ago
|
||
Comment 14•6 years ago
|
||
Pushed by clokep@gmail.com:
https://hg.mozilla.org/comm-central/rev/475ba5f24a14
Support SCRAM-SHA-256 for XMPP. r=florian
| Assignee | ||
Comment 15•6 years ago
|
||
If any additional mechanisms are wanted, please file a follow-up bug to this one.
| Reporter | ||
Comment 16•6 years ago
|
||
Thanks a lot to @clokep and @florian for SCRAM-SHA-256!
It can not possible to add in all actual Thunderbird branches (ESR,...)?
What is the problem with 512? :/
Have you looked in the code in Cyrus SASL, Metronome IM, Jackal, Tigase, etc.?
| Assignee | ||
Comment 17•6 years ago
|
||
(In reply to Neustradamus from comment #16)
It can not possible to add in all actual Thunderbird branches (ESR,...)?
Changes need to be tested before being put onto a release branch. Once this goes through a beta period we can consider uplifting it to ESR, but I'm inclined not to. I don't see the urgency in uplifting this.
What is the problem with 512? :/
The authentication did not work when I implemented it. I do not know if it was an issue with my implementation or with the server's implementation since there's no test vectors (and no RFC).
Have you looked in the code in Cyrus SASL, Metronome IM, Jackal, Tigase, etc.?
Looking at the code of other products rarely helps. Other developers have run into issues with integration of SCRAM-SHA-512, see https://github.com/qxmpp-project/qxmpp/issues/177#issuecomment-455534422
| Reporter | ||
Comment 18•6 years ago
|
||
It is already done for XMPP:
- SCRAM-SHA-1: https://bugzilla.mozilla.org/show_bug.cgi?id=1267649
- SCRAM-SHA-256: https://bugzilla.mozilla.org/show_bug.cgi?id=1577688
SCRAM-SHA-1-PLUS and SCRAM-SHA-256-PLUS are missing because https://bugzilla.mozilla.org/show_bug.cgi?id=563276
People can look?
Tickets:
- For IMAP: https://bugzilla.mozilla.org/show_bug.cgi?id=1503382
- For POP: https://bugzilla.mozilla.org/show_bug.cgi?id=1597102
- For SMTP: https://bugzilla.mozilla.org/show_bug.cgi?id=1597103
- For LDAP: https://bugzilla.mozilla.org/show_bug.cgi?id=1597106
People can look?
RFCs:
- RFC5802: Salted Challenge Response Authentication Mechanism (SCRAM) SASL and GSS-API Mechanisms: https://tools.ietf.org/html/rfc5802
- RFC7677: SCRAM-SHA-256 and SCRAM-SHA-256-PLUS Simple Authentication and Security Layer (SASL) Mechanisms: https://tools.ietf.org/html/rfc7677 - since 2015-11-02
- RFC5056: On the Use of Channel Bindings to Secure Channels: https://tools.ietf.org/html/rfc5056
- RFC5929: Channel Bindings for TLS: https://tools.ietf.org/html/rfc5929
- RFC5803: Lightweight Directory Access Protocol (LDAP) Schema for Storing Salted: Challenge Response Authentication Mechanism (SCRAM) Secrets: https://tools.ietf.org/html/rfc5803
- RFC7804: Salted Challenge Response HTTP Authentication Mechanism: https://tools.ietf.org/html/rfc7804
IANA:
- Simple Authentication and Security Layer (SASL) Mechanisms: https://www.iana.org/assignments/sasl-mechanisms/sasl-mechanisms.xhtml
- Channel-Binding Types: https://www.iana.org/assignments/channel-binding-types/channel-binding-types.xhtml
Cyrus SASL supports:
- SCRAM-SHA-1
- SCRAM-SHA-1-PLUS
- SCRAM-SHA-224
- SCRAM-SHA-224-PLUS
- SCRAM-SHA-256
- SCRAM-SHA-256-PLUS
- SCRAM-SHA-384
- SCRAM-SHA-384-PLUS
- SCRAM-SHA-512
- SCRAM-SHA-512-PLUS
-> https://cyrusimap.org/sasl/sasl/authentication_mechanisms.html
-> https://github.com/cyrusimap/cyrus-sasl/commits/master
Dovecot SASL supports:
GNU SASL supports:
- SCRAM-SHA-1
- SCRAM-SHA-1-PLUS
-> http://www.gnu.org/software/gsasl/
CRAM-MD5 to Historic:
- https://tools.ietf.org/html/draft-ietf-sasl-crammd5-to-historic-00 // 20 November 2008
RFC6331: Moving DIGEST-MD5 to Historic
- https://tools.ietf.org/html/rfc6331 since July 2011
More informations:
Comment 19•5 years ago
|
||
Dovecot supports SCRAM-SHA-256 per v2.3.10, which was released earlier last month.
| Reporter | ||
Comment 20•5 years ago
|
||
After old TLS version, for TLS 1.3, there is: https://tools.ietf.org/html/draft-ietf-kitten-tls-channel-bindings-for-tls13
And there are other SCRAM too:
- SCRAM-SHA-512(-PLUS): https://tools.ietf.org/html/draft-melnikov-scram-sha-512
- SCRAM-SHA3-512(-PLUS): https://tools.ietf.org/html/draft-melnikov-scram-sha3-512
- Extensions to Salted Challenge Response (SCRAM) for 2 factor authentication: https://tools.ietf.org/html/draft-melnikov-scram-2fa
@clokep and @florian: Can you see to add SCRAM-SHA-512?
It is already in Cyrus SASL.
Do you wait about SCRAM-SHA3-512?
Thanks in advance.
| Assignee | ||
Comment 21•5 years ago
|
||
Neustradamus -- please do not respond to closed bugs asking for additional features. Please file a separate bug for new features.
Description
•