Changeset

1723:2145daff1a65

Allow ampersands in passwords for SASL PLAIN mechanism and fixing a typo.
author Tobias Markmann <tm@ayena.de>
date Wed, 19 Aug 2009 22:16:27 +0200 (2009-08-19)
parents 1722:132c41aa0680
children 1724:7682a34c13d0
files util/sasl.lua
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/util/sasl.lua	Wed Aug 19 22:04:14 2009 +0200
+++ b/util/sasl.lua	Wed Aug 19 22:16:27 2009 +0200
@@ -20,7 +20,7 @@
 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 saslprep = require "utii.encodings".stringprep.saslprep;
+local saslprep = require "util.encodings".stringprep.saslprep;
 local s_match = string.match;
 local gmatch = string.gmatch
 local string = string
@@ -37,9 +37,9 @@
 	
 		if message == "" or message == nil then return "failure", "malformed-request" end
 		local response = message
-		local authorization = s_match(response, "([^&%z]+)")
-		local authentication = s_match(response, "%z([^&%z]+)%z")
-		local password = s_match(response, "%z[^&%z]+%z([^&%z]+)")
+		local authorization = s_match(response, "([^%z]+)")
+		local authentication = s_match(response, "%z([^%z]+)%z")
+		local password = s_match(response, "%z[^%z]+%z([^%z]+)")
 		authorization, authentication, password = saslprep(authorization), saslprep(authentication), saslprep(password);
 		
 		if authentication == nil or password == nil then return "failure", "malformed-request" end