Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SCRAM-SHA-1(-PLUS) + SCRAM-SHA-256(-PLUS) + SCRAM-SHA-512(-PLUS) + SCRAM-SHA3-512(-PLUS) supports #54

Closed
Tracked by #12 ...
Neustradamus opened this issue Jan 9, 2022 · 6 comments · Fixed by #172
Closed
Tracked by #12 ...
Labels
IMAP4rev2 Requirement for IMAP4rev2, RFC9051 SASL 🔒 Authentication and authentication mechanisms

Comments

@Neustradamus
Copy link

Neustradamus commented Jan 9, 2022

Dear @ruby team,

In first, I wish you a Happy New Year!

Can you add supports of :

  • SCRAM-SHA-1
  • SCRAM-SHA-1-PLUS
  • SCRAM-SHA-256
  • SCRAM-SHA-256-PLUS
  • SCRAM-SHA-512
  • SCRAM-SHA-512-PLUS
  • SCRAM-SHA3-512
  • SCRAM-SHA3-512-PLUS

You can add too:

  • SCRAM-SHA-224
  • SCRAM-SHA-224-PLUS
  • SCRAM-SHA-384
  • SCRAM-SHA-384-PLUS

"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]".

https://xmpp.org/extensions/inbox/hash-recommendations.html

-PLUS variants:

IMAP:

LDAP:

  • RFC5803: Lightweight Directory Access Protocol (LDAP) Schema for Storing Salted: Challenge Response Authentication Mechanism (SCRAM) Secrets: https://tools.ietf.org/html/rfc5803

HTTP:

2FA:

IANA:

Linked to:

@nevans
Copy link
Collaborator

nevans commented Jan 11, 2022

Thank you so much for simply documenting this so thoroughly and cleanly, @Neustradamus. I attached this ticket and #55 to the epic checklist on #12.

Unfortunately, the SASL-SHA-* mechanisms are still either unsupported or not enabled on every server that I work with. I understand that client support waiting for server support and vice versa creates a chicken-and-egg dilemma. (On the other hand, I'll be submitting my implementation for OAUTHBEARER soon. It is now supported by more servers than XOAUTH.)

So... I'd welcome a PR for this! :) If not a PR, perhaps a reference implementation with a suitable open source licence, preferably in ruby or another similar language?

See also:

@Neustradamus
Copy link
Author

@nevans: Thanks to all comments about my tickets :)

I hope that one guy can add the support which is officially needed in the last IMAP RFC.

About memcached, there is a fork (inactive) which supports it:

Note: I have done a ticket in https://github.com/memcached/memcached too...

@Neustradamus
Copy link
Author

@singpolyma has done a PR in net-sasl:

@nevans
Copy link
Collaborator

nevans commented Nov 21, 2022

It's still just a draft, I will definitely be updating and rebasing it, and I might split into multiple smaller PRs. But #78 contains SCRAM-SHA-1 and SCRAM-SHA-256 implementations, and I'd welcome code-review, comments, testing (etc).

@Neustradamus
Copy link
Author

@nevans: Good job!

Have you looked for draft-melnikov-scram-sha-512 and draft-melnikov-scram-sha3-512?

@nevans
Copy link
Collaborator

nevans commented Dec 22, 2022

@nevans: Good job!

Have you looked for draft-melnikov-scram-sha-512 and draft-melnikov-scram-sha3-512?

yes. They both expired back in April. :(

I'd guess they'll probably be resurrected at some point. And probably there won't be any surprising changes to the algorithm nor to the recommended settings.

Just the same, unless there is a very significant deployment of these not-yet-standard mechanisms, I'd rather not add "official" support until they are standardized. It will only be a few lines of code to add support for any digest that's supported by OpenSSL::Digest, so I don't think that's an undue burden for any project that wants to add those mechanisms for themselves.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
IMAP4rev2 Requirement for IMAP4rev2, RFC9051 SASL 🔒 Authentication and authentication mechanisms
Development

Successfully merging a pull request may close this issue.

2 participants