Repository navigation
SCRAM-SHA-1(-PLUS) + SCRAM-SHA-256(-PLUS) + SCRAM-SHA-512(-PLUS) supports #57
Description
Can you add the SCRAM supports?
For example Rouncube has needed: roundcube/roundcubemail#6917
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:
- SCRAM-SHA-1
- SCRAM-SHA-256
-> https://doc.dovecot.org/configuration_manual/authentication/password_schemes/
GNU SASL supports:
- SCRAM-SHA-1
- SCRAM-SHA-1-PLUS
- SCRAM-SHA-256
- SCRAM-SHA-256-PLUS
-> http://www.gnu.org/software/gsasl/
"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 -
SCRAM BIS: Salted Challenge Response Authentication Mechanism (SCRAM) SASL and GSS-API Mechanisms:
-- https://tools.ietf.org/html/draft-melnikov-scram-bis
https://xmpp.org/extensions/inbox/hash-recommendations.html
-PLUS variants:
- 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
- Channel-Binding Types: https://www.iana.org/assignments/channel-binding-types/channel-binding-types.xhtml
- RFC 9266: Channel Bindings for TLS 1.3: https://tools.ietf.org/html/rfc9266
IMAP:
- RFC9051: Internet Message Access Protocol (IMAP) - Version 4rev2: https://tools.ietf.org/html/rfc9051
LDAP:
- RFC5803: Lightweight Directory Access Protocol (LDAP) Schema for Storing Salted: Challenge Response Authentication Mechanism (SCRAM) Secrets: https://tools.ietf.org/html/rfc5803
HTTP:
- RFC7804: Salted Challenge Response HTTP Authentication Mechanism: https://tools.ietf.org/html/rfc7804
2FA:
- Extensions to Salted Challenge Response (SCRAM) for 2 factor authentication: https://datatracker.ietf.org/doc/html/draft-ietf-kitten-scram-2fa
IANA:
- Simple Authentication and Security Layer (SASL) Mechanisms: https://www.iana.org/assignments/sasl-mechanisms/sasl-mechanisms.xhtml
Linked to:
Activity
jparise commentedon Nov 30, 2019
I don't have any plans to implement this myself, but I would gladly review a patch that adds this support.
Neustradamus commentedon Oct 31, 2020
[-]SCRAM-SHA-1(-PLUS) + SCRAM-SHA-256(-PLUS) supports[/-][+]SCRAM-SHA-1-PLUS + SCRAM-SHA-256-PLUS + SCRAM-SHA-512-PLUS supports[/+][-]SCRAM-SHA-1-PLUS + SCRAM-SHA-256-PLUS + SCRAM-SHA-512-PLUS supports[/-][+]SCRAM-SHA-1(-PLUS) + SCRAM-SHA-256(-PLUS) + SCRAM-SHA-512(-PLUS) supports[/+]jparise commentedon Mar 18, 2021
As I said earlier, I'd be glad to review a Pull Request that adds support for these new algorithms.
schengawegga commentedon Sep 29, 2022
@Neustradamus I have developed a first draft of SCRAM support, but i have to test it first before i can create a pull request. Do you have a docker container within a SMTP server wich supports any or all kinds of SCRAM?
Neustradamus commentedon Oct 11, 2022
mbhangui commentedon Oct 12, 2022
indimail has docker images at https://hub.docker.com/r/cprogrammer/indimail. Some documentation is here.
The steps would be to
You can reach out to me privately if you need any help in setting up accounts using indimail docker.
gsasl also has a tiny smtp server in the examples directory. One can compile it and do a basic test. AFAIK, The gsasl utility too can act as a server using the --server option. But I have never tried those option. But I have used the client options to test SCRAM auth methods against indimail server.
Neustradamus commentedon Oct 14, 2022
schengawegga commentedon Oct 18, 2022
@Neustradamus @mbhangui
Yes, iÂīve seen @mbhangui comment.
Thanks you for the detailed instructions.
But my time is very short at the moment.
I will have a closer look on the docker container when iÂīm not so busy anymore.
SCRAM-SHA-1(-PLUS) + SCRAM-SHA-256(-PLUS) + SCRAM-SHA-512(-PLUS) suppâĶ
schengawegga commentedon Mar 26, 2023
@mbhangui now i tried about 4 hours to run and configure indimail to test my developement, but it wonÂīt work on my own.
It is possible, that you can give me a fully configured indimail server within an .vbox image?
My problem at the moment is a mysql certificate error on vadduser command.
mbhangui commentedon Mar 30, 2023
Which image did you use? Sure I can give a full configured indimail server with .vbox image, but that could take me a day or two.
mbhangui commentedon Mar 30, 2023
So I tried this and it worked. You can repeat the steps exactly as below
Pull the image
$ podman pull ghcr.io/mbhangui/indimail:rockylinux8
List the image
$ podman images|grep rocky
ghcr.io/mbhangui/indimail rockylinux8 274da2d2b6d7 2 months ago 1.09 GB
Run docker or podman command. This will run SMTP on port 25 without authentication and on port 587 with authentication. You can use port 2587 on the host where you run podman command to use SMTP for testing SCRAM methods.
Any issue let me know. You can replace podman with docker command. The syntax is the same for both. I prefer podman because it runs without needing a daemon running as root.
The response to the gsasl command will be like this and in the end you should get
235 ok, go ahead (#2.0.0)schengawegga commentedon Mar 31, 2023
@mbhangui Thanks for your manual.
But when i do step 3, i get the following errormessage
Maybe can you please provide a vbox image to me?
That will be very helpful.
I am not in a hurry, so it is okay if it takes some time.
14 remaining items
Neustradamus commentedon Aug 15, 2023
mbhangui commentedon Aug 15, 2023
Totally slipped my mind that I have to reply. Here is the command. You just have to use -C option and it will support all CRAM methods. The -C option can be used with SCRAM methods too. However, the default setting of SMTP service in indimail doesn't support CRAM because of the danger of storing clear text passwords in the database. If someone steals the database, the person will walk away happily with un-encrypted passwords. To enable CRAM in SMTP a one time setting of ENABLE_CRAM variable is required, which is given below
There is a detailed topic on setting up authenticated smtp mechanisms in indimail here. But feel free to post any doubts/clarification here itself
mbhangui commentedon Aug 15, 2023
Thanks for reminding me. It had totally slipped my mind as I was busy planning a vacation. I have updated the above post with few things that I had missed out
SCRAM-SHA-1(-PLUS) + SCRAM-SHA-256(-PLUS) + SCRAM-SHA-512(-PLUS) suppâĶ
Add SCRAM-SHA-1, SCRAM-SHA-224, SCRAM-SHA-256, SCRAM-SHA-384 and SCRAâĶ
Add SCRAM-SHA-1, SCRAM-SHA-224, SCRAM-SHA-256, SCRAM-SHA-384 and SCRAâĶ
schengawegga commentedon Jan 8, 2024
@mbhangui Do indimail support XOAuth and OAuthbearer? And how do i configure this methods? Thanks you :-)
mbhangui commentedon Jan 9, 2024
Neustradamus commentedon Oct 2, 2026
Dear all, @schengawegga, @mbhangui,
It is in progress for Channel Binding in PHP, can you test it?
Feedback is very important for the PHP PR author...
Neustradamus commentedon Oct 26, 2026
@fabiang has added the support following @Sjord PHP PR: php/php-src#24035