X-Git-Url: https://git.enpas.org/?a=blobdiff_plain;f=util%2Fsslconfig.lua;h=71f27c9460f6548ab816e843d8012ddef25425c1;hb=a8958cbe5ebad3abc12efa7a76c8aedac8f21389;hp=98e61341f53c9ad708d08043b6139d6d90593eb1;hpb=82edcefcb3e5613fc6e9088926863db36bd3955b;p=prosody.git diff --git a/util/sslconfig.lua b/util/sslconfig.lua index 98e61341..71f27c94 100644 --- a/util/sslconfig.lua +++ b/util/sslconfig.lua @@ -1,3 +1,11 @@ +local type = type; +local pairs = pairs; +local rawset = rawset; +local t_concat = table.concat; +local t_insert = table.insert; +local setmetatable = setmetatable; + +local _ENV = nil; local handlers = { }; local finalisers = { }; @@ -6,11 +14,11 @@ local id = function (v) return v end function handlers.options(a, k, b) local o = a[k] or { }; if type(b) ~= "table" then b = { b } end - for k,v in pairs(b) do - if v == true or v == false then - o[k] = v; + for key, value in pairs(b) do + if value == true or value == false then + o[key] = value; else - o[v] = true; + o[value] = true; end end a[k] = o; @@ -34,7 +42,7 @@ finalisers.verifyext = finalisers.options; function finalisers.ciphers(a) if type(a) == "table" then - return table.concat(a, ":"); + return t_concat(a, ":"); end return a; end @@ -47,7 +55,7 @@ local function protocol(a) if min_protocol then a.protocol = "sslv23"; for i = 1, min_protocol do - table.insert(a.options, "no_"..protocols[i]); + t_insert(a.options, "no_"..protocols[i]); end end end