Mercurial > prosody-hg
comparison util/sasl/scram.lua @ 3117:f4e7ca2aa2f7
util.sasl.scram: Fixing logic error in argument checking.
| author | Tobias Markmann <tm@ayena.de> |
|---|---|
| date | Mon, 24 May 2010 17:44:13 +0200 |
| parents | 90a98a6b52ac |
| children | c1ac08fa2533 6f1b7260925c |
comparison
equal
deleted
inserted
replaced
| 3116:90a98a6b52ac | 3117:f4e7ca2aa2f7 |
|---|---|
| 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 |
