esl / escalus

An XMPP client library in Erlang for conveniently testing XMPP servers
Apache License 2.0
130 stars 76 forks source link

Scram -PLUS variants #226

Closed NelsonVides closed 4 years ago

NelsonVides commented 4 years ago

Here it is, here it is coming, at last, escalus is getting SCRAM -PLUS variants 🎉

Following the instructions from @michalwski in https://github.com/esl/escalus/pull/223#issuecomment-604364171, I tested with MetronomeIM as follows:

()1 Spec =
        [{username, <<"escalus_vides">>},
         {server, <<"lightwitch.org">>},
         {host, <<"meaveen.lightwitch.org">>},
         {resource, <<"res1">>},
         {password, <<"THIS_IS_NOT_MY_REAL_PASSWORD">>},
         {carbons, false},
         {stream_management, false},
         {starttls, required},
         {auth, {escalus_auth, auth_sasl_scram_sha256_plus}}].
()2> {ok, Client, Features} = escalus_connection:start(Specs).

And connected successfully 🎉

Right, so time for disclaimers: note that this works only with fast_tls as the underlying TLS driver, as OTP's TLS doesn't have as of now an API to get the underlying message. In fact, fast_tls doesn't support it either, the code to do so is on a dev branch in my fork, and this works only with OpenSSL, as other native SSL drivers like BoringSSL or LibreSSL have different API's to get this data that I have not explored.

But now we can work on getting this all organized, the prototypes cleaned, the forks merged... 🙂

Moving forward with https://github.com/esl/MongooseIM/issues/2442 @Neustradamus 😉

Neustradamus commented 4 years ago

@NelsonVides: Thanks a lot!

The order must be: SCRAM-SHA-512-PLUS -> SCRAM-SHA-512 -> SCRAM-SHA-384-PLUS -> SCRAM-SHA-384 -> SCRAM-SHA-256-PLUS -> SCRAM-SHA-256 -> SCRAM-SHA-1-PLUS -> SCRAM-SHA-1

Neustradamus commented 4 years ago

@janciesla8818, @NelsonVides, @michalwski: Have you seen my 3 reviews on https://github.com/esl/MongooseIM/pull/2713?