Comparison

plugins/mod_s2s/mod_s2s.lua @ 5368:ab31dbb3a415

mod_s2s: Fix variable usage in check_auth_policy (thanks Florob)
author Matthew Wild <mwild1@gmail.com>
date Fri, 22 Mar 2013 15:16:22 +0000
parent 5365:cd480ea490f1
child 5387:1130887e0d41
comparison
equal deleted inserted replaced
5367:56db8f2c8563 5368:ab31dbb3a415
608 initialize_session(session); 608 initialize_session(session);
609 end 609 end
610 610
611 function check_auth_policy(event) 611 function check_auth_policy(event)
612 local host, session = event.host, event.session; 612 local host, session = event.host, event.session;
613 613 local must_secure = secure_auth;
614 if not secure_auth and secure_domains[host] then 614
615 secure_auth = true; 615 if not must_secure and secure_domains[host] then
616 elseif secure_auth and insecure_domains[host] then 616 must_secure = true;
617 secure_auth = false; 617 elseif must_secure and insecure_domains[host] then
618 end 618 must_secure = false;
619 619 end
620 if secure_auth and not session.cert_identity_status then 620
621 if must_secure and not session.cert_identity_status then
621 module:log("warn", "Forbidding insecure connection to/from %s", host); 622 module:log("warn", "Forbidding insecure connection to/from %s", host);
622 session:close(false); 623 session:close(false);
623 return false; 624 return false;
624 end 625 end
625 end 626 end