# HG changeset patch # User Matthew Wild # Date 1227971699 0 # Node ID a5d48260c19195a3b3aaded27752da5711cc3e70 # Parent 727d7bd97cd27760657ca38df9a42b6e8cbc5ab2# Parent 4744735a0a5e640b72fc88f01aa26763f08ee1c6 Merfe from Tobias diff -r 727d7bd97cd2 -r a5d48260c191 util-src/Makefile diff -r 727d7bd97cd2 -r a5d48260c191 util-src/encodings.c --- a/util-src/encodings.c Sat Nov 29 15:13:30 2008 +0000 +++ b/util-src/encodings.c Sat Nov 29 15:14:59 2008 +0000 @@ -7,19 +7,17 @@ #define _CRT_SECURE_NO_DEPRECATE #include -#include +#include #include "lua.h" #include "lauxlib.h" /***************** BASE64 *****************/ -#define uint unsigned int - static const char code[]= "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; -static void base64_encode(luaL_Buffer *b, uint c1, uint c2, uint c3, int n) +static void base64_encode(luaL_Buffer *b, unsigned int c1, unsigned int c2, unsigned int c3, int n) { unsigned long tuple=c3+256UL*(c2+256UL*c1); int i; diff -r 727d7bd97cd2 -r a5d48260c191 util/sasl.lua --- a/util/sasl.lua Sat Nov 29 15:13:30 2008 +0000 +++ b/util/sasl.lua Sat Nov 29 15:14:59 2008 +0000 @@ -11,6 +11,7 @@ local type = type local error = error local print = print +local idna_ascii = require "util.encodings".idna.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)