Software /
code /
prosody
Comparison
util/sasl.lua @ 50:56272224ca4c
Fix for using wrong auth token as username (fixes Gajim login)
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Sat, 04 Oct 2008 14:36:03 +0100 |
parent | 38:3fdfd6e0cb4e |
child | 276:30893439d5d1 |
comparison
equal
deleted
inserted
replaced
49:1cd2a8db392d | 50:56272224ca4c |
---|---|
17 if stanza.attr.xmlns ~= "urn:ietf:params:xml:ns:xmpp-sasl" then self.onFail("invalid-stanza-namespace") end | 17 if stanza.attr.xmlns ~= "urn:ietf:params:xml:ns:xmpp-sasl" then self.onFail("invalid-stanza-namespace") end |
18 local response = base64.decode(stanza[1]) | 18 local response = base64.decode(stanza[1]) |
19 local authorization = s_match(response, "([^&%z]+)") | 19 local authorization = s_match(response, "([^&%z]+)") |
20 local authentication = s_match(response, "%z([^&%z]+)%z") | 20 local authentication = s_match(response, "%z([^&%z]+)%z") |
21 local password = s_match(response, "%z[^&%z]+%z([^&%z]+)") | 21 local password = s_match(response, "%z[^&%z]+%z([^&%z]+)") |
22 if self.onAuth(authorization, password) == true then | 22 if self.onAuth(authentication, password) == true then |
23 self.onWrite(st.stanza("success", {xmlns = "urn:ietf:params:xml:ns:xmpp-sasl"})) | 23 self.onWrite(st.stanza("success", {xmlns = "urn:ietf:params:xml:ns:xmpp-sasl"})) |
24 self.onSuccess(authentication) | 24 self.onSuccess(authentication) |
25 else | 25 else |
26 self.onWrite(st.stanza("failure", {xmlns = "urn:ietf:params:xml:ns:xmpp-sasl"}):tag("temporary-auth-failure")); | 26 self.onWrite(st.stanza("failure", {xmlns = "urn:ietf:params:xml:ns:xmpp-sasl"}):tag("temporary-auth-failure")); |
27 end | 27 end |