Go to the documentation of this file.
43 "^\\s*(alg_enc|alg_hash|alg_auth|alg_dh|\
44 sa_group_type|sa_life_type|sa_life_duration|alg_prf|sa_key_length|sa_field_size)\
45 \\s*=\\s*([0-9]+)\\s*$"
57 static int g_ike_chosen_sa_buffer_id = 0;
71 "/rules/ike-keywords.html#ike-chosen_sa_attribute";
109 if (!rs_ike_state_get_sa_attribute(txv, dd->
sa_type, &value))
138 pcre2_match_data *match = NULL;
140 if (ret < 3 || ret > 5) {
142 "pcre match for ike.chosen_sa_attribute failed, should be: <sa_attribute>=<type>, "
143 "but was: %s; error code %d",
148 pcre2len =
sizeof(attribute);
149 res = pcre2_substring_copy_bynumber(match, 1, (PCRE2_UCHAR8 *)attribute, &pcre2len);
151 SCLogError(
"pcre2_substring_copy_bynumber failed");
155 pcre2len =
sizeof(value);
156 res = pcre2_substring_copy_bynumber(match, 2, (PCRE2_UCHAR8 *)value, &pcre2len);
158 SCLogError(
"pcre2_substring_copy_bynumber failed");
172 "to ike.chosen_sa_attribute keyword");
176 pcre2_match_data_free(match);
181 pcre2_match_data_free(match);
216 g_ike_chosen_sa_buffer_id) == NULL) {
222 DetectIkeChosenSaFree(
de_ctx, dd);
255 static int IKEChosenSaParserTest(
void)
258 de = DetectIkeChosenSaParse(
"alg_hash=2");
262 FAIL_IF(strcmp(
de->sa_type,
"alg_hash") != 0);
264 DetectIkeChosenSaFree(NULL,
de);
int DetectSignatureSetAppProto(Signature *s, AppProto alproto)
#define FAIL_IF_NULL(expr)
Fail a test if expression evaluates to NULL.
SigTableElmt * sigmatch_table
void(* Free)(DetectEngineCtx *, void *)
void IKEChosenSaRegisterTests(void)
void UtRegisterTest(const char *name, int(*TestFn)(void))
Register unit test.
main detection engine ctx
int(* AppLayerTxMatch)(DetectEngineThreadCtx *, Flow *, uint8_t flags, void *alstate, void *txv, const Signature *, const SigMatchCtx *)
int ByteExtractStringUint32(uint32_t *res, int base, size_t len, const char *str)
int DetectParsePcreExec(DetectParseRegex *parse_regex, pcre2_match_data **match, const char *str, int start_offset, int options)
#define SIG_FLAG_TOCLIENT
int(* Setup)(DetectEngineCtx *, Signature *, const char *)
int DetectBufferTypeGetByName(const char *name)
#define PASS
Pass the test.
void DetectSetupParseRegexes(const char *parse_str, DetectParseRegex *detect_parse)
Used to start a pointer to SigMatch context Should never be dereferenced without casting to something...
@ DETECT_AL_IKE_CHOSEN_SA
#define FAIL_IF(expr)
Fail a test if expression evaluates to true.
uint8_t DetectEngineInspectGenericList(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, const struct 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.
#define SCLogError(...)
Macro used to log ERROR messages.
void DetectAppLayerInspectEngineRegister(const char *name, AppProto alproto, uint32_t dir, int progress, InspectEngineFuncPtr Callback, InspectionBufferGetDataPtr GetData)
Registers an app inspection engine.
SigMatch * SigMatchAppendSMToList(DetectEngineCtx *de_ctx, Signature *s, uint16_t type, SigMatchCtx *ctx, const int list)
Append a SigMatch to the list type.
void DetectIkeChosenSaRegister(void)
Registration function for ike.ChosenSa keyword.
void(* RegisterTests)(void)