util/sasl/scram.lua

changeset 3076
d19b2db64496
parent 3075
39a86b0d108b
child 3077
3ee311f21d54
equal deleted inserted replaced
3075:39a86b0d108b 3076:d19b2db64496
160 160
161 if not self.state.proof or not self.state.nonce or not self.state.channelbinding then 161 if not self.state.proof or not self.state.nonce or not self.state.channelbinding then
162 return "failure", "malformed-request", "Missing an attribute(p, r or c) in SASL message."; 162 return "failure", "malformed-request", "Missing an attribute(p, r or c) in SASL message.";
163 end 163 end
164 164
165 if self.state.nonce ~= self.state.servernonce then 165 if self.state.nonce ~= self.state.clientnonce..self.state.servernonce then
166 return "failure", "malformed-request", "Wrong nonce in client-second-message."; 166 return "failure", "malformed-request", "Wrong nonce in client-final-message.";
167 end 167 end
168 168
169 local SaltedPassword = self.state.salted_password; 169 local SaltedPassword = self.state.salted_password;
170 local ClientKey = HMAC_f(SaltedPassword, "Client Key") 170 local ClientKey = HMAC_f(SaltedPassword, "Client Key")
171 local ServerKey = HMAC_f(SaltedPassword, "Server Key") 171 local ServerKey = HMAC_f(SaltedPassword, "Server Key")

mercurial