Comparison

util/sasl.lua @ 405:62706c4e04cf

Some ends too much.
author Tobias Markmann <tm@ayena.de>
date Sun, 23 Nov 2008 22:56:07 +0100
parent 404:4801dbeccc2a
child 449:c0a4a1e63d70
comparison
equal deleted inserted replaced
404:4801dbeccc2a 405:62706c4e04cf
26 26
27 if authentication == nil or password == nil then return "failure", "malformed-request" end 27 if authentication == nil or password == nil then return "failure", "malformed-request" end
28 28
29 local password_encoding, correct_password = self.password_handler(authentication, self.realm, "PLAIN") 29 local password_encoding, correct_password = self.password_handler(authentication, self.realm, "PLAIN")
30 30
31 if correct_password == nil then return "failure", "not-authorized" end 31 if correct_password == nil then return "failure", "not-authorized"
32 elseif correct_password == false then return "failure", "account-disabled" end 32 elseif correct_password == false then return "failure", "account-disabled" end
33 33
34 local claimed_password = "" 34 local claimed_password = ""
35 if password_encoding == nil then claimed_password = password 35 if password_encoding == nil then claimed_password = password
36 else claimed_password = password_encoding(password) end 36 else claimed_password = password_encoding(password) end
124 end 124 end
125 125
126 --TODO maybe realm support 126 --TODO maybe realm support
127 self.username = response["username"] 127 self.username = response["username"]
128 local password_encoding, Y = self.password_handler(response["username"], response["realm"], "DIGEST-MD5") 128 local password_encoding, Y = self.password_handler(response["username"], response["realm"], "DIGEST-MD5")
129 if Y == nil then return "failure", "not-authorized" end 129 if Y == nil then return "failure", "not-authorized"
130 elseif Y == false then return "failure", "account-disabled" end 130 elseif Y == false then return "failure", "account-disabled" end
131 131
132 local A1 = Y..":"..response["nonce"]..":"..response["cnonce"]--:authzid 132 local A1 = Y..":"..response["nonce"]..":"..response["cnonce"]--:authzid
133 local A2 = "AUTHENTICATE:"..protocol.."/"..domain 133 local A2 = "AUTHENTICATE:"..protocol.."/"..domain
134 134