Changeset

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
parents 5367:56db8f2c8563
children 5369:a344c1120e2b 5370:7838acadb0fa
files plugins/mod_s2s/mod_s2s.lua
diffstat 1 files changed, 7 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/mod_s2s/mod_s2s.lua	Fri Mar 22 14:50:43 2013 +0000
+++ b/plugins/mod_s2s/mod_s2s.lua	Fri Mar 22 15:16:22 2013 +0000
@@ -610,14 +610,15 @@
 
 function check_auth_policy(event)
 	local host, session = event.host, event.session;
-	
-	if not secure_auth and secure_domains[host] then
-		secure_auth = true;
-	elseif secure_auth and insecure_domains[host] then
-		secure_auth = false;
+	local must_secure = secure_auth;
+
+	if not must_secure and secure_domains[host] then
+		must_secure = true;
+	elseif must_secure and insecure_domains[host] then
+		must_secure = false;
 	end
 	
-	if secure_auth and not session.cert_identity_status then
+	if must_secure and not session.cert_identity_status then
 		module:log("warn", "Forbidding insecure connection to/from %s", host);
 		session:close(false);
 		return false;