Open Neustradamus opened 2 years ago
Thank you so much for simply documenting this so thoroughly and cleanly, @Neustradamus.
I will very gratefully review and accept a PR that adds support for the SCRAM-SHA-*
mechanisms!
This is a new gem, which is not (yet) used by anyone as far as I know. But it has been extracted from code which has been part of ruby's stdlib since 2000! Unfortunately, that code was hidden away inside ruby's IMAP library and not available as a library in its own right, the way SASL was meant to be used. I do have other improvements planned for this gem over the next couple of months (e.g. OAUTHBEARER
), and I will most likely start using it in some of my own projects very soon.
My ultimate goals for this gem are:
net-imap
, net-smtp
, and net-pop
which are all bundled gems.net-sasl
to also be a bundled gem.net-ldap
, blather
(XMPP), memcached
, dalli
(another memcached client). And probably some others.Unfortunately, the SASL-SHA-*
mechanisms are still unsupported by most servers that I work with. I understand that client support waiting for server support and vice versa creates a chicken-and-egg dilemma. Unfortunately, I simply don't have time to add this myself right now.
If you don't have time to create a PR for this gem, that's okay too. The gem is still young and will probably undergo a few API changes before it's released as 1.0, so if you create a PR against the current main branch, I might need to update it in the very near term anyway.
The second best option would be if you simply found or provided a generic ruby implementation with a compatible open source license and a good test suite. I can do the remaining work to import it. It might take me a few months to get around to it, but I will get around to it. These mechanisms should be in this library.
Third best option: point me at a well tested open source implementation in another language. It will take me longer to get around to porting that into ruby. And I could probably find one on my own by simply googling. And even still, I probably won't have time to add this myself. But a suggested reference implementation will improve the odds. :)
See also:
I did create a branch of net-imap
which uses this gem, but it was just a draft and will need to be rebased to the latest release.
I remarked there that I was going to create PRs for the other bundled gems (net-pop
and net-smtp
), but my schedule changed and I never got back to that. If this is going to be included in the bundled gems for ruby 3.2, I'd like to start that conversation very early in the release cycle.
Thanks @singpolyma for https://github.com/nevans/net-sasl/pull/5!
@nevans: Have you planned to merge it?
@Neustradamus Please see my comments on #3, #4, and #5. I'm working on it, but only sporadically. I have a pure ruby SASLprep that I'm mostly happy with, and that was probably my biggest blocker for #5. But I'll probably push them all as PRs to net-imap
before I port them over here.
@nevans: Have you progressed on it?
Sorry, in the limited time I'm had to spend on non-work related, I've been pushing a couple of other things forward, but haven't gotten back to this yet. Thanks for the ping. I'll take a look at where I left off in my earlier branch.
Dear @nevans,
In first, I wish you a Happy New Year!
Can you add supports of :
You can add too:
"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]".
SCRAM-SHA-1(-PLUS): -- https://tools.ietf.org/html/rfc5802 -- https://tools.ietf.org/html/rfc6120
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
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
https://xmpp.org/extensions/inbox/hash-recommendations.html
-PLUS variants:
IMAP:
LDAP:
HTTP:
2FA:
IANA:
Linked to: