diff options
author | daurnimator <quae@daurnimator.com> | 2018-03-27 16:35:54 +1100 |
---|---|---|
committer | daurnimator <quae@daurnimator.com> | 2018-03-27 17:20:31 +1100 |
commit | ab7ceefe1329a96f2c2e223692d76ea04d7777fe (patch) | |
tree | 7687fad069238e33f54ba0774a02bbf1dd704850 /src | |
parent | 9a22e97103439a090228b50c59637ca0a34d1271 (diff) | |
download | luaossl-ab7ceefe1329a96f2c2e223692d76ea04d7777fe.tar.gz luaossl-ab7ceefe1329a96f2c2e223692d76ea04d7777fe.tar.bz2 luaossl-ab7ceefe1329a96f2c2e223692d76ea04d7777fe.zip |
src/openssl.c: ssl:set*Store is unsupported in OpenSSL < 1.0.2
Diffstat (limited to 'src')
-rw-r--r-- | src/openssl.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/openssl.c b/src/openssl.c index fd0f8c5..33d3316 100644 --- a/src/openssl.c +++ b/src/openssl.c @@ -329,6 +329,14 @@ #define HAVE_SSL_SET_ALPN_PROTOS HAVE_SSL_CTX_SET_ALPN_PROTOS #endif +#ifndef HAVE_SSL_SET1_CHAIN_CERT_STORE +#define HAVE_SSL_SET1_CHAIN_CERT_STORE OPENSSL_PREREQ(1,0,2) +#endif + +#ifndef HAVE_SSL_SET1_VERIFY_CERT_STORE +#define HAVE_SSL_SET1_VERIFY_CERT_STORE OPENSSL_PREREQ(1,0,2) +#endif + #ifndef HAVE_SSL_SET_CURVES_LIST #define HAVE_SSL_SET_CURVES_LIST (OPENSSL_PREREQ(1,0,2) || LIBRESSL_PREREQ(2,5,1)) #endif @@ -8681,6 +8689,7 @@ static int ssl_clearOptions(lua_State *L) { } /* ssl_clearOptions() */ +#if HAVE_SSL_SET1_CHAIN_CERT_STORE static int ssl_setChainStore(lua_State *L) { SSL *ssl = checksimple(L, 1, SSL_CLASS); X509_STORE *store = checksimple(L, 2, X509_STORE_CLASS); @@ -8691,8 +8700,10 @@ static int ssl_setChainStore(lua_State *L) { return 1; } /* ssl_setChainStore() */ +#endif +#if HAVE_SSL_SET1_VERIFY_CERT_STORE static int ssl_setVerifyStore(lua_State *L) { SSL *ssl = checksimple(L, 1, SSL_CLASS); X509_STORE *store = checksimple(L, 2, X509_STORE_CLASS); @@ -8703,6 +8714,7 @@ static int ssl_setVerifyStore(lua_State *L) { return 1; } /* ssl_setVerifyStore() */ +#endif static int ssl_setParam(lua_State *L) { @@ -9110,8 +9122,12 @@ static const auxL_Reg ssl_methods[] = { { "setOptions", &ssl_setOptions }, { "getOptions", &ssl_getOptions }, { "clearOptions", &ssl_clearOptions }, +#if HAVE_SSL_SET1_CHAIN_CERT_STORE { "setChainStore", &ssl_setChainStore }, +#endif +#if HAVE_SSL_SET1_VERIFY_CERT_STORE { "setVerifyStore", &ssl_setVerifyStore }, +#endif { "setParam", &ssl_setParam }, { "getParam", &ssl_getParam }, { "setVerify", &ssl_setVerify }, |