From: Mats Klepsland Date: Tue, 14 May 2019 06:35:42 +0000 (+0200) Subject: detect-tls: declare ssl_state as const in GetData() X-Git-Tag: suricata-5.0.0-rc1~494 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=008f08c1b34de2bb66809dfa7ea65892f3d1eb59;p=thirdparty%2Fsuricata.git detect-tls: declare ssl_state as const in GetData() --- diff --git a/src/detect-tls-cert-fingerprint.c b/src/detect-tls-cert-fingerprint.c index 7b739f37be..056e2b52b7 100644 --- a/src/detect-tls-cert-fingerprint.c +++ b/src/detect-tls-cert-fingerprint.c @@ -131,7 +131,7 @@ static InspectionBuffer *GetData(DetectEngineThreadCtx *det_ctx, { InspectionBuffer *buffer = InspectionBufferGet(det_ctx, list_id); if (buffer->inspect == NULL) { - SSLState *ssl_state = (SSLState *)f->alstate; + const SSLState *ssl_state = (SSLState *)f->alstate; if (ssl_state->server_connp.cert0_fingerprint == NULL) { return NULL; diff --git a/src/detect-tls-cert-issuer.c b/src/detect-tls-cert-issuer.c index 8b5b72759e..22e451ea28 100644 --- a/src/detect-tls-cert-issuer.c +++ b/src/detect-tls-cert-issuer.c @@ -121,7 +121,7 @@ static InspectionBuffer *GetData(DetectEngineThreadCtx *det_ctx, { InspectionBuffer *buffer = InspectionBufferGet(det_ctx, list_id); if (buffer->inspect == NULL) { - SSLState *ssl_state = (SSLState *)f->alstate; + const SSLState *ssl_state = (SSLState *)f->alstate; if (ssl_state->server_connp.cert0_issuerdn == NULL) { return NULL; diff --git a/src/detect-tls-cert-serial.c b/src/detect-tls-cert-serial.c index f62bb76be4..cdaf0ae5e3 100644 --- a/src/detect-tls-cert-serial.c +++ b/src/detect-tls-cert-serial.c @@ -130,7 +130,7 @@ static InspectionBuffer *GetData(DetectEngineThreadCtx *det_ctx, { InspectionBuffer *buffer = InspectionBufferGet(det_ctx, list_id); if (buffer->inspect == NULL) { - SSLState *ssl_state = (SSLState *)f->alstate; + const SSLState *ssl_state = (SSLState *)f->alstate; if (ssl_state->server_connp.cert0_serial == NULL) { return NULL; diff --git a/src/detect-tls-cert-subject.c b/src/detect-tls-cert-subject.c index b2db219f26..99c931c1c4 100644 --- a/src/detect-tls-cert-subject.c +++ b/src/detect-tls-cert-subject.c @@ -120,7 +120,7 @@ static InspectionBuffer *GetData(DetectEngineThreadCtx *det_ctx, { InspectionBuffer *buffer = InspectionBufferGet(det_ctx, list_id); if (buffer->inspect == NULL) { - SSLState *ssl_state = (SSLState *)f->alstate; + const SSLState *ssl_state = (SSLState *)f->alstate; if (ssl_state->server_connp.cert0_subject == NULL) { return NULL; diff --git a/src/detect-tls-ja3-hash.c b/src/detect-tls-ja3-hash.c index 5b1e19f693..daf41f9d40 100644 --- a/src/detect-tls-ja3-hash.c +++ b/src/detect-tls-ja3-hash.c @@ -138,7 +138,7 @@ static InspectionBuffer *GetData(DetectEngineThreadCtx *det_ctx, { InspectionBuffer *buffer = InspectionBufferGet(det_ctx, list_id); if (buffer->inspect == NULL) { - SSLState *ssl_state = (SSLState *)f->alstate; + const SSLState *ssl_state = (SSLState *)f->alstate; if (ssl_state->ja3_hash == NULL) { return NULL; diff --git a/src/detect-tls-ja3-string.c b/src/detect-tls-ja3-string.c index 747b862733..1f22590658 100644 --- a/src/detect-tls-ja3-string.c +++ b/src/detect-tls-ja3-string.c @@ -128,7 +128,7 @@ static InspectionBuffer *GetData(DetectEngineThreadCtx *det_ctx, { InspectionBuffer *buffer = InspectionBufferGet(det_ctx, list_id); if (buffer->inspect == NULL) { - SSLState *ssl_state = (SSLState *)f->alstate; + const SSLState *ssl_state = (SSLState *)f->alstate; if (ssl_state->ja3_str == NULL || ssl_state->ja3_str->data == NULL) { diff --git a/src/detect-tls-sni.c b/src/detect-tls-sni.c index ddc1706061..e51f6f9945 100644 --- a/src/detect-tls-sni.c +++ b/src/detect-tls-sni.c @@ -119,7 +119,7 @@ static InspectionBuffer *GetData(DetectEngineThreadCtx *det_ctx, { InspectionBuffer *buffer = InspectionBufferGet(det_ctx, list_id); if (buffer->inspect == NULL) { - SSLState *ssl_state = (SSLState *)f->alstate; + const SSLState *ssl_state = (SSLState *)f->alstate; if (ssl_state->client_connp.sni == NULL) { return NULL;