From 1274afbbf57354afd93a925c9ba766a71b47598b Mon Sep 17 00:00:00 2001 From: daurnimator Date: Mon, 3 Apr 2017 18:30:30 +1000 Subject: Export constants for openssl.ocsp.basic:verify() with via module --- src/GNUmakefile | 1 + src/openssl.c | 25 +++++++++++++++++++++++++ src/openssl.ocsp.basic.lua | 3 +++ 3 files changed, 29 insertions(+) create mode 100644 src/openssl.ocsp.basic.lua diff --git a/src/GNUmakefile b/src/GNUmakefile index 015a93c..7de802a 100644 --- a/src/GNUmakefile +++ b/src/GNUmakefile @@ -92,6 +92,7 @@ MODS$(1)_$(d) = \ $$(DESTDIR)$(3)/openssl.lua \ $$(DESTDIR)$(3)/openssl/auxlib.lua \ $$(DESTDIR)$(3)/openssl/bignum.lua \ + $$(DESTDIR)$(3)/openssl/ocsp/basic.lua \ $$(DESTDIR)$(3)/openssl/pkey.lua \ $$(DESTDIR)$(3)/openssl/pubkey.lua \ $$(DESTDIR)$(3)/openssl/x509.lua \ diff --git a/src/openssl.c b/src/openssl.c index 0de4f82..83e8bc8 100644 --- a/src/openssl.c +++ b/src/openssl.c @@ -9371,6 +9371,31 @@ static const auxL_Reg ob_metatable[] = { { NULL, NULL }, }; +static const auxL_Reg ob_globals[] = { + { NULL, NULL }, +}; + +static const auxL_IntegerReg ob_verify_flags[] = { + { "NOSIGS", OCSP_NOSIGS}, + { "NOVERIFY", OCSP_NOVERIFY}, + { "NOCHAIN", OCSP_NOCHAIN}, + { "NOCHECKS", OCSP_NOCHECKS}, + { "NOEXPLICIT", OCSP_NOEXPLICIT}, + { "TRUSTOTHER", OCSP_TRUSTOTHER}, + { "NOINTERN", OCSP_NOINTERN}, + { "TRUSTOTHER", OCSP_TRUSTOTHER}, + { NULL, 0 }, +}; + +int luaopen__openssl_ocsp_basic(lua_State *L) { + initall(L); + + auxL_newlib(L, ob_globals, 0); + auxL_setintegers(L, ob_verify_flags); + + return 1; +} /* luaopen__openssl_ocsp_basic() */ + /* * Rand - openssl.rand * diff --git a/src/openssl.ocsp.basic.lua b/src/openssl.ocsp.basic.lua new file mode 100644 index 0000000..355faf7 --- /dev/null +++ b/src/openssl.ocsp.basic.lua @@ -0,0 +1,3 @@ +local ob = require "_openssl.ocsp.basic" + +return ob -- cgit v1.2.3-59-g8ed1b