aboutsummaryrefslogtreecommitdiffstats
path: root/src/openssl.ssl.lua
blob: bf90f298af66f01f4062f513a7de90b391e264bb (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
local ssl = require"_openssl.ssl"

local pack = table.pack or function(...) return { n = select("#", ...); ... } end

-- Allow passing a vararg of curves, or an array
local setCurvesList = ssl.interpose("setCurvesList", nil)
if setCurvesList then
	ssl.interpose("setCurvesList", function (self, curves, ...)
		if (...) then
			local curves_t = pack(curves, ...)
			curves = table.concat(curves_t, ":", 1, curves_t.n)
		elseif type(curves) == "table" then
			curves = table.concat(curves, ":")
		end
		return setCurvesList(self, curves)
	end)
end

return ssl