Add detection of OCSP (#1370)

This protocol is detected via HTTP Content-Type header.

Until 89d548f9, nDPI had a dedicated automa (`content_automa`) to
classify a HTTP flow according to this header. Since then, this automa has
been useless because it is always empty.
Re-enable it to match only a string seems overkilling.

Remove all `content_automa` leftovers.
This commit is contained in:
Ivan Nardi
2021-11-11 12:36:55 +01:00
committed by GitHub
parent 0f168d9150
commit 3e5491fa10
10 changed files with 50 additions and 73 deletions
+1 -3
View File
@@ -285,7 +285,6 @@ void ndpiCheckHostStringMatch(char *testChar) {
ndpi_protocol_match_result match = { NDPI_PROTOCOL_UNKNOWN,
NDPI_PROTOCOL_CATEGORY_UNSPECIFIED, NDPI_PROTOCOL_UNRATED };
int testRes;
u_int8_t is_host_match = 1;
char appBufStr[64];
ndpi_protocol detected_protocol;
struct ndpi_detection_module_struct *ndpi_str;
@@ -302,8 +301,7 @@ void ndpiCheckHostStringMatch(char *testChar) {
// ac_automata_display( module->host_automa.ac_automa, 'n');
testRes = ndpi_match_string_subprotocol(ndpi_str,
testChar, strlen(testChar), &match,
is_host_match);
testChar, strlen(testChar), &match);
if(testRes) {
memset( &detected_protocol, 0, sizeof(ndpi_protocol) );