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 652e38a..8217deb 100644 --- a/src/openssl.c +++ b/src/openssl.c | |||
@@ -294,6 +294,10 @@ | |||
294 | #define HAVE_SSL_SET_ALPN_PROTOS HAVE_SSL_CTX_SET_ALPN_PROTOS | 294 | #define HAVE_SSL_SET_ALPN_PROTOS HAVE_SSL_CTX_SET_ALPN_PROTOS |
295 | #endif | 295 | #endif |
296 | 296 | ||
297 | #ifndef HAVE_SSL_SET_CURVES_LIST | ||
298 | #define HAVE_SSL_SET_CURVES_LIST (OPENSSL_PREREQ(1,0,2) || LIBRESSL_PREREQ(2,5,1)) | ||
299 | #endif | ||
300 | |||
297 | #ifndef HAVE_SSL_SET1_PARAM | 301 | #ifndef HAVE_SSL_SET1_PARAM |
298 | #define HAVE_SSL_SET1_PARAM OPENSSL_PREREQ(1,0,2) | 302 | #define HAVE_SSL_SET1_PARAM OPENSSL_PREREQ(1,0,2) |
299 | #endif | 303 | #endif |
@@ -8214,6 +8218,21 @@ static int ssl_getCipherInfo(lua_State *L) { | |||
8214 | } /* ssl_getCipherInfo() */ | 8218 | } /* ssl_getCipherInfo() */ |
8215 | 8219 | ||
8216 | 8220 | ||
8221 | #if HAVE_SSL_SET_CURVES_LIST | ||
8222 | static int ssl_setCurvesList(lua_State *L) { | ||
8223 | SSL *ssl = checksimple(L, 1, SSL_CLASS); | ||
8224 | const char *curves = luaL_checkstring(L, 2); | ||
8225 | |||
8226 | if (!SSL_set1_curves_list(ssl, curves)) | ||
8227 | return auxL_error(L, auxL_EOPENSSL, "ssl:setCurvesList"); | ||
8228 | |||
8229 | lua_pushboolean(L, 1); | ||
8230 | |||
8231 | return 1; | ||
8232 | } /* ssl_setCurvesList() */ | ||
8233 | #endif | ||
8234 | |||
8235 | |||
8217 | static int ssl_getHostName(lua_State *L) { | 8236 | static int ssl_getHostName(lua_State *L) { |
8218 | SSL *ssl = checksimple(L, 1, SSL_CLASS); | 8237 | SSL *ssl = checksimple(L, 1, SSL_CLASS); |
8219 | const char *host; | 8238 | const char *host; |
@@ -8357,6 +8376,9 @@ static const auxL_Reg ssl_methods[] = { | |||
8357 | { "getPeerCertificate", &ssl_getPeerCertificate }, | 8376 | { "getPeerCertificate", &ssl_getPeerCertificate }, |
8358 | { "getPeerChain", &ssl_getPeerChain }, | 8377 | { "getPeerChain", &ssl_getPeerChain }, |
8359 | { "getCipherInfo", &ssl_getCipherInfo }, | 8378 | { "getCipherInfo", &ssl_getCipherInfo }, |
8379 | #if HAVE_SSL_SET_CURVES_LIST | ||
8380 | { "setCurvesList", &ssl_setCurvesList }, | ||
8381 | #endif | ||
8360 | { "getHostName", &ssl_getHostName }, | 8382 | { "getHostName", &ssl_getHostName }, |
8361 | { "setHostName", &ssl_setHostName }, | 8383 | { "setHostName", &ssl_setHostName }, |
8362 | { "getVersion", &ssl_getVersion }, | 8384 | { "getVersion", &ssl_getVersion }, |