Go to the documentation of this file.
57 static void DetectTlsSerialRegisterTests(
void);
61 Flow *
f,
const uint8_t flow_flags,
62 void *txv,
const int list_id);
63 static void DetectTlsSerialSetupCallback(
65 static bool DetectTlsSerialValidateCallback(
67 static int g_tls_cert_serial_buffer_id = 0;
77 "sticky buffer to match the TLS cert serial buffer";
99 "TLS certificate serial number");
102 DetectTlsSerialSetupCallback);
105 DetectTlsSerialValidateCallback);
133 const uint8_t flow_flags,
void *txv,
const int list_id)
140 if (flow_flags & STREAM_TOSERVER) {
146 if (connp->cert0_serial == NULL) {
151 const uint8_t *data = connp->cert0_serial;
154 det_ctx, list_id, buffer, data, data_len, transforms);
160 static bool DetectTlsSerialValidateCallback(
167 for (; sm != NULL; sm = sm->
next) {
174 *sigerror =
"tls.cert_serial should not be used together "
175 "with nocase, since the rule is automatically "
176 "uppercased anyway which makes nocase redundant.";
189 *sigerror =
"No colon delimiters ':' detected in content after "
190 "tls.cert_serial. This rule will therefore never "
200 static void DetectTlsSerialSetupCallback(
207 for (; sm != NULL; sm = sm->
next) {
213 bool changed =
false;
#define DETECT_CONTENT_NOCASE
SSLv[2.0|3.[0|1|2|3]] state structure.
void DetectBufferTypeRegisterSetupCallback(const char *name, void(*SetupCallback)(const DetectEngineCtx *, Signature *, const DetectBufferType *))
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.
InspectionBuffer * SCInspectionBufferGet(DetectEngineThreadCtx *det_ctx, const int list_id)
void DetectTlsSerialRegister(void)
Registration function for keyword: tls.cert_serial.
SSLStateConnp client_connp
SSLStateConnp server_connp
main detection engine ctx
void DetectBufferTypeRegisterValidateCallback(const char *name, bool(*ValidateCallback)(const Signature *, const char **sigerror, const DetectBufferType *))
void SCInspectionBufferSetupAndApplyTransforms(DetectEngineThreadCtx *det_ctx, const int list_id, InspectionBuffer *buffer, const uint8_t *data, const uint32_t data_len, const DetectEngineTransforms *transforms)
setup the buffer with our initial data
int SCDetectBufferSetActiveList(DetectEngineCtx *de_ctx, Signature *s, const int list)
int SCDetectSignatureSetAppProto(Signature *s, AppProto alproto)
#define SIG_FLAG_TOCLIENT
int(* Setup)(DetectEngineCtx *, Signature *, const char *)
void DetectAppLayerInspectEngineRegister(const char *name, AppProto alproto, uint32_t dir, uint8_t progress, InspectEngineFuncPtr Callback, InspectionBufferGetDataPtr GetData)
Registers an app inspection engine.
int DetectBufferTypeGetByName(const char *name)
#define SIG_FLAG_TOSERVER
uint32_t cert0_serial_len
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.
SignatureInitData * init_data
void DetectAppLayerMpmRegister(const char *name, int direction, int priority, PrefilterRegisterFunc PrefilterRegister, InspectionBufferGetDataPtr GetData, AppProto alproto, uint8_t tx_min_progress)
register an app layer keyword for mpm
SignatureInitDataBuffer * buffers
a single match condition for a signature
#define SIGMATCH_INFO_STICKY_BUFFER
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)