Comparison

util/sasl_cyrus.lua @ 3443:1159e007cc8f

util.sasl_cyrus: Make multi-step SASL mechanisms work correctly.
author Waqas Hussain <waqas20@gmail.com>
date Tue, 03 Aug 2010 18:20:29 +0500
parent 3441:d4f89802cf1e
child 3467:c9f4c3aa14a1
comparison
equal deleted inserted replaced
3442:8cfacc41099e 3443:1159e007cc8f
131 -- feed new messages to process into the library 131 -- feed new messages to process into the library
132 function method:process(message) 132 function method:process(message)
133 local err; 133 local err;
134 local data; 134 local data;
135 135
136 if self.mechanism then 136 if not self.first_step_done then
137 err, data = cyrussasl.server_start(self.cyrus, self.mechanism, message or "") 137 err, data = cyrussasl.server_start(self.cyrus, self.mechanism, message or "")
138 self.first_step_done = true;
138 else 139 else
139 err, data = cyrussasl.server_step(self.cyrus, message or "") 140 err, data = cyrussasl.server_step(self.cyrus, message or "")
140 end 141 end
141 142
142 self.username = cyrussasl.get_username(self.cyrus) 143 self.username = cyrussasl.get_username(self.cyrus)