diff options
Diffstat (limited to 'vendor/luasec/src/context.h')
-rw-r--r-- | vendor/luasec/src/context.h | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/vendor/luasec/src/context.h b/vendor/luasec/src/context.h new file mode 100644 index 00000000..dd6bd098 --- /dev/null +++ b/vendor/luasec/src/context.h | |||
@@ -0,0 +1,47 @@ | |||
1 | #ifndef LSEC_CONTEXT_H | ||
2 | #define LSEC_CONTEXT_H | ||
3 | |||
4 | /*-------------------------------------------------------------------------- | ||
5 | * LuaSec 1.3.2 | ||
6 | * | ||
7 | * Copyright (C) 2006-2023 Bruno Silvestre | ||
8 | * | ||
9 | *--------------------------------------------------------------------------*/ | ||
10 | |||
11 | #include <lua.h> | ||
12 | #include <openssl/ssl.h> | ||
13 | |||
14 | #include "compat.h" | ||
15 | |||
16 | #define LSEC_MODE_INVALID 0 | ||
17 | #define LSEC_MODE_SERVER 1 | ||
18 | #define LSEC_MODE_CLIENT 2 | ||
19 | |||
20 | #define LSEC_VERIFY_CONTINUE 1 | ||
21 | #define LSEC_VERIFY_IGNORE_PURPOSE 2 | ||
22 | |||
23 | typedef struct t_context_ { | ||
24 | SSL_CTX *context; | ||
25 | lua_State *L; | ||
26 | DH *dh_param; | ||
27 | void *alpn; | ||
28 | int mode; | ||
29 | } t_context; | ||
30 | typedef t_context* p_context; | ||
31 | |||
32 | /* Retrieve the SSL context from the Lua stack */ | ||
33 | SSL_CTX *lsec_checkcontext(lua_State *L, int idx); | ||
34 | SSL_CTX *lsec_testcontext(lua_State *L, int idx); | ||
35 | |||
36 | /* Retrieve the mode from the context in the Lua stack */ | ||
37 | int lsec_getmode(lua_State *L, int idx); | ||
38 | |||
39 | /* Registre the module. */ | ||
40 | LSEC_API int luaopen_ssl_context(lua_State *L); | ||
41 | |||
42 | /* Compat - Lua 5.1 */ | ||
43 | #if (LUA_VERSION_NUM == 501) | ||
44 | void *lsec_testudata (lua_State *L, int ud, const char *tname); | ||
45 | #endif | ||
46 | |||
47 | #endif | ||