Skip to content

Commit

Permalink
Don't account for fast mechanisms when caclulating ssdp hash
Browse files Browse the repository at this point in the history
  • Loading branch information
prefiks committed Dec 21, 2024
1 parent aee58ea commit 9a56de6
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/xmpp_stream_in.erl
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@
-callback check_password_fun(xmpp_sasl:mechanism(), state()) -> fun().
-callback check_password_digest_fun(xmpp_sasl:mechanism(), state()) -> fun().
-callback get_fast_tokens_fun(xmpp_sasl:mechanism(), state()) -> fun().
-callback fast_mechanisms(state()) -> [xmpp_sasl:mechanism()].
-callback bind(binary(), state()) -> {ok, state()} | {error, stanza_error(), state()}.
-callback compress_methods(state()) -> [binary()].
-callback tls_options(state()) -> [proplists:property()].
Expand Down Expand Up @@ -141,6 +142,7 @@
check_password_fun/2,
check_password_digest_fun/2,
get_fast_tokens_fun/2,
fast_mechanisms/1,
bind/2,
compress_methods/1,
tls_options/1,
Expand Down Expand Up @@ -1071,7 +1073,8 @@ process_sasl2_request(#sasl2_authenticate{mechanism = Mech, initial_response = C
FastMechs = try callback(fast_mechanisms, State)
catch _:{?MODULE, undef} -> []
end,
Mechs = get_sasl_mechanisms(State1) ++ FastMechs,
Mechs = get_sasl_mechanisms(State1),
MechsAll = Mechs ++ FastMechs,
UAId = case UA of
#sasl2_user_agent{id = ID} when ID /= <<>> ->
ID;
Expand All @@ -1082,7 +1085,7 @@ process_sasl2_request(#sasl2_authenticate{mechanism = Mech, initial_response = C
#sasl2_authenticate{sub_els = SubEls} -> SubEls
catch _:{xmpp_codec, _} -> []
end,
case lists:member(Mech, Mechs) of
case lists:member(Mech, MechsAll) of
true when Mech == <<"EXTERNAL">> ->
Res = case xmpp_stream_pkix:authenticate(State1, ClientIn) of
{ok, Peer} ->
Expand Down

0 comments on commit 9a56de6

Please sign in to comment.