aboutsummaryrefslogtreecommitdiff
path: root/src/cyrsasl.erl
diff options
context:
space:
mode:
Diffstat (limited to 'src/cyrsasl.erl')
-rw-r--r--src/cyrsasl.erl13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/cyrsasl.erl b/src/cyrsasl.erl
index feb190afc..9376b25d2 100644
--- a/src/cyrsasl.erl
+++ b/src/cyrsasl.erl
@@ -64,6 +64,17 @@ check_authzid(State, Props) ->
end
end.
+check_credentials(State, Props) ->
+ User = xml:get_attr_s(username, Props),
+ case jlib:nodeprep(User) of
+ error ->
+ {error, "not-authorized"};
+ "" ->
+ {error, "not-authorized"};
+ LUser ->
+ ok
+ end.
+
listmech() ->
ets:select(sasl_mechanism,
[{#sasl_mechanism{mechanism = '$1', _ = '_'}, [], ['$1']}]).
@@ -90,7 +101,7 @@ server_step(State, ClientIn) ->
MechState = State#sasl_state.mech_state,
case Module:mech_step(MechState, ClientIn) of
{ok, Props} ->
- case check_authzid(State, Props) of
+ case check_credentials(State, Props) of
ok ->
{ok, Props};
{error, Error} ->