Disable DANE for LibreSSL

This commit is contained in:
Bruno Silvestre 2019-07-11 11:19:21 -03:00
parent 8722f83e8f
commit f64e660de0
4 changed files with 12 additions and 5 deletions

View File

@ -8,6 +8,8 @@
#ifndef LSEC_COMPAT_H #ifndef LSEC_COMPAT_H
#define LSEC_COMPAT_H #define LSEC_COMPAT_H
#include <openssl/ssl.h>
#if defined(_WIN32) #if defined(_WIN32)
#define LSEC_API __declspec(dllexport) #define LSEC_API __declspec(dllexport)
#else #else
@ -28,4 +30,8 @@
#define setfuncs(L, R) luaL_setfuncs(L, R, 0) #define setfuncs(L, R) luaL_setfuncs(L, R, 0)
#endif #endif
#if (!defined(LIBRESSL_VERSION_NUMBER) && (OPENSSL_VERSION_NUMBER >= 0x1010000fL))
#define LSEC_ENABLE_DANE
#endif
#endif #endif

View File

@ -74,7 +74,7 @@ LSEC_API int luaopen_ssl_config(lua_State *L)
lua_pushboolean(L, 1); lua_pushboolean(L, 1);
lua_rawset(L, -3); lua_rawset(L, -3);
#if (OPENSSL_VERSION_NUMBER >= 0x1010000fL) #if defined(LSEC_ENABLE_DANE)
// DANE // DANE
lua_pushstring(L, "dane"); lua_pushstring(L, "dane");
lua_pushboolean(L, 1); lua_pushboolean(L, 1);

View File

@ -21,6 +21,7 @@
#include <lua.h> #include <lua.h>
#include <lauxlib.h> #include <lauxlib.h>
#include "compat.h"
#include "context.h" #include "context.h"
#include "options.h" #include "options.h"
@ -703,7 +704,7 @@ static int set_alpn_cb(lua_State *L)
return 1; return 1;
} }
#if (OPENSSL_VERSION_NUMBER >= 0x1010000fL) #if defined(LSEC_ENABLE_DANE)
/* /*
* DANE * DANE
*/ */
@ -739,7 +740,7 @@ static luaL_Reg funcs[] = {
{"setcurve", set_curve}, {"setcurve", set_curve},
{"setcurveslist", set_curves_list}, {"setcurveslist", set_curves_list},
#endif #endif
#if (OPENSSL_VERSION_NUMBER >= 0x1010000fL) #if defined(LSEC_ENABLE_DANE)
{"setdane", set_dane}, {"setdane", set_dane},
#endif #endif
{NULL, NULL} {NULL, NULL}

View File

@ -826,7 +826,7 @@ static int meth_copyright(lua_State *L)
return 1; return 1;
} }
#if (OPENSSL_VERSION_NUMBER >= 0x1010000fL) #if defined(LSEC_ENABLE_DANE)
static int meth_dane(lua_State *L) static int meth_dane(lua_State *L)
{ {
int ret; int ret;
@ -878,7 +878,7 @@ static luaL_Reg methods[] = {
{"settimeout", meth_settimeout}, {"settimeout", meth_settimeout},
{"sni", meth_sni}, {"sni", meth_sni},
{"want", meth_want}, {"want", meth_want},
#if (OPENSSL_VERSION_NUMBER >= 0x1010000fL) #if defined(LSEC_ENABLE_DANE)
{"setdane", meth_dane}, {"setdane", meth_dane},
{"settlsa", meth_tlsa}, {"settlsa", meth_tlsa},
#endif #endif