Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

detect/tls.certs: fix direction handling #10265

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/detect-tls-certs.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ static int g_tls_certs_buffer_id = 0;
struct TlsCertsGetDataArgs {
uint32_t local_id; /**< used as index into thread inspect array */
SSLCertsChain *cert;
const uint8_t flags;
};

typedef struct PrefilterMpmTlsCerts {
Expand Down Expand Up @@ -148,7 +149,7 @@ static InspectionBuffer *TlsCertsGetData(DetectEngineThreadCtx *det_ctx,
const SSLState *ssl_state = (SSLState *)f->alstate;
const SSLStateConnp *connp;

if (f->flags & STREAM_TOSERVER) {
if (cbdata->flags & STREAM_TOSERVER) {
connp = &ssl_state->client_connp;
} else {
connp = &ssl_state->server_connp;
Expand Down Expand Up @@ -183,7 +184,7 @@ static uint8_t DetectEngineInspectTlsCerts(DetectEngineCtx *de_ctx, DetectEngine
transforms = engine->v2.transforms;
}

struct TlsCertsGetDataArgs cbdata = { 0, NULL };
struct TlsCertsGetDataArgs cbdata = { .local_id = 0, .cert = NULL, .flags = flags };

while (1)
{
Expand Down Expand Up @@ -214,7 +215,7 @@ static void PrefilterTxTlsCerts(DetectEngineThreadCtx *det_ctx, const void *pect
const MpmCtx *mpm_ctx = ctx->mpm_ctx;
const int list_id = ctx->list_id;

struct TlsCertsGetDataArgs cbdata = { 0, NULL };
struct TlsCertsGetDataArgs cbdata = { .local_id = 0, .cert = NULL, .flags = flags };

while (1)
{
Expand Down
Loading