diff options
author | daurnimator <quae@daurnimator.com> | 2018-03-27 16:23:26 +1100 |
---|---|---|
committer | daurnimator <quae@daurnimator.com> | 2018-03-27 16:35:18 +1100 |
commit | 615743fec5eb97d42f1e7c9fc5964106816dcce4 (patch) | |
tree | 1bebdd181161f66b21bd8909501e893eaefa4276 /src | |
parent | e632369c52cbfa14f62e70838a48f586a82c0230 (diff) | |
download | luaossl-615743fec5eb97d42f1e7c9fc5964106816dcce4.tar.gz luaossl-615743fec5eb97d42f1e7c9fc5964106816dcce4.tar.bz2 luaossl-615743fec5eb97d42f1e7c9fc5964106816dcce4.zip |
src/openssl.c: Add ssl:setChainStore and ssl:setVerifyStore
Diffstat (limited to 'src')
-rw-r--r-- | src/openssl.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/openssl.c b/src/openssl.c index 8c132d5..fd0f8c5 100644 --- a/src/openssl.c +++ b/src/openssl.c @@ -8681,6 +8681,30 @@ static int ssl_clearOptions(lua_State *L) { } /* ssl_clearOptions() */ +static int ssl_setChainStore(lua_State *L) { + SSL *ssl = checksimple(L, 1, SSL_CLASS); + X509_STORE *store = checksimple(L, 2, X509_STORE_CLASS); + + SSL_set1_chain_cert_store(ssl, store); + + lua_pushboolean(L, 1); + + return 1; +} /* ssl_setChainStore() */ + + +static int ssl_setVerifyStore(lua_State *L) { + SSL *ssl = checksimple(L, 1, SSL_CLASS); + X509_STORE *store = checksimple(L, 2, X509_STORE_CLASS); + + SSL_set1_verify_cert_store(ssl, store); + + lua_pushboolean(L, 1); + + return 1; +} /* ssl_setVerifyStore() */ + + static int ssl_setParam(lua_State *L) { SSL *ssl = checksimple(L, 1, SSL_CLASS); X509_VERIFY_PARAM *xp = checksimple(L, 2, X509_VERIFY_PARAM_CLASS); @@ -9086,6 +9110,8 @@ static const auxL_Reg ssl_methods[] = { { "setOptions", &ssl_setOptions }, { "getOptions", &ssl_getOptions }, { "clearOptions", &ssl_clearOptions }, + { "setChainStore", &ssl_setChainStore }, + { "setVerifyStore", &ssl_setVerifyStore }, { "setParam", &ssl_setParam }, { "getParam", &ssl_getParam }, { "setVerify", &ssl_setVerify }, |