Go to the documentation of this file.
57 static void DetectTlsFingerprintRegisterTests(
void);
61 Flow *f,
const uint8_t flow_flags,
62 void *txv,
const int list_id);
65 static bool DetectTlsFingerprintValidateCallback(
const Signature *s,
66 const char **sigerror);
67 static int g_tls_cert_fingerprint_buffer_id = 0;
77 "sticky buffer to match the TLS cert fingerprint buffer";
99 "TLS certificate fingerprint");
102 DetectTlsFingerprintSetupCallback);
105 DetectTlsFingerprintValidateCallback);
134 const uint8_t flow_flags,
void *txv,
const int list_id)
141 if (flow_flags & STREAM_TOSERVER) {
147 if (connp->cert0_fingerprint == NULL) {
151 const uint32_t data_len = strlen(connp->cert0_fingerprint);
152 const uint8_t *data = (uint8_t *)connp->cert0_fingerprint;
161 static bool DetectTlsFingerprintValidateCallback(
const Signature *s,
162 const char **sigerror)
168 for (; sm != NULL; sm = sm->
next) {
175 *sigerror =
"Invalid length of the specified fingerprint. "
176 "This rule will therefore never match.";
181 bool have_delimiters =
false;
185 have_delimiters =
true;
190 if (!have_delimiters) {
191 *sigerror =
"No colon delimiters ':' detected in content after "
192 "tls.cert_fingerprint. This rule will therefore "
199 *sigerror =
"tls.cert_fingerprint should not be used together "
200 "with nocase, since the rule is automatically "
201 "lowercased anyway which makes nocase redundant.";
216 for (; sm != NULL; sm = sm->
next) {
222 bool changed =
false;
#define DETECT_CONTENT_NOCASE
int DetectSignatureSetAppProto(Signature *s, AppProto alproto)
SSLv[2.0|3.[0|1|2|3]] state structure.
#define SIGMATCH_INFO_STICKY_BUFFER
SigTableElmt * sigmatch_table
uint8_t DetectEngineInspectBufferGeneric(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, const DetectEngineAppInspectionEngine *engine, const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id)
Do the content inspection & validation for a signature.
void DetectTlsFingerprintRegister(void)
Registration function for keyword: tls.cert_fingerprint.
SSLStateConnp client_connp
SSLStateConnp server_connp
int DetectBufferSetActiveList(DetectEngineCtx *de_ctx, Signature *s, const int list)
void DetectBufferTypeRegisterSetupCallback(const char *name, void(*SetupCallback)(const DetectEngineCtx *, Signature *))
main detection engine ctx
#define SIG_FLAG_TOCLIENT
int(* Setup)(DetectEngineCtx *, Signature *, const char *)
InspectionBuffer * InspectionBufferGet(DetectEngineThreadCtx *det_ctx, const int list_id)
int DetectBufferTypeGetByName(const char *name)
#define SIG_FLAG_TOSERVER
void DetectBufferTypeRegisterValidateCallback(const char *name, bool(*ValidateCallback)(const Signature *, const char **sigerror))
int PrefilterGenericMpmRegister(DetectEngineCtx *de_ctx, SigGroupHead *sgh, MpmCtx *mpm_ctx, const DetectBufferMpmRegistry *mpm_reg, int list_id)
#define SCLogWarning(...)
Macro used to log WARNING messages.
void DetectAppLayerMpmRegister(const char *name, int direction, int priority, PrefilterRegisterFunc PrefilterRegister, InspectionBufferGetDataPtr GetData, AppProto alproto, int tx_min_progress)
register an app layer keyword for mpm
SignatureInitData * init_data
@ DETECT_AL_TLS_CERT_FINGERPRINT
void InspectionBufferApplyTransforms(InspectionBuffer *buffer, const DetectEngineTransforms *transforms)
SignatureInitDataBuffer * buffers
void InspectionBufferSetup(DetectEngineThreadCtx *det_ctx, const int list_id, InspectionBuffer *buffer, const uint8_t *data, const uint32_t data_len)
setup the buffer with our initial data
a single match condition for a signature
void DetectAppLayerInspectEngineRegister(const char *name, AppProto alproto, uint32_t dir, int progress, InspectEngineFuncPtr Callback, InspectionBufferGetDataPtr GetData)
Registers an app inspection engine.
SpmGlobalThreadCtx * spm_global_thread_ctx
void DetectBufferTypeSetDescriptionByName(const char *name, const char *desc)
void SpmDestroyCtx(SpmCtx *ctx)
SpmCtx * SpmInitCtx(const uint8_t *needle, uint16_t needle_len, int nocase, SpmGlobalThreadCtx *global_thread_ctx)
void(* RegisterTests)(void)