From 9535a107ffbfb3c296304230e821ad74d7db1579 Mon Sep 17 00:00:00 2001 From: Tobias Markmann Date: Sun, 30 Nov 2008 00:44:23 +0100 Subject: Do idna-to-ascii to the realm we send first in Digest-MD5. --- util/sasl.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/sasl.lua b/util/sasl.lua index f1d01aed..b549b7c8 100644 --- a/util/sasl.lua +++ b/util/sasl.lua @@ -87,7 +87,7 @@ local function new_digest_md5(realm, password_handler) qop = "auth", charset = "utf-8", algorithm = "md5-sess", - realm = self.realm}); + realm = idna_ascii(self.realm)}); return "challenge", challenge elseif (self.step == 2) then local response = parse(message) -- cgit v1.2.3 From d69635ec56f968b78eab310f03d42276750f4058 Mon Sep 17 00:00:00 2001 From: Tobias Markmann Date: Sun, 30 Nov 2008 01:35:40 +0100 Subject: idna-to-unicode so password_handler looks for the right domain. --- util/sasl.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/util/sasl.lua b/util/sasl.lua index b549b7c8..fa818b9a 100644 --- a/util/sasl.lua +++ b/util/sasl.lua @@ -12,6 +12,7 @@ local type = type local error = error local print = print local idna_ascii = require "util.encodings".idna.to_ascii +local idna_unicode = require "util.encodings".idna.to_unicode module "sasl" @@ -126,7 +127,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"], idna_unicode(response["realm"]), "DIGEST-MD5") if Y == nil then return "failure", "not-authorized" elseif Y == false then return "failure", "account-disabled" end -- cgit v1.2.3