comparison mod_s2s_auth_dane/mod_s2s_auth_dane.lua @ 1336:ae0558230e3d

mod_s2s_auth_dane: Do DANE lookups on outgoing stream features
author Kim Alvefur <zash@zash.se>
date Sun, 09 Mar 2014 13:44:29 +0100
parents faf4bd226cad
children c38f163f18b9
comparison
equal deleted inserted replaced
1335:faf4bd226cad 1336:ae0558230e3d
126 end 126 end
127 end); 127 end);
128 128
129 -- DANE for s2sin 129 -- DANE for s2sin
130 -- Looks for TLSA at the same QNAME as the SRV record 130 -- Looks for TLSA at the same QNAME as the SRV record
131 module:hook("stanza/urn:ietf:params:xml:ns:xmpp-tls:starttls", function(event) 131 module:hook("s2s-stream-features", function(event)
132 local origin = event.origin; 132 local origin = event.origin;
133 if not origin.from_host then return end 133 if not origin.from_host or origin.dane == nil then return end
134 134
135 origin.dane = dns_lookup(function(answer) 135 origin.dane = dns_lookup(function(answer)
136 if answer and ( #answer > 0 or answer.bogus ) then 136 if answer and ( #answer > 0 or answer.bogus ) then
137 origin.dane = answer; 137 origin.dane = answer;
138 else 138 else