Comparison

util/sasl/scram.lua @ 10916:c7ed8f754033

Merge 0.11->trunk
author Kim Alvefur <zash@zash.se>
date Sat, 06 Jun 2020 00:54:28 +0200
parent 10774:207691ad98fe
parent 10912:646af16a3f32
child 11174:ddc17e9c66e4
comparison
equal deleted inserted replaced
10915:687273948ec7 10916:c7ed8f754033
103 return false, "inappropriate argument types" 103 return false, "inappropriate argument types"
104 end 104 end
105 if iteration_count < 4096 then 105 if iteration_count < 4096 then
106 log("warn", "Iteration count < 4096 which is the suggested minimum according to RFC 5802.") 106 log("warn", "Iteration count < 4096 which is the suggested minimum according to RFC 5802.")
107 end 107 end
108 password = saslprep(password);
109 if not password then
110 return false, "password fails SASLprep";
111 end
108 local salted_password = Hi(password, salt, iteration_count); 112 local salted_password = Hi(password, salt, iteration_count);
109 local stored_key = H(HMAC(salted_password, "Client Key")) 113 local stored_key = H(HMAC(salted_password, "Client Key"))
110 local server_key = HMAC(salted_password, "Server Key"); 114 local server_key = HMAC(salted_password, "Server Key");
111 return true, stored_key, server_key 115 return true, stored_key, server_key
112 end 116 end