aboutsummaryrefslogtreecommitdiffstats
path: root/util/sasl.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2008-11-30 00:38:41 +0000
committerMatthew Wild <mwild1@gmail.com>2008-11-30 00:38:41 +0000
commit95fb20f64d563533c7981893896ce4023526ca68 (patch)
tree9f7c957394fae84ed24076dc2b414c9db86ba254 /util/sasl.lua
parentbf2042e1fa6b0228223223f71b73ea19611ceff1 (diff)
parentd69635ec56f968b78eab310f03d42276750f4058 (diff)
downloadprosody-95fb20f64d563533c7981893896ce4023526ca68.tar.gz
prosody-95fb20f64d563533c7981893896ce4023526ca68.zip
Merge with Tobias
Diffstat (limited to 'util/sasl.lua')
-rw-r--r--util/sasl.lua5
1 files changed, 3 insertions, 2 deletions
diff --git a/util/sasl.lua b/util/sasl.lua
index f1d01aed..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"
@@ -87,7 +88,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)
@@ -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