aboutsummaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2009-11-19 17:17:52 +0100
committerTobias Markmann <tm@ayena.de>2009-11-19 17:17:52 +0100
commitb32b0e118daa6a32b464bf21e7c091041eec0dbb (patch)
tree5d5432f6b399adf0641bc3ef1577040a949968b8 /util
parent547b733736f76dac6fce0757ec73742377f5f99b (diff)
downloadprosody-b32b0e118daa6a32b464bf21e7c091041eec0dbb.tar.gz
prosody-b32b0e118daa6a32b464bf21e7c091041eec0dbb.zip
Adding some human readable error messages.
Diffstat (limited to 'util')
-rw-r--r--util/sasl/plain.lua4
-rw-r--r--util/sasl/scram.lua6
2 files changed, 5 insertions, 5 deletions
diff --git a/util/sasl/plain.lua b/util/sasl/plain.lua
index 5c7ff68a..46a86bb9 100644
--- a/util/sasl/plain.lua
+++ b/util/sasl/plain.lua
@@ -35,7 +35,7 @@ local function plain(self, message)
if (not password) or (password == "") or (not authentication) or (authentication == "") then
log("debug", "Username or password violates SASLprep.");
- return "failure", "malformed-request";
+ return "failure", "malformed-request", "Invalid username or password.";
end
local correct, state = false, false;
@@ -55,7 +55,7 @@ local function plain(self, message)
if correct then
return "success";
else
- return "failure", "not-authorized";
+ return "failure", "not-authorized", "Unable to authorize you with the authentication credentials you've sent.";
end
end
diff --git a/util/sasl/scram.lua b/util/sasl/scram.lua
index f7b8300a..4413e2a6 100644
--- a/util/sasl/scram.lua
+++ b/util/sasl/scram.lua
@@ -95,7 +95,7 @@ local function scram_sha_1(self, message)
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 @@ local function scram_sha_1(self, message)
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 @@ local function scram_sha_1(self, message)
password = saslprep(password);
if not password then
log("debug", "Password violates SASLprep.");
- return "failure", "not-authorized"
+ return "failure", "not-authorized", "Invalid password."
end
end