58 static int GetHasshServerString(
lua_State *luastate,
const Flow *f)
60 void *state = FlowGetAppState(f);
64 const uint8_t *hassh_server_string = NULL;
67 void *tx = rs_ssh_state_get_tx(state, 0);
68 if (rs_ssh_tx_get_hassh_string(tx, &hassh_server_string, &b_len, STREAM_TOCLIENT) != 1)
70 if (hassh_server_string == NULL || b_len == 0) {
77 static int HasshServerGetString(
lua_State *luastate)
88 r = GetHasshServerString(luastate, f);
95 void *state = FlowGetAppState(f);
99 const uint8_t *hassh_server = NULL;
102 void *tx = rs_ssh_state_get_tx(state, 0);
103 if (rs_ssh_tx_get_hassh(tx, &hassh_server, &b_len, STREAM_TOCLIENT) != 1)
105 if (hassh_server == NULL || b_len == 0) {
112 static int HasshServerGet(
lua_State *luastate)
123 r = GetHasshServer(luastate, f);
128 static int GetHasshString(
lua_State *luastate,
const Flow *f)
130 void *state = FlowGetAppState(f);
134 const uint8_t *hassh_string = NULL;
137 void *tx = rs_ssh_state_get_tx(state, 0);
138 if (rs_ssh_tx_get_hassh_string(tx, &hassh_string, &b_len, STREAM_TOSERVER) != 1)
140 if (hassh_string == NULL || b_len == 0) {
147 static int HasshGetString(
lua_State *luastate)
158 r = GetHasshString(luastate, f);
165 void *state = FlowGetAppState(f);
169 const uint8_t *hassh = NULL;
172 void *tx = rs_ssh_state_get_tx(state, 0);
173 if (rs_ssh_tx_get_hassh(tx, &hassh, &b_len, STREAM_TOSERVER) != 1)
175 if (hassh == NULL || b_len == 0) {
193 r = GetHassh(luastate, f);
202 lua_pushcfunction(luastate, HasshGet);
203 lua_setglobal(luastate,
"HasshGet");
205 lua_pushcfunction(luastate, HasshGetString);
206 lua_setglobal(luastate,
"HasshGetString");
208 lua_pushcfunction(luastate, HasshServerGet);
209 lua_setglobal(luastate,
"HasshServerGet");
211 lua_pushcfunction(luastate, HasshServerGetString);
212 lua_setglobal(luastate,
"HasshServerGetString");