bunkerweb/lib/resty/openssl/include/stack.lua
Théophile Diot c473aa4080 Squashed 'src/deps/src/lua-resty-openssl/' changes from b23c072a4..89195843c
89195843c release: 1.0.1 (#129)
3a1bc273e fix(jwk) return error if exporting private key from public key (#128)
969f3e003 release: 1.0.0 (#127)
7cdcf0d17 chore(tests) cleanup fips tests
935227b34 feat(fips) add get_fips_version_text
f2d015b4b chore(scripts) add script to check unused cdefs
84abc0ab9 refactor(*) remove unused cdefs
99b493e67 refactor(*) BREAKING: drop OpenSSL 1.0.2, 1.1.0 and BoringSSL support
8d12024e4 release: 0.8.26
2ca4d14b1 doc(readme) add notes around :reset usage
74fc033ae chore(tests): bump openssl versions in CI
756e3e638 tests(provider) support OpenSSL 3.x
1516b4d94 fix(version) add support for all 3.x versions
d6ed9648e fix(x509.csr) remove extension before adding it
4f67b295e tests(ci) bump version and refactor fips module build
f9a153288 release: 0.8.25 (#122)
6e58b28c3 fix(pkey) clear error stack when verification fails (#121)
4871f49c3 release: 0.8.24
abaa66ee0 fix(ssl) support ngx_lua 10025
d51ba7909 chore(tests): bump openresty 1.21.4.2
2b99acd36 doc(changelog): include optional colon

git-subtree-dir: src/deps/src/lua-resty-openssl
git-subtree-split: 89195843cfbfac9dcbf071832aa9303a347871b4
2023-11-16 16:54:59 +00:00

30 lines
1.1 KiB
Lua

--[[
The OpenSSL stack library. Note `safestack` is not usable here in ffi because
those symbols are eaten after preprocessing.
Instead, we should do a Lua land type checking by having a nested field indicating
which type of cdata its ctx holds.
]]
local ffi = require "ffi"
require "resty.openssl.include.ossl_typ"
ffi.cdef [[
typedef char *OPENSSL_STRING;
typedef struct stack_st OPENSSL_STACK;
OPENSSL_STACK *OPENSSL_sk_new_null(void);
int OPENSSL_sk_push(OPENSSL_STACK *st, const void *data);
void OPENSSL_sk_pop_free(OPENSSL_STACK *st, void (*func) (void *));
int OPENSSL_sk_num(const OPENSSL_STACK *);
void *OPENSSL_sk_value(const OPENSSL_STACK *, int);
OPENSSL_STACK *OPENSSL_sk_dup(const OPENSSL_STACK *st);
void OPENSSL_sk_free(OPENSSL_STACK *);
// void *OPENSSL_sk_delete(OPENSSL_STACK *st, int loc);
typedef void (*OPENSSL_sk_freefunc)(void *);
typedef void *(*OPENSSL_sk_copyfunc)(const void *);
OPENSSL_STACK *OPENSSL_sk_deep_copy(const OPENSSL_STACK *,
OPENSSL_sk_copyfunc c,
OPENSSL_sk_freefunc f);
]]