Do idna_to_ascii when building own response.

Fri, 28 Nov 2008 18:32:54 +0100

author
Tobias Markmann <tm@ayena.de>
date
Fri, 28 Nov 2008 18:32:54 +0100
changeset 472
ee45599c0b5d
parent 451
e9f269e5204e
child 473
22b0e654c4cf

Do idna_to_ascii when building own response.

util-src/Makefile file | annotate | diff | comparison | revisions
util/sasl.lua file | annotate | diff | comparison | revisions
--- a/util-src/Makefile	Fri Nov 28 00:08:23 2008 +0000
+++ b/util-src/Makefile	Fri Nov 28 18:32:54 2008 +0100
@@ -1,13 +1,13 @@
 
 
-LUA_INCLUDE=/usr/include/lua5.1
+LUA_INCLUDE=/usr/include/lua51
 LUA_LIB=lua5.1
 
 IDN_LIB=idn
 OPENSSL_LIB=ssl
 
-
 all: encodings.so hashes.so
+	
 
 install: encodings.so hashes.so
 	strip *.so
--- a/util/sasl.lua	Fri Nov 28 00:08:23 2008 +0000
+++ b/util/sasl.lua	Fri Nov 28 18:32:54 2008 +0100
@@ -11,6 +11,7 @@
 local type = type
 local error = error
 local print = print
+local idna_ascii = require "util.encodings".stringprep.saslprep.to_ascii
 
 module "sasl"
 
@@ -130,7 +131,7 @@
 			elseif Y == false then return "failure", "account-disabled" end
 			
 			local A1 = Y..":"..response["nonce"]..":"..response["cnonce"]--:authzid
-			local A2 = "AUTHENTICATE:"..protocol.."/"..domain
+			local A2 = "AUTHENTICATE:"..protocol.."/"..idna_ascii(domain)
 			
 			local HA1 = md5(A1, true)
 			local HA2 = md5(A2, true)
@@ -140,7 +141,7 @@
 			
 			if response_value == response["response"] then
 				-- calculate rspauth
-				A2 = ":"..protocol.."/"..domain
+				A2 = ":"..protocol.."/"..idna_ascii(domain)
 				
 				HA1 = md5(A1, true)
 				HA2 = md5(A2, true)

mercurial