58 static int GetCertNotBefore(
lua_State *luastate,
const Flow *f,
int direction)
60 void *state = FlowGetAppState(f);
81 static int TlsGetCertNotBefore(
lua_State *luastate)
94 r = GetCertNotBefore(luastate, f, direction);
99 static int GetCertNotAfter(
lua_State *luastate,
const Flow *f,
int direction)
101 void *state = FlowGetAppState(f);
122 static int TlsGetCertNotAfter(
lua_State *luastate)
135 r = GetCertNotAfter(luastate, f, direction);
140 static int GetCertInfo(
lua_State *luastate,
const Flow *f,
int direction)
142 void *state = FlowGetAppState(f);
169 static int TlsGetCertInfo(
lua_State *luastate)
182 r = GetCertInfo(luastate, f, direction);
187 static int GetAgreedVersion(
lua_State *luastate,
const Flow *f)
189 void *state = FlowGetAppState(f);
199 strlen(ssl_version));
202 static int TlsGetVersion(
lua_State *luastate)
213 r = GetAgreedVersion(luastate, f);
220 void *state = FlowGetAppState(f);
233 static int TlsGetSNI(
lua_State *luastate)
244 r = GetSNI(luastate, f);
251 void *state = FlowGetAppState(f);
265 static int TlsGetCertSerial(
lua_State *luastate)
276 r = GetCertSerial(luastate, f);
281 static int GetCertChain(
lua_State *luastate,
const Flow *f,
int direction)
283 void *state = FlowGetAppState(f);
297 lua_newtable(luastate);
301 lua_pushinteger(luastate, u++);
303 lua_newtable(luastate);
305 lua_pushstring(luastate,
"length");
306 lua_pushinteger(luastate, cert->
cert_len);
307 lua_settable(luastate, -3);
309 lua_pushstring(luastate,
"data");
312 lua_settable(luastate, -3);
313 lua_settable(luastate, -3);
319 static int TlsGetCertChain(
lua_State *luastate)
332 r = GetCertChain(luastate, f, direction);
341 lua_pushcfunction(luastate, TlsGetCertNotBefore);
342 lua_setglobal(luastate,
"TlsGetCertNotBefore");
344 lua_pushcfunction(luastate, TlsGetCertNotAfter);
345 lua_setglobal(luastate,
"TlsGetCertNotAfter");
347 lua_pushcfunction(luastate, TlsGetVersion);
348 lua_setglobal(luastate,
"TlsGetVersion");
350 lua_pushcfunction(luastate, TlsGetCertInfo);
351 lua_setglobal(luastate,
"TlsGetCertInfo");
353 lua_pushcfunction(luastate, TlsGetSNI);
354 lua_setglobal(luastate,
"TlsGetSNI");
356 lua_pushcfunction(luastate, TlsGetCertSerial);
357 lua_setglobal(luastate,
"TlsGetCertSerial");
359 lua_pushcfunction(luastate, TlsGetCertChain);
360 lua_setglobal(luastate,
"TlsGetCertChain");