Go to the documentation of this file.
56 #define PARSE_REGEX "^\\s*([A-z0-9\\.]+|\"[A-z0-9\\.]+\")\\s*$"
61 Flow *, uint8_t,
void *,
void *,
65 static void DetectTlsVersionRegisterTests(
void);
68 static int g_tls_generic_list_id = 0;
102 Flow *f, uint8_t
flags,
void *state,
void *txv,
109 if (ssl_state == NULL) {
118 if (
flags & STREAM_TOCLIENT) {
121 }
else if (
flags & STREAM_TOSERVER) {
128 if (((
version >> 8) & 0xff) == 0x7f) {
156 pcre2_match_data *match = NULL;
158 if (ret < 1 || ret > 3) {
166 pcre2len =
sizeof(ver_ptr);
167 res = pcre2_substring_copy_bynumber(match, 1, (PCRE2_UCHAR8 *)ver_ptr, &pcre2len);
169 SCLogError(
"pcre2_substring_copy_bynumber failed");
181 if (tmp_str[0] ==
'"')
183 tmp_str[strlen(tmp_str) - 1] =
'\0';
187 if (strncmp(
"1.0", tmp_str, 3) == 0) {
189 }
else if (strncmp(
"1.1", tmp_str, 3) == 0) {
191 }
else if (strncmp(
"1.2", tmp_str, 3) == 0) {
193 }
else if (strncmp(
"1.3", tmp_str, 3) == 0) {
195 }
else if ((strncmp(
"0x", tmp_str, 2) == 0) && (strlen(
str) == 6)) {
196 temp = (uint16_t)strtol(tmp_str, NULL, 0);
208 pcre2_match_data_free(match);
213 pcre2_match_data_free(match);
216 DetectTlsVersionFree(
de_ctx, tls);
239 tls = DetectTlsVersionParse(
de_ctx,
str);
247 g_tls_generic_list_id) == NULL) {
255 DetectTlsVersionFree(
de_ctx, tls);
int DetectSignatureSetAppProto(Signature *s, AppProto alproto)
SSLv[2.0|3.[0|1|2|3]] state structure.
SigTableElmt * sigmatch_table
void(* Free)(DetectEngineCtx *, void *)
SSLStateConnp client_connp
SSLStateConnp server_connp
main detection engine ctx
int(* AppLayerTxMatch)(DetectEngineThreadCtx *, Flow *, uint8_t flags, void *alstate, void *txv, const Signature *, const SigMatchCtx *)
int DetectParsePcreExec(DetectParseRegex *parse_regex, pcre2_match_data **match, const char *str, int start_offset, int options)
int(* Setup)(DetectEngineCtx *, Signature *, const char *)
#define DETECT_TLS_VERSION_FLAG_RAW
void DetectTlsVersionRegister(void)
Registration function for keyword: tls.version.
void DetectSetupParseRegexes(const char *parse_str, DetectParseRegex *detect_parse)
Data structures and function prototypes for keeping state for the detection engine.
Used to start a pointer to SigMatch context Should never be dereferenced without casting to something...
int DetectBufferTypeRegister(const char *name)
#define PARSE_REGEX
Regex for parsing "id" option, matching number or "number".
#define SCLogError(...)
Macro used to log ERROR messages.
SigMatch * SigMatchAppendSMToList(DetectEngineCtx *de_ctx, Signature *s, uint16_t type, SigMatchCtx *ctx, const int list)
Append a SigMatch to the list type.
void(* RegisterTests)(void)