aboutsummaryrefslogtreecommitdiffstats
path: root/src/openssl.ssl.lua
diff options
context:
space:
mode:
authorLibravatarLibravatar daurnimator <quae@daurnimator.com> 2017-08-30 23:36:06 +1000
committerLibravatarLibravatar daurnimator <quae@daurnimator.com> 2017-08-30 23:37:13 +1000
commit24c947d934703c5b59edfe8229f9fa5202ffc86d (patch)
tree62786babbb8f4e7f0f6a747909809e16c2bf4c63 /src/openssl.ssl.lua
parent71c54169bb96543a50f90767d351702f63fa0220 (diff)
parentf92ced1a1448c07ae19c3832a278867859371f76 (diff)
downloadluaossl-24c947d934703c5b59edfe8229f9fa5202ffc86d.tar.gz
luaossl-24c947d934703c5b59edfe8229f9fa5202ffc86d.tar.bz2
luaossl-24c947d934703c5b59edfe8229f9fa5202ffc86d.zip
Merge branch 'curves_list'
Diffstat (limited to 'src/openssl.ssl.lua')
-rw-r--r--src/openssl.ssl.lua20
1 files changed, 18 insertions, 2 deletions
diff --git a/src/openssl.ssl.lua b/src/openssl.ssl.lua
index 3c348f6..bf90f29 100644
--- a/src/openssl.ssl.lua
+++ b/src/openssl.ssl.lua
@@ -1,3 +1,19 @@
-local ctx = require"_openssl.ssl"
+local ssl = require"_openssl.ssl"
-return ctx
+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