diff options
author | Tobias Markmann <tm@ayena.de> | 2009-08-19 22:16:27 +0200 |
---|---|---|
committer | Tobias Markmann <tm@ayena.de> | 2009-08-19 22:16:27 +0200 |
commit | c03e9b5ddc206873cecacb17b9b21274273523f0 (patch) | |
tree | f57706e101d8934e4a2def67340225b602df54ee /util/sasl.lua | |
parent | 38bc2857bd5100a02ccfa7ed2d91f46585f73012 (diff) | |
download | prosody-c03e9b5ddc206873cecacb17b9b21274273523f0.tar.gz prosody-c03e9b5ddc206873cecacb17b9b21274273523f0.zip |
Allow ampersands in passwords for SASL PLAIN mechanism and fixing a typo.
Diffstat (limited to 'util/sasl.lua')
-rw-r--r-- | util/sasl.lua | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/util/sasl.lua b/util/sasl.lua index 6305d414..7ced9f8a 100644 --- a/util/sasl.lua +++ b/util/sasl.lua @@ -20,7 +20,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 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 @@ local function new_plain(realm, password_handler) 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 |