aboutsummaryrefslogtreecommitdiffstats
path: root/util/sasl.lua
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2008-11-30 17:34:47 +0100
committerTobias Markmann <tm@ayena.de>2008-11-30 17:34:47 +0100
commit93aceeb147b71ce7a52f90acd2f3c569b004a483 (patch)
tree01ccb798cae4f3cb6891d94845feabbb57dde760 /util/sasl.lua
parente18e2e4b2dd9febe59224ea9a58e0ee1cbbbb80b (diff)
downloadprosody-93aceeb147b71ce7a52f90acd2f3c569b004a483.tar.gz
prosody-93aceeb147b71ce7a52f90acd2f3c569b004a483.zip
Converting latin encoded responsed to utf-8 when needed.
Diffstat (limited to 'util/sasl.lua')
-rw-r--r--util/sasl.lua7
1 files changed, 7 insertions, 0 deletions
diff --git a/util/sasl.lua b/util/sasl.lua
index 43340105..76ddc263 100644
--- a/util/sasl.lua
+++ b/util/sasl.lua
@@ -132,6 +132,13 @@ local function new_digest_md5(realm, password_handler)
if response["realm"] == nil then response["realm"] = "" end
+ if response["charset"] == nil then
+ response["username"] = latin1toutf8(response["username"])
+ response["realm"] = latin1toutf8(response["realm"])
+ elseif response["charset"] ~= "utf-8" then
+ return "failure", "incorrect-encoding", "The client's response uses "..response["charset"].." for encoding with isn't supported by sasl.lua. Supported encodings are latin or utf-8."
+ end
+
local domain = ""
local protocol = ""
if response["digest-uri"] then