equal
deleted
inserted
replaced
19 |
19 |
20 --========================= |
20 --========================= |
21 --SASL PLAIN according to RFC 4616 |
21 --SASL PLAIN according to RFC 4616 |
22 local function plain(self, message) |
22 local function plain(self, message) |
23 local response = message |
23 local response = message |
24 local authorization = s_match(response, "([^%z]+)") |
24 |
25 local authentication = s_match(response, "%z([^%z]+)%z") |
25 local authorization, authentication, password; |
26 local password = s_match(response, "%z[^%z]+%z([^%z]+)") |
26 if response then |
27 |
27 authorization = s_match(response, "([^%z]+)") |
|
28 authentication = s_match(response, "%z([^%z]+)%z") |
|
29 password = s_match(response, "%z[^%z]+%z([^%z]+)") |
|
30 end |
|
31 |
28 if authentication == nil or password == nil then |
32 if authentication == nil or password == nil then |
29 return "failure", "malformed-request"; |
33 return "failure", "malformed-request"; |
30 end |
34 end |
31 |
35 |
32 -- SASLprep password and authentication |
36 -- SASLprep password and authentication |