Move to-unicode conversion from mod_saslauth.lua to sasl.lua.

Sun, 05 Jul 2009 19:02:55 +0200

author
Tobias Markmann <tm@ayena.de>
date
Sun, 05 Jul 2009 19:02:55 +0200
changeset 1485
fbefd16d2955
parent 1484
80e4f1d731c2
child 1486
3e04efa8af7e

Move to-unicode conversion from mod_saslauth.lua to sasl.lua.

util/sasl.lua file | annotate | diff | comparison | revisions
--- a/util/sasl.lua	Sun Jul 05 18:59:46 2009 +0200
+++ b/util/sasl.lua	Sun Jul 05 19:02:55 2009 +0200
@@ -19,6 +19,7 @@
 local generate_uuid = require "util.uuid".generate;
 local t_insert, t_concat = table.insert, table.concat;
 local to_byte, to_char = string.byte, string.char;
+local to_unicode = require "util.encodings".idna.to_unicode;
 local s_match = string.match;
 local gmatch = string.gmatch
 local string = string
@@ -199,7 +200,7 @@
 			
 			--TODO maybe realm support
 			self.username = response["username"];
-			local password_encoding, Y = self.password_handler(response["username"], domain, response["realm"], "DIGEST-MD5", decoder);
+			local password_encoding, Y = self.password_handler(response["username"], to_unicode(domain), response["realm"], "DIGEST-MD5", decoder);
 			if Y == nil then return "failure", "not-authorized"
 			elseif Y == false then return "failure", "account-disabled" end
 			local A1 = "";

mercurial