diff options
Diffstat (limited to 'src/openssl.c')
-rw-r--r-- | src/openssl.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/openssl.c b/src/openssl.c index fa7dd79..d679d92 100644 --- a/src/openssl.c +++ b/src/openssl.c | |||
@@ -254,6 +254,10 @@ | |||
254 | #define HAVE_SSL_CTX_GET0_PARAM OPENSSL_PREREQ(1,0,2) | 254 | #define HAVE_SSL_CTX_GET0_PARAM OPENSSL_PREREQ(1,0,2) |
255 | #endif | 255 | #endif |
256 | 256 | ||
257 | #ifndef HAVE_SSL_CTX_SET_CURVES_LIST | ||
258 | #define HAVE_SSL_CTX_SET_CURVES_LIST (OPENSSL_PREREQ(1,0,2) || LIBRESSL_PREREQ(2,5,1)) | ||
259 | #endif | ||
260 | |||
257 | #ifndef HAVE_SSL_CTX_SET_ALPN_PROTOS | 261 | #ifndef HAVE_SSL_CTX_SET_ALPN_PROTOS |
258 | #define HAVE_SSL_CTX_SET_ALPN_PROTOS (OPENSSL_PREREQ(1,0,2) || LIBRESSL_PREREQ(2,1,3)) | 262 | #define HAVE_SSL_CTX_SET_ALPN_PROTOS (OPENSSL_PREREQ(1,0,2) || LIBRESSL_PREREQ(2,1,3)) |
259 | #endif | 263 | #endif |
@@ -7746,6 +7750,21 @@ static int sx_setCipherList(lua_State *L) { | |||
7746 | } /* sx_setCipherList() */ | 7750 | } /* sx_setCipherList() */ |
7747 | 7751 | ||
7748 | 7752 | ||
7753 | #if HAVE_SSL_CTX_SET_CURVES_LIST | ||
7754 | static int sx_setCurvesList(lua_State *L) { | ||
7755 | SSL_CTX *ctx = checksimple(L, 1, SSL_CTX_CLASS); | ||
7756 | const char *curves = luaL_checkstring(L, 2); | ||
7757 | |||
7758 | if (!SSL_CTX_set1_curves_list(ctx, curves)) | ||
7759 | return auxL_error(L, auxL_EOPENSSL, "ssl.context:setCurvesList"); | ||
7760 | |||
7761 | lua_pushboolean(L, 1); | ||
7762 | |||
7763 | return 1; | ||
7764 | } /* sx_setCurvesList() */ | ||
7765 | #endif | ||
7766 | |||
7767 | |||
7749 | static int sx_setEphemeralKey(lua_State *L) { | 7768 | static int sx_setEphemeralKey(lua_State *L) { |
7750 | SSL_CTX *ctx = checksimple(L, 1, SSL_CTX_CLASS); | 7769 | SSL_CTX *ctx = checksimple(L, 1, SSL_CTX_CLASS); |
7751 | EVP_PKEY *key = checksimple(L, 2, PKEY_CLASS); | 7770 | EVP_PKEY *key = checksimple(L, 2, PKEY_CLASS); |
@@ -7941,6 +7960,9 @@ static const auxL_Reg sx_methods[] = { | |||
7941 | { "setCertificate", &sx_setCertificate }, | 7960 | { "setCertificate", &sx_setCertificate }, |
7942 | { "setPrivateKey", &sx_setPrivateKey }, | 7961 | { "setPrivateKey", &sx_setPrivateKey }, |
7943 | { "setCipherList", &sx_setCipherList }, | 7962 | { "setCipherList", &sx_setCipherList }, |
7963 | #if HAVE_SSL_CTX_SET_CURVES_LIST | ||
7964 | { "setCurvesList", &sx_setCurvesList }, | ||
7965 | #endif | ||
7944 | { "setEphemeralKey", &sx_setEphemeralKey }, | 7966 | { "setEphemeralKey", &sx_setEphemeralKey }, |
7945 | #if HAVE_SSL_CTX_SET_ALPN_PROTOS | 7967 | #if HAVE_SSL_CTX_SET_ALPN_PROTOS |
7946 | { "setAlpnProtos", &sx_setAlpnProtos }, | 7968 | { "setAlpnProtos", &sx_setAlpnProtos }, |