From 7ec231373fcb0fb4448053ad4ea0c8d656b2cc4e Mon Sep 17 00:00:00 2001 From: Waqas Hussain Date: Wed, 3 Dec 2008 22:08:49 +0500 Subject: Fix for handling latin1 encoded hostnames in SASL --- util/sasl.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'util/sasl.lua') diff --git a/util/sasl.lua b/util/sasl.lua index 7983a3c2..ab8b814b 100644 --- a/util/sasl.lua +++ b/util/sasl.lua @@ -144,6 +144,7 @@ local function new_digest_md5(realm, password_handler) if not response["qop"] then response["qop"] = "auth" end if response["realm"] == nil then response["realm"] = "" end + local raw_realm = response["realm"]; if response["charset"] == nil then response["username"] = latin1toutf8(response["username"]) @@ -163,7 +164,7 @@ local function new_digest_md5(realm, password_handler) --TODO maybe realm support self.username = response["username"] - local password_encoding, Y = self.password_handler(response["username"], response["realm"], "DIGEST-MD5") + local password_encoding, Y = self.password_handler(response["username"], response["realm"], "DIGEST-MD5", raw_realm) if Y == nil then return "failure", "not-authorized" elseif Y == false then return "failure", "account-disabled" end -- cgit v1.2.3