diff options
author | Tobias Markmann <tm@ayena.de> | 2008-11-30 17:34:47 +0100 |
---|---|---|
committer | Tobias Markmann <tm@ayena.de> | 2008-11-30 17:34:47 +0100 |
commit | 93aceeb147b71ce7a52f90acd2f3c569b004a483 (patch) | |
tree | 01ccb798cae4f3cb6891d94845feabbb57dde760 /util | |
parent | e18e2e4b2dd9febe59224ea9a58e0ee1cbbbb80b (diff) | |
download | prosody-93aceeb147b71ce7a52f90acd2f3c569b004a483.tar.gz prosody-93aceeb147b71ce7a52f90acd2f3c569b004a483.zip |
Converting latin encoded responsed to utf-8 when needed.
Diffstat (limited to 'util')
-rw-r--r-- | util/sasl.lua | 7 |
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 |