Software /
code /
prosody
Comparison
util/sasl/scram.lua @ 3118:95ddd75ed3c5
util.sasl.scram: Fixing logic error in argument checking.
author | Tobias Markmann <tm@ayena.de> |
---|---|
date | Mon, 24 May 2010 17:44:13 +0200 |
parent | 3107:6d576a66ca63 |
child | 3119:c1ac08fa2533 |
child | 3122:579f17b9f948 |
comparison
equal
deleted
inserted
replaced
3115:4c35ef27d868 | 3118:95ddd75ed3c5 |
---|---|
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 |