Go to the documentation of this file.
59 static void DetectTlsFingerprintRegisterTests(
void);
63 Flow *f,
const uint8_t flow_flags,
64 void *txv,
const int list_id);
67 static bool DetectTlsFingerprintValidateCallback(
const Signature *s,
68 const char **sigerror);
69 static int g_tls_cert_fingerprint_buffer_id = 0;
96 "TLS certificate fingerprint");
99 DetectTlsFingerprintSetupCallback);
102 DetectTlsFingerprintValidateCallback);
131 const uint8_t flow_flags,
void *txv,
const int list_id)
151 static bool DetectTlsFingerprintValidateCallback(
const Signature *s,
152 const char **sigerror)
155 for ( ; sm != NULL; sm = sm->
next)
163 *sigerror =
"Invalid length of the specified fingerprint. "
164 "This rule will therefore never match.";
169 bool have_delimiters =
false;
174 have_delimiters =
true;
179 if (!have_delimiters) {
180 *sigerror =
"No colon delimiters ':' detected in content after "
181 "tls.cert_fingerprint. This rule will therefore "
188 *sigerror =
"tls.cert_fingerprint should not be used together "
189 "with nocase, since the rule is automatically "
190 "lowercased anyway which makes nocase redundant.";
202 for ( ; sm != NULL; sm = sm->
next)
209 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
void DetectTlsFingerprintRegister(void)
Registration function for keyword: tls.cert_fingerprint.
SSLStateConnp server_connp
void DetectBufferTypeRegisterSetupCallback(const char *name, void(*SetupCallback)(const DetectEngineCtx *, Signature *))
int PrefilterGenericMpmRegister(DetectEngineCtx *de_ctx, SigGroupHead *sgh, MpmCtx *mpm_ctx, const DetectBufferMpmRegistery *mpm_reg, int list_id)
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)
void DetectBufferTypeRegisterValidateCallback(const char *name, bool(*ValidateCallback)(const Signature *, const char **sigerror))
int 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 DetectAppLayerInspectEngineRegister2(const char *name, AppProto alproto, uint32_t dir, int progress, InspectEngineFuncPtr2 Callback2, InspectionBufferGetDataPtr GetData)
register inspect engine at start up time
SignatureInitData * init_data
struct SigMatch_ ** smlists
@ DETECT_AL_TLS_CERT_FINGERPRINT
void DetectAppLayerMpmRegister2(const char *name, int direction, int priority, int(*PrefilterRegister)(DetectEngineCtx *de_ctx, SigGroupHead *sgh, MpmCtx *mpm_ctx, const DetectBufferMpmRegistery *mpm_reg, int list_id), InspectionBufferGetDataPtr GetData, AppProto alproto, int tx_min_progress)
register a MPM engine
void InspectionBufferApplyTransforms(InspectionBuffer *buffer, const DetectEngineTransforms *transforms)
SigTableElmt sigmatch_table[DETECT_TBLSIZE]
#define SCLogWarning(err_code,...)
Macro used to log WARNING messages.
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
SpmGlobalThreadCtx * spm_global_thread_ctx
int DetectBufferSetActiveList(Signature *s, const int list)
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)