detect: give clear errors for http2 w/o substate

http2 states were not yet supported even if the built-in states could
already work. Clearly error out on a hook w/o substate.
pull/15846/head
Victor Julien 4 months ago
parent e4176d2b9a
commit 7517ba9f98

@ -1411,19 +1411,19 @@ static int SigParseProtoHookApp(
SCLogError("invalid tx type specification '%s'", hook);
return -1;
}
if (strcmp(p, "http2") == 0) {
if (strcmp(p, "http2") == 0 || strcmp(p, "doh2") == 0) {
if (strcmp(t, "stream") == 0) {
sub_state = HTTP2TxTypeStream;
} else if (strcmp(t, "global") == 0) {
sub_state = HTTP2TxTypeGlobal;
} else {
SCLogError("unknown http/2 tx type specification '%s': valid values are 'stream' "
SCLogError("unknown %s tx type specification '%s': valid values are 'stream' "
"and 'global'",
hook);
p, hook);
return -1;
}
} else {
SCLogError("sub states currently only supported for http2");
SCLogError("sub states currently only supported for http2 and doh2");
return -1;
}
/* FW hook LTE mode */
@ -1466,6 +1466,12 @@ static int SigParseProtoHookApp(
}
snprintf(generic_hook_name, sizeof(generic_hook_name), "%s:%s:%s:generic", p, t, h);
} else {
if (AppLayerParserSupportsSubStates(s->alproto)) {
SCLogError(
"protocol %s requires a substate specification: %s:<sub_state>:%s", p, p, hook);
return -1;
}
/* FW hook LTE mode */
if (*h == '<') {
h++;

Loading…
Cancel
Save