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

Remove obsolete fast_tls #274

Merged
merged 7 commits into from
Jan 20, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Say the client does not support channel binding when not requested
  • Loading branch information
NelsonVides committed Jan 20, 2025
commit 4608a427d86f34073a080f67dfc3d6f5353337d5
16 changes: 9 additions & 7 deletions src/escalus_auth.erl
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
-type client() :: escalus_connection:client().
-type user_spec() :: escalus_users:user_spec().
-type hash_type() :: fast_scram:sha_type().
-type plus_variant() :: none | tls_unique.
-type plus_variant() :: undefined | none | tls_exporter.
-type scram_options() :: #{plus_variant := plus_variant(),
hash_type := hash_type(),
xmpp_method := binary()
Expand Down Expand Up @@ -66,27 +66,27 @@ auth_digest_md5(Conn, Props) ->
%% SCRAM Regular
-spec auth_sasl_scram_sha1(client(), user_spec()) -> ok.
auth_sasl_scram_sha1(Conn, Props) ->
Options = #{plus_variant => none, hash_type => sha, xmpp_method => <<"SCRAM-SHA-1">>},
Options = #{plus_variant => undefined, hash_type => sha, xmpp_method => <<"SCRAM-SHA-1">>},
auth_sasl_scram(Options, Conn, Props).

-spec auth_sasl_scram_sha224(client(), user_spec()) -> ok.
auth_sasl_scram_sha224(Conn, Props) ->
Options = #{plus_variant => none, hash_type => sha224, xmpp_method => <<"SCRAM-SHA-224">>},
Options = #{plus_variant => undefined, hash_type => sha224, xmpp_method => <<"SCRAM-SHA-224">>},
auth_sasl_scram(Options, Conn, Props).

-spec auth_sasl_scram_sha256(client(), user_spec()) -> ok.
auth_sasl_scram_sha256(Conn, Props) ->
Options = #{plus_variant => none, hash_type => sha256, xmpp_method => <<"SCRAM-SHA-256">>},
Options = #{plus_variant => undefined, hash_type => sha256, xmpp_method => <<"SCRAM-SHA-256">>},
auth_sasl_scram(Options, Conn, Props).

-spec auth_sasl_scram_sha384(client(), user_spec()) -> ok.
auth_sasl_scram_sha384(Conn, Props) ->
Options = #{plus_variant => none, hash_type => sha384, xmpp_method => <<"SCRAM-SHA-384">>},
Options = #{plus_variant => undefined, hash_type => sha384, xmpp_method => <<"SCRAM-SHA-384">>},
auth_sasl_scram(Options, Conn, Props).

-spec auth_sasl_scram_sha512(client(), user_spec()) -> ok.
auth_sasl_scram_sha512(Conn, Props) ->
Options = #{plus_variant => none, hash_type => sha512, xmpp_method => <<"SCRAM-SHA-512">>},
Options = #{plus_variant => undefined, hash_type => sha512, xmpp_method => <<"SCRAM-SHA-512">>},
auth_sasl_scram(Options, Conn, Props).

%% SCRAM PLUS
Expand Down Expand Up @@ -219,7 +219,9 @@ md5_digest_response(ChallengeData, Props) ->
{<<"authzid">>, FullJid}
])).

scram_sha_auth_payload(_, _) ->
scram_sha_auth_payload(undefined, _) ->
{undefined, <<>>};
scram_sha_auth_payload(none, _) ->
{none, <<>>}.

hex_md5(Data) ->
Expand Down