92 return username; |
92 return username; |
93 end |
93 end |
94 |
94 |
95 function saltedPasswordSHA1(password, salt, iteration_count) |
95 function saltedPasswordSHA1(password, salt, iteration_count) |
96 local salted_password |
96 local salted_password |
97 if type(password) ~= "string" and type(salt) ~= "string" and type(iteration_count) ~= "number" then |
97 if type(password) ~= "string" or type(salt) ~= "string" or type(iteration_count) ~= "number" then |
98 return false, "inappropriate argument types" |
98 return false, "inappropriate argument types" |
99 end |
99 end |
100 if iteration_count < 4096 then |
100 if iteration_count < 4096 then |
101 log("warning", "Iteration count < 4096 which is the suggested minimum according to RFC 5802.") |
101 log("warning", "Iteration count < 4096 which is the suggested minimum according to RFC 5802.") |
102 end |
102 end |