Software /
code /
prosody-modules
Comparison
mod_tls_policy/mod_tls_policy.lua @ 1601:c5ca63ac0e1b
mod_tls_policy: Fix pattern matching
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Fri, 30 Jan 2015 12:25:13 +0100 |
parent | 1600:1e90054c3ac5 |
child | 1615:d0fd8a29b724 |
comparison
equal
deleted
inserted
replaced
1600:1e90054c3ac5 | 1601:c5ca63ac0e1b |
---|---|
13 local origin = event.origin; | 13 local origin = event.origin; |
14 if origin.encrypted then | 14 if origin.encrypted then |
15 local info = origin.conn:socket():info(); | 15 local info = origin.conn:socket():info(); |
16 for key, what in pairs(policy) do | 16 for key, what in pairs(policy) do |
17 module:log("debug", "Does info[%q] = %s match %s ?", key, tostring(info[key]), tostring(what)); | 17 module:log("debug", "Does info[%q] = %s match %s ?", key, tostring(info[key]), tostring(what)); |
18 if (type(what) == "number" and what < info[key] ) or (type(what) == "string" and not what:match(info[key])) then | 18 if (type(what) == "number" and what < info[key] ) or (type(what) == "string" and not info[key]:match(what)) then |
19 origin:close({ condition = "policy-violation", text = "Cipher not acceptable" }); | 19 origin:close({ condition = "policy-violation", text = "Cipher not acceptable" }); |
20 return false; | 20 return false; |
21 end | 21 end |
22 module:log("debug", "Seems so"); | 22 module:log("debug", "Seems so"); |
23 end | 23 end |