comparison mod_s2s_auth_dane/mod_s2s_auth_dane.lua @ 1409:151aa00559d1

mod_s2s_auth_dane: Fix logic precedence issue
author Kim Alvefur <zash@zash.se>
date Wed, 07 May 2014 17:07:10 +0200
parents cf4e39334ef7
children f4e497a53c6e
comparison
equal deleted inserted replaced
1408:ed2a9c00b5c4 1409:151aa00559d1
82 elseif host_session.direction == "outgoing" then 82 elseif host_session.direction == "outgoing" then
83 local srv_hosts = host_session.srv_hosts; 83 local srv_hosts = host_session.srv_hosts;
84 if not ( srv_hosts and srv_hosts.answer and srv_hosts.answer.secure ) then return end 84 if not ( srv_hosts and srv_hosts.answer and srv_hosts.answer.secure ) then return end
85 local srv_choice = srv_hosts[host_session.srv_choice]; 85 local srv_choice = srv_hosts[host_session.srv_choice];
86 host_session.dane = dns_lookup(function(answer) 86 host_session.dane = dns_lookup(function(answer)
87 if answer and (answer.secure and #answer > 0) or answer.bogus then 87 if answer and ((answer.secure and #answer > 0) or answer.bogus) then
88 srv_choice.dane = answer; 88 srv_choice.dane = answer;
89 else 89 else
90 srv_choice.dane = false; 90 srv_choice.dane = false;
91 end 91 end
92 host_session.dane = srv_choice.dane; 92 host_session.dane = srv_choice.dane;