Software /
code /
prosody
Comparison
util/sasl/scram.lua @ 3155:c713fa2ba80c
SASL: Minor cleanup.
author | Waqas Hussain <waqas20@gmail.com> |
---|---|
date | Thu, 03 Jun 2010 17:48:50 +0500 |
parent | 3154:104f05235cef |
child | 3196:d35b181a895a |
comparison
equal
deleted
inserted
replaced
3154:104f05235cef | 3155:c713fa2ba80c |
---|---|
91 -- apply SASLprep | 91 -- apply SASLprep |
92 username = saslprep(username); | 92 username = saslprep(username); |
93 return username; | 93 return username; |
94 end | 94 end |
95 | 95 |
96 local function hashprep( hashname ) | 96 local function hashprep(hashname) |
97 local hash = hashname:lower() | 97 return hashname:lower():gsub("-", "_"); |
98 hash = hash:gsub("-", "_") | |
99 return hash | |
100 end | 98 end |
101 | 99 |
102 function saltedPasswordSHA1(password, salt, iteration_count) | 100 function saltedPasswordSHA1(password, salt, iteration_count) |
103 local salted_password | 101 local salted_password |
104 if type(password) ~= "string" or type(salt) ~= "string" or type(iteration_count) ~= "number" then | 102 if type(password) ~= "string" or type(salt) ~= "string" or type(iteration_count) ~= "number" then |