aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2008-11-28 18:32:54 +0100
committerTobias Markmann <tm@ayena.de>2008-11-28 18:32:54 +0100
commit8e2b0deb94ea52b49404d5b9277061101bd03cff (patch)
tree3cca1565eb815048349a6c7c8a17fdbe519ee304
parent77c094c25a133609d7b30b748d62f4e9a78775b5 (diff)
downloadprosody-8e2b0deb94ea52b49404d5b9277061101bd03cff.tar.gz
prosody-8e2b0deb94ea52b49404d5b9277061101bd03cff.zip
Do idna_to_ascii when building own response.
-rw-r--r--util-src/Makefile4
-rw-r--r--util/sasl.lua5
2 files changed, 5 insertions, 4 deletions
diff --git a/util-src/Makefile b/util-src/Makefile
index a4901c95..035ec286 100644
--- a/util-src/Makefile
+++ b/util-src/Makefile
@@ -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
diff --git a/util/sasl.lua b/util/sasl.lua
index 001f40fb..f10fb934 100644
--- a/util/sasl.lua
+++ b/util/sasl.lua
@@ -11,6 +11,7 @@ local math = require "math"
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 @@ local function new_digest_md5(realm, password_handler)
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 @@ local function new_digest_md5(realm, password_handler)
if response_value == response["response"] then
-- calculate rspauth
- A2 = ":"..protocol.."/"..domain
+ A2 = ":"..protocol.."/"..idna_ascii(domain)
HA1 = md5(A1, true)
HA2 = md5(A2, true)