util/sasl/scram.lua

changeset 2206
78c9b5255b27
parent 2202
5f54100bb426
child 2255
92e329e1cd99
--- a/util/sasl/scram.lua	Thu Nov 19 17:08:58 2009 +0100
+++ b/util/sasl/scram.lua	Thu Nov 19 17:17:52 2009 +0100
@@ -95,7 +95,7 @@
 		self.state.name = validate_username(self.state.name);
 		if not self.state.name then
 			log("debug", "Username violates either SASLprep or contains forbidden character sequences.")
-			return "failure", "malformed-request";
+			return "failure", "malformed-request", "Invalid username.";
 		end
 		
 		self.state["servernonce"] = generate_uuid();
@@ -113,7 +113,7 @@
 		self.state["nonce"] = client_final_message:match("r=(.+),p=");
 		self.state["channelbinding"] = client_final_message:match("c=(.+),r=");
 		if not self.state.proof or not self.state.nonce or not self.state.channelbinding then
-			return "failure", "malformed-request";
+			return "failure", "malformed-request", "Missing an attribute(p, r or c) in SASL message.";
 		end
 		
 		local password;
@@ -124,7 +124,7 @@
 			password = saslprep(password);
 			if not password then
 				log("debug", "Password violates SASLprep.");
-				return "failure", "not-authorized"
+				return "failure", "not-authorized", "Invalid password."
 			end
 		end
 		

mercurial