From 93aceeb147b71ce7a52f90acd2f3c569b004a483 Mon Sep 17 00:00:00 2001 From: Tobias Markmann Date: Sun, 30 Nov 2008 17:34:47 +0100 Subject: Converting latin encoded responsed to utf-8 when needed. --- util/sasl.lua | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'util/sasl.lua') 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 -- cgit v1.2.3