Comparison

mod_s2s_auth_dane/mod_s2s_auth_dane.lua @ 4490:cf2bdb2aaa57

mod_s2s_auth_dane: Disable now redundant validation done in trunk Outgoing connections can now be validated natively in trunk since a38f9e09ca31 so we only need to check incoming connections.
author Kim Alvefur <zash@zash.se>
date Wed, 03 Mar 2021 11:43:38 +0100
parent 2869:77498ea07795
child 4491:35381608d323
comparison
equal deleted inserted replaced
4489:725768d83830 4490:cf2bdb2aaa57
229 module:add_timer(0, _resume, host_session); 229 module:add_timer(0, _resume, host_session);
230 end 230 end
231 end 231 end
232 end 232 end
233 233
234 local new_dane = module:get_option_boolean("use_dane", false);
235
234 function module.add_host(module) 236 function module.add_host(module)
235 local function on_new_s2s(event) 237 local function on_new_s2s(event)
236 local host_session = event.origin; 238 local host_session = event.origin;
237 if host_session.type == "s2sout" or host_session.type == "s2sin" then 239 if host_session.type == "s2sout" or host_session.type == "s2sin" then
238 return; -- Already authenticated 240 return; -- Already authenticated
242 end 244 end
243 dane_lookup(host_session, resume); 245 dane_lookup(host_session, resume);
244 -- Let it run in parallel until we need to check the cert 246 -- Let it run in parallel until we need to check the cert
245 end 247 end
246 248
247 -- New outgoing connections 249 if not new_dane then
248 module:hook("stanza/http://etherx.jabber.org/streams:features", on_new_s2s, 501); 250 -- New outgoing connections
249 module:hook("s2sout-authenticate-legacy", on_new_s2s, 200); 251 module:hook("stanza/http://etherx.jabber.org/streams:features", on_new_s2s, 501);
252 module:hook("s2sout-authenticate-legacy", on_new_s2s, 200);
253 end
250 254
251 -- New incoming connections 255 -- New incoming connections
252 module:hook("s2s-stream-features", on_new_s2s, 10); 256 module:hook("s2s-stream-features", on_new_s2s, 10);
253 257
254 module:hook("s2s-authenticated", function(event) 258 module:hook("s2s-authenticated", function(event)