201 local password_encoding, Y = self.credentials_handler("DIGEST-MD5", response["username"], self.realm, response["realm"], decoder); |
201 local password_encoding, Y = self.credentials_handler("DIGEST-MD5", response["username"], self.realm, response["realm"], decoder); |
202 if Y == nil then return "failure", "not-authorized" |
202 if Y == nil then return "failure", "not-authorized" |
203 elseif Y == false then return "failure", "account-disabled" end |
203 elseif Y == false then return "failure", "account-disabled" end |
204 local A1 = ""; |
204 local A1 = ""; |
205 if response.authzid then |
205 if response.authzid then |
206 if response.authzid == self.username.."@"..self.realm then |
206 if response.authzid == self.username or response.authzid == self.username.."@"..self.realm then |
207 -- COMPAT |
207 -- COMPAT |
208 log("warn", "Client is violating XMPP RFC. See section 6.1 of RFC 3920."); |
208 log("warn", "Client is violating XMPP RFC. See section 6.1 of RFC 3920."); |
209 A1 = Y..":"..response["nonce"]..":"..response["cnonce"]..":"..response.authzid; |
209 A1 = Y..":"..response["nonce"]..":"..response["cnonce"]..":"..response.authzid; |
210 else |
210 else |
211 return "failure", "invalid-authzid"; |
211 return "failure", "invalid-authzid"; |