]> granicus.if.org Git - ejabberd/commitdiff
Generate shorted jid for anonymous connections
authorPaweł Chmielowski <pchmielowski@process-one.net>
Thu, 7 Apr 2016 14:47:30 +0000 (16:47 +0200)
committerPaweł Chmielowski <pchmielowski@process-one.net>
Thu, 7 Apr 2016 14:47:30 +0000 (16:47 +0200)
src/cyrsasl_anonymous.erl

index 6aea278cc6090469d35d5b9b683e502710a09b1d..802e1cd7b81c161499dd5548afb0082bb0612286 100644 (file)
@@ -45,8 +45,7 @@ mech_new(Host, _GetPassword, _CheckPassword, _CheckPasswordDigest) ->
 
 mech_step(#state{server = Server} = S, ClientIn) ->
     User = iolist_to_binary([randoms:get_string(),
-                             randoms:get_string(),
-                             randoms:get_string()]),
+                             jlib:integer_to_binary(p1_time_compat:unique_integer([positive]))]),
     case ejabberd_auth:is_user_exists(User, Server) of
         true  -> mech_step(S, ClientIn);
         false -> {ok, [{username, User}, {authzid, User}, {auth_module, ejabberd_auth_anonymous}]}