util/sasl/scram.lua

changeset 2267
6e662e4f7ab2
parent 2265
7fe644057dc2
child 2268
0a675bb365a9
equal deleted inserted replaced
2265:7fe644057dc2 2267:6e662e4f7ab2
114 self.state["channelbinding"] = client_final_message:match("c=(.+),r="); 114 self.state["channelbinding"] = client_final_message:match("c=(.+),r=");
115 if not self.state.proof or not self.state.nonce or not self.state.channelbinding then 115 if not self.state.proof or not self.state.nonce or not self.state.channelbinding then
116 return "failure", "malformed-request", "Missing an attribute(p, r or c) in SASL message."; 116 return "failure", "malformed-request", "Missing an attribute(p, r or c) in SASL message.";
117 end 117 end
118 118
119 local password; 119 local password, state;
120 if self.profile.plain then 120 if self.profile.plain then
121 local password, state = self.profile.plain(self.state.name, self.realm) 121 password, state = self.profile.plain(self.state.name, self.realm)
122 if state == nil then return "failure", "not-authorized" 122 if state == nil then return "failure", "not-authorized"
123 elseif state == false then return "failure", "account-disabled" end 123 elseif state == false then return "failure", "account-disabled" end
124 password = saslprep(password); 124 password = saslprep(password);
125 if not password then 125 if not password then
126 log("debug", "Password violates SASLprep."); 126 log("debug", "Password violates SASLprep.");

mercurial