Comparison

plugins/mod_saslauth.lua @ 6014:d61026bee038

mod_saslauth: Make sure sasl handler has add_cb_handler (fixes #392)
author Kim Alvefur <zash@zash.se>
date Wed, 12 Feb 2014 19:25:15 +0100
parent 5860:87e2fafba5df
child 6038:b3ceb7627e27
comparison
equal deleted inserted replaced
6013:918ab89cb68d 6014:d61026bee038
243 end 243 end
244 origin.sasl_handler = usermanager_get_sasl_handler(module.host, origin); 244 origin.sasl_handler = usermanager_get_sasl_handler(module.host, origin);
245 if origin.encrypted then 245 if origin.encrypted then
246 -- check wether LuaSec has the nifty binding to the function needed for tls-unique 246 -- check wether LuaSec has the nifty binding to the function needed for tls-unique
247 -- FIXME: would be nice to have this check only once and not for every socket 247 -- FIXME: would be nice to have this check only once and not for every socket
248 if origin.conn:socket().getpeerfinished then 248 if origin.conn:socket().getpeerfinished and origin.sasl_handler.add_cb_handler then
249 origin.sasl_handler:add_cb_handler("tls-unique", function(self) 249 origin.sasl_handler:add_cb_handler("tls-unique", function(self)
250 return self.userdata:getpeerfinished(); 250 return self.userdata:getpeerfinished();
251 end); 251 end);
252 origin.sasl_handler["userdata"] = origin.conn:socket(); 252 origin.sasl_handler["userdata"] = origin.conn:socket();
253 end 253 end