changeset 1601:c5ca63ac0e1b

mod_tls_policy: Fix pattern matching
author Kim Alvefur <zash@zash.se>
date Fri, 30 Jan 2015 12:25:13 +0100
parents 1e90054c3ac5
children 3912a53fd4db
files mod_tls_policy/mod_tls_policy.lua
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mod_tls_policy/mod_tls_policy.lua	Fri Jan 30 12:12:06 2015 +0100
+++ b/mod_tls_policy/mod_tls_policy.lua	Fri Jan 30 12:25:13 2015 +0100
@@ -15,7 +15,7 @@
 			local info = origin.conn:socket():info();
 			for key, what in pairs(policy) do
 				module:log("debug", "Does info[%q] = %s match %s ?", key, tostring(info[key]), tostring(what));
-				if (type(what) == "number" and what < info[key] ) or (type(what) == "string" and not what:match(info[key])) then
+				if (type(what) == "number" and what < info[key] ) or (type(what) == "string" and not info[key]:match(what)) then
 					origin:close({ condition = "policy-violation", text = "Cipher not acceptable" });
 					return false;
 				end