Browse Source

Support bcrypt

turtled 9 years atrás
parent
commit
ca676880a8
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/emqttd_auth_mod.erl

+ 1 - 1
src/emqttd_auth_mod.erl

@@ -66,7 +66,7 @@ passwd_hash(pbkdf2,{Salt, Password, Macfun, Iterations, Dklen}) ->
         {error, Error} -> lager:error("PasswdHash with pbkdf2 error:~p", [Error]), error
     end;
 passwd_hash(bcrypt, {Salt, Password}) ->
-    case bcrypt:hashpw(Salt, Password) of
+    case bcrypt:hashpw(Password, Salt) of
         {ok, HashPassword} -> list_to_binary(HashPassword);
         {error, Error}-> lager:error("PasswdHash with bcrypt error:~p", [Error]), error
     end.