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);
65 static bool DetectTlsSerialValidateCallback(
const Signature *s,
66 const char **sigerror);
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) {
150 const uint32_t data_len = strlen(connp->cert0_serial);
151 const uint8_t *data = (uint8_t *)connp->cert0_serial;
160 static bool DetectTlsSerialValidateCallback(
const Signature *s,
161 const char **sigerror)
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 "
207 for (; sm != NULL; sm = sm->
next) {
213 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 DetectTlsSerialRegister(void)
Registration function for keyword: tls.cert_serial.
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
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
@ DETECT_AL_TLS_CERT_SERIAL
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)