Skip to content

Commit 7d2454c

Browse files
committed
config: move cfg of aggressiviness and opportunistic TLS to the new API
1 parent 161e875 commit 7d2454c

File tree

14 files changed

+73
-186
lines changed

14 files changed

+73
-186
lines changed

doc/configuration_parameters.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,13 @@ TODO
1111
| NULL | "flow_risk.anonymous_subscriber.list.protonvpn.load" | 1 | NULL | NULL | Enable/disable loading of internal IP address list of ProtonVPN exit nodes used to check `NDPI_ANONYMOUS_SUBSCRIBER` flow risk |
1212
| NULL | "flow_risk.crawler_bot.list.load" | 1 | NULL | NULL | Enable/disable loading of internal IP address list used to check `NDPI_HTTP_CRAWLER_BOT` flow risk |
1313
| NULL | "filename.config" | NULL | NULL | NULL | Name of the file containing a list of configuration knobs itself (one per line)!. Useful to configure nDPI via text file instead of via API |
14-
| "tls" | "metadata.sha1_fingerprint.enable" | 1 | NULL | NULL | Enable/disable computation and export of SHA1 fingerprint for TLS flows. Note that if it is disable, the flow risk `NDPI_MALICIOUS_SHA1_CERTIFICATE` is not checked |
1514
| NULL | "lru.$CACHE_NAME.size" | See description | 0 | 16777215 | Set the size (in number of elements) of the specified LRU cache (0 = the cache is disabled). The keyword "$CACHE_NAME" is a placeholder for the cache name and the possible values are: ookla, bittorrent, zoom, stun, tls_cert, mining, msteams, stun_zoom. The default value is "32768" for the bittorrent cache, "512" for the zoom cache and "1024" for all the other caches |
1615
| NULL | "lru.$CACHE_NAME.ttl" | See description | 0 | 16777215 | Set the TTL (in seconds) for the elements of the specified LRU cache (0 = the elements never explicitly expire). The keyword "$CACHE_NAME" is a placeholder for the cache name and the possible values are: ookla, bittorrent, zoom, stun, tls_cert, mining, msteams, stun_zoom. The default value is "120" for the ookla cache, "60" for the msteams and stun_zoom caches and "0" for all the other caches |
16+
| "tls" | "metadata.sha1_fingerprint.enable" | 1 | NULL | NULL | Enable/disable computation and export of SHA1 fingerprint for TLS flows. Note that if it is disable, the flow risk `NDPI_MALICIOUS_SHA1_CERTIFICATE` is not checked |
17+
| "smtp" | "tls_dissection.enable" | 1 | NULL | NULL | Enable/disable dissection of TLS packets in cleartext SMTP flows (because of opportunistic TLS, via STARTTLS msg) |
18+
| "imap" | "tls_dissection.enable" | 1 | NULL | NULL | Enable/disable dissection of TLS packets in cleartext IMAP flows (because of opportunistic TLS, via STARTTLS msg) |
19+
| "pop" | "tls_dissection.enable" | 1 | NULL | NULL | Enable/disable dissection of TLS packets in cleartext POP flows (because of opportunistic TLS, via STARTTLS msg) |
20+
| "ftp" | "tls_dissection.enable" | 1 | NULL | NULL | Enable/disable dissection of TLS packets in cleartext FTP flows (because of opportunistic TLS, via AUTH TLS msg) |
21+
| "stun" | "tls_dissection.enable" | 1 | NULL | NULL | Enable/disable dissection of TLS packets multiplexed into STUN flows |
22+
| "ookla" | "aggressiveness", | 0x01 | 0x00 | 0x01 | Detection aggressiveness for Ookla. The value is a bitmask. Values: 0x0 = disabled; 0x01 = enable heuristic for detection over TLS (via Ookla LRU cache) |
1723
| $PROTO_NAME | "ip_list.load" | 1 | NULL | NULL | Enable/disable loading of internal list of IP addresses (used for (sub)classification) specific to that protocol. Use "any" as protocol name if you want to easily enable/disable all lists. This knob is valid only for the following protocols: Alibaba, Amazon AWS, Apple, Avast, Bloomberg, Cachefly, Cloudflare, Discord, Disney+, Dropbox, Edgecast, EpicGames, Ethereum, Facebook, Github, Google, Google Cloud, GoTo, Hotspot Shield, Hulu, Line, Microsoft 365, Microsoft Azure, Microsoft One Drive, Microsoft Outlook, Mullvad, Netflix, Nvidia, OpenDNS, ProtonVPN, RiotGames, Roblox, Skype/Teams, Starcraft, Steam, Teamviewer, Telegram, Tencent, Threema, TOR, Twitch, Twitter, UbuntuONE, VK, Yandex, Yandex Cloud, Webex, Whatsapp, Zoom |

example/config.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#See doc/configuration_parameters.md for a complete list and description of all the accepted knobs
66

77
,packets_limit_per_flow,32
8+
ookla,aggressiveness,0x1
89
tls,metadata.sha1_fingerprint.enable,1
910

1011
,lru.bittorrent.ttl,0

example/ndpiReader.c

Lines changed: 3 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@ static int num_cfgs = 0;
107107
int nDPI_LogLevel = 0;
108108
char *_debug_protocols = NULL;
109109
char *_disabled_protocols = NULL;
110-
int aggressiveness[NDPI_MAX_SUPPORTED_PROTOCOLS];
111110
static u_int8_t stats_flag = 0;
112111
ndpi_init_prefs init_prefs = ndpi_no_prefs | ndpi_enable_tcp_ack_payload_heuristic;
113112
u_int8_t human_readeable_string_len = 5;
@@ -603,7 +602,6 @@ static void help(u_int long_help) {
603602
" -I | Ignore VLAN id for flow hash calculation\n"
604603
" -A | Dump internal statistics (LRU caches / Patricia trees / Ahocarasick automas / ...\n"
605604
" -M | Memory allocation stats on data-path (only by the library). It works only on single-thread configuration\n"
606-
" -Z proto:value | Set this value of aggressiveness for this protocol (0 to disable it). This flag can be used multiple times\n"
607605
" --cfg=proto,param,value | Configure the specific attribute of this protocol\n"
608606
,
609607
human_readeable_string_len,
@@ -967,7 +965,7 @@ int __add_cfg(char *proto, char *param, char *value, int dup)
967965
*/
968966
static void parseOptions(int argc, char **argv) {
969967
int option_idx = 0;
970-
int opt, i;
968+
int opt;
971969
#ifndef USE_DPDK
972970
char *__pcap_file = NULL;
973971
int thread_id, do_capture = 0;
@@ -989,11 +987,8 @@ static void parseOptions(int argc, char **argv) {
989987
}
990988
#endif
991989

992-
for(i = 0; i < NDPI_MAX_SUPPORTED_PROTOCOLS; i++)
993-
aggressiveness[i] = -1; /* Use the default value */
994-
995990
while((opt = getopt_long(argc, argv,
996-
"a:Ab:B:e:Ec:C:dDFf:g:G:i:Ij:k:K:S:hHp:pP:l:r:Rs:tu:v:V:n:rp:x:X:w:Z:q0123:456:7:89:m:MT:U:",
991+
"a:Ab:B:e:Ec:C:dDFf:g:G:i:Ij:k:K:S:hHp:pP:l:r:Rs:tu:v:V:n:rp:x:X:w:q0123:456:7:89:m:MT:U:",
997992
longopts, &option_idx)) != EOF) {
998993
#ifdef DEBUG_TRACE
999994
if(trace) fprintf(trace, " #### Handling option -%c [%s] #### \n", opt, optarg ? optarg : "");
@@ -1133,36 +1128,6 @@ static void parseOptions(int argc, char **argv) {
11331128
_disabled_protocols = ndpi_strdup(optarg);
11341129
break;
11351130

1136-
case 'Z': /* proto_name:aggr_value */
1137-
{
1138-
struct ndpi_detection_module_struct *module_tmp;
1139-
NDPI_PROTOCOL_BITMASK all;
1140-
char *saveptr, *tmp_str, *proto_str, *aggr_str;
1141-
1142-
/* Use a temporary module with all protocols enabled */
1143-
module_tmp = ndpi_init_detection_module(0);
1144-
if(!module_tmp)
1145-
break;
1146-
1147-
NDPI_BITMASK_SET_ALL(all);
1148-
ndpi_set_protocol_detection_bitmask2(module_tmp, &all);
1149-
ndpi_finalize_initialization(module_tmp);
1150-
1151-
tmp_str = ndpi_strdup(optarg);
1152-
if(tmp_str) {
1153-
proto_str = strtok_r(tmp_str, ":", &saveptr);
1154-
if(proto_str) {
1155-
aggr_str = strtok_r(NULL, ":", &saveptr);
1156-
if(aggr_str) {
1157-
aggressiveness[ndpi_get_protocol_id(module_tmp, proto_str)] = atoi(aggr_str);
1158-
}
1159-
}
1160-
}
1161-
ndpi_free(tmp_str);
1162-
ndpi_exit_detection_module(module_tmp);
1163-
break;
1164-
}
1165-
11661131
case 'h':
11671132
help(0);
11681133
break;
@@ -1299,7 +1264,7 @@ static void parseOptions(int argc, char **argv) {
12991264
if(max_num_udp_dissected_pkts < 3) max_num_udp_dissected_pkts = 3;
13001265
break;
13011266

1302-
case OPTLONG_VALUE_CFG:
1267+
case OPTLONG_VALUE_CFG:
13031268
if(parse_three_strings(optarg, &s1, &s2, &s3) == -1 ||
13041269
__add_cfg(s1, s2, s3, 0) == -1) {
13051270
printf("Invalid parameter [%s] [num:%d/%d]\n", optarg, num_cfgs, MAX_NUM_CFGS);
@@ -2808,12 +2773,6 @@ static void setupDetection(u_int16_t thread_id, pcap_t * pcap_handle) {
28082773
if(_protoFilePath != NULL)
28092774
ndpi_load_protocols_file(ndpi_thread_info[thread_id].workflow->ndpi_struct, _protoFilePath);
28102775

2811-
/* Set aggressiveness here */
2812-
for(i = 0; i < NDPI_MAX_SUPPORTED_PROTOCOLS; i++) {
2813-
if(aggressiveness[i] != -1)
2814-
ndpi_set_protocol_aggressiveness(ndpi_thread_info[thread_id].workflow->ndpi_struct, i, aggressiveness[i]);
2815-
}
2816-
28172776
for(i = 0; i < num_cfgs; i++) {
28182777
rc = ndpi_set_config(ndpi_thread_info[thread_id].workflow->ndpi_struct,
28192778
cfgs[i].proto, cfgs[i].param, cfgs[i].value);

fuzz/fuzz_config.cpp

Lines changed: 31 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
1414
struct ndpi_flow_struct flow;
1515
u_int8_t protocol_was_guessed;
1616
u_int32_t i;
17-
u_int16_t random_proto, bool_value;
18-
int random_value;
17+
u_int16_t bool_value;
1918
NDPI_PROTOCOL_BITMASK enabled_bitmask;
2019
struct ndpi_lru_cache_stats lru_stats;
2120
struct ndpi_patricia_tree_stats patricia_stats;
@@ -86,30 +85,41 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
8685

8786
ndpi_set_detection_preferences(ndpi_info_mod, static_cast<ndpi_detection_preference>(0xFF), 0xFF); /* Invalid preference */
8887

89-
ndpi_set_opportunistic_tls(ndpi_info_mod, NDPI_PROTOCOL_MAIL_SMTP, fuzzed_data.ConsumeBool());
90-
ndpi_get_opportunistic_tls(ndpi_info_mod, NDPI_PROTOCOL_MAIL_SMTP);
91-
ndpi_set_opportunistic_tls(ndpi_info_mod, NDPI_PROTOCOL_MAIL_IMAP, fuzzed_data.ConsumeBool());
92-
ndpi_get_opportunistic_tls(ndpi_info_mod, NDPI_PROTOCOL_MAIL_IMAP);
93-
ndpi_set_opportunistic_tls(ndpi_info_mod, NDPI_PROTOCOL_MAIL_POP, fuzzed_data.ConsumeBool());
94-
ndpi_get_opportunistic_tls(ndpi_info_mod, NDPI_PROTOCOL_MAIL_POP);
95-
ndpi_set_opportunistic_tls(ndpi_info_mod, NDPI_PROTOCOL_FTP_CONTROL, fuzzed_data.ConsumeBool());
96-
ndpi_get_opportunistic_tls(ndpi_info_mod, NDPI_PROTOCOL_FTP_CONTROL);
97-
98-
random_proto = fuzzed_data.ConsumeIntegralInRange(0, (1 << 16) - 1);
99-
random_value = fuzzed_data.ConsumeIntegralInRange(0,2); /* Only 0-1 are valid values */
100-
ndpi_set_opportunistic_tls(ndpi_info_mod, random_proto, random_value);
101-
ndpi_get_opportunistic_tls(ndpi_info_mod, random_proto);
102-
103-
for(i = 0; i < NDPI_MAX_SUPPORTED_PROTOCOLS; i++) {
104-
ndpi_set_protocol_aggressiveness(ndpi_info_mod, i, random_value);
105-
ndpi_get_protocol_aggressiveness(ndpi_info_mod, i);
106-
}
107-
10888
if(fuzzed_data.ConsumeBool()) {
10989
value = fuzzed_data.ConsumeIntegralInRange(0, 1 + 1);
11090
sprintf(cfg_value, "%d", value);
11191
ndpi_set_config(ndpi_info_mod, "tls", "metadata.sha1_fingerprint.enable", cfg_value);
11292
}
93+
if(fuzzed_data.ConsumeBool()) {
94+
value = fuzzed_data.ConsumeIntegralInRange(0, 1 + 1);
95+
sprintf(cfg_value, "%d", value);
96+
ndpi_set_config(ndpi_info_mod, "smtp", "tls_dissection.enable", cfg_value);
97+
}
98+
if(fuzzed_data.ConsumeBool()) {
99+
value = fuzzed_data.ConsumeIntegralInRange(0, 1 + 1);
100+
sprintf(cfg_value, "%d", value);
101+
ndpi_set_config(ndpi_info_mod, "imap", "tls_dissection.enable", cfg_value);
102+
}
103+
if(fuzzed_data.ConsumeBool()) {
104+
value = fuzzed_data.ConsumeIntegralInRange(0, 1 + 1);
105+
sprintf(cfg_value, "%d", value);
106+
ndpi_set_config(ndpi_info_mod, "pop", "tls_dissection.enable", cfg_value);
107+
}
108+
if(fuzzed_data.ConsumeBool()) {
109+
value = fuzzed_data.ConsumeIntegralInRange(0, 1 + 1);
110+
sprintf(cfg_value, "%d", value);
111+
ndpi_set_config(ndpi_info_mod, "ftp", "tls_dissection.enable", cfg_value);
112+
}
113+
if(fuzzed_data.ConsumeBool()) {
114+
value = fuzzed_data.ConsumeIntegralInRange(0, 1 + 1);
115+
sprintf(cfg_value, "%d", value);
116+
ndpi_set_config(ndpi_info_mod, "stun", "tls_dissection.enable", cfg_value);
117+
}
118+
if(fuzzed_data.ConsumeBool()) {
119+
value = fuzzed_data.ConsumeIntegralInRange(0, 0x01 + 1);
120+
sprintf(cfg_value, "%d", value);
121+
ndpi_set_config(ndpi_info_mod, "ookla", "aggressiveness", cfg_value);
122+
}
113123
if(fuzzed_data.ConsumeBool()) {
114124
value = fuzzed_data.ConsumeIntegralInRange(0, 1 + 1);
115125
sprintf(cfg_value, "%d", value);

src/include/ndpi_api.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1074,16 +1074,6 @@ extern "C" {
10741074
lru_cache_type cache_type,
10751075
struct ndpi_lru_cache_stats *stats);
10761076

1077-
int ndpi_set_opportunistic_tls(struct ndpi_detection_module_struct *ndpi_struct,
1078-
u_int16_t proto, int value);
1079-
int ndpi_get_opportunistic_tls(struct ndpi_detection_module_struct *ndpi_struct,
1080-
u_int16_t proto);
1081-
1082-
int ndpi_set_protocol_aggressiveness(struct ndpi_detection_module_struct *ndpi_struct,
1083-
u_int16_t proto, u_int32_t value);
1084-
u_int32_t ndpi_get_protocol_aggressiveness(struct ndpi_detection_module_struct *ndpi_struct,
1085-
u_int16_t proto);
1086-
10871077
/**
10881078
* Find a protocol id associated with a string automata
10891079
*

src/lib/ndpi_main.c

Lines changed: 12 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -3273,14 +3273,6 @@ struct ndpi_detection_module_struct *ndpi_init_detection_module(ndpi_init_prefs
32733273
return(NULL);
32743274
}
32753275

3276-
ndpi_str->opportunistic_tls_smtp_enabled = 1;
3277-
ndpi_str->opportunistic_tls_imap_enabled = 1;
3278-
ndpi_str->opportunistic_tls_pop_enabled = 1;
3279-
ndpi_str->opportunistic_tls_ftp_enabled = 1;
3280-
ndpi_str->opportunistic_tls_stun_enabled = 1;
3281-
3282-
ndpi_str->aggressiveness_ookla = NDPI_AGGRESSIVENESS_OOKLA_TLS;
3283-
32843276
if(prefs & ndpi_enable_tcp_ack_payload_heuristic)
32853277
ndpi_str->tcp_ack_paylod_heuristic = 1;
32863278

@@ -10539,92 +10531,6 @@ int ndpi_seen_flow_beginning(const struct ndpi_flow_struct *flow)
1053910531

1054010532
/* ******************************************************************** */
1054110533

10542-
int ndpi_set_opportunistic_tls(struct ndpi_detection_module_struct *ndpi_struct,
10543-
u_int16_t proto, int value)
10544-
{
10545-
if(!ndpi_struct || (value != 0 && value != 1))
10546-
return -1;
10547-
10548-
switch(proto) {
10549-
case NDPI_PROTOCOL_MAIL_SMTP:
10550-
ndpi_struct->opportunistic_tls_smtp_enabled = value;
10551-
return 0;
10552-
case NDPI_PROTOCOL_MAIL_IMAP:
10553-
ndpi_struct->opportunistic_tls_imap_enabled = value;
10554-
return 0;
10555-
case NDPI_PROTOCOL_MAIL_POP:
10556-
ndpi_struct->opportunistic_tls_pop_enabled = value;
10557-
return 0;
10558-
case NDPI_PROTOCOL_FTP_CONTROL:
10559-
ndpi_struct->opportunistic_tls_ftp_enabled = value;
10560-
return 0;
10561-
case NDPI_PROTOCOL_STUN:
10562-
ndpi_struct->opportunistic_tls_stun_enabled = value;
10563-
return 0;
10564-
default:
10565-
return -1;
10566-
}
10567-
}
10568-
10569-
/* ******************************************************************** */
10570-
10571-
int ndpi_get_opportunistic_tls(struct ndpi_detection_module_struct *ndpi_struct,
10572-
u_int16_t proto)
10573-
{
10574-
if(!ndpi_struct)
10575-
return -1;
10576-
10577-
switch(proto) {
10578-
case NDPI_PROTOCOL_MAIL_SMTP:
10579-
return ndpi_struct->opportunistic_tls_smtp_enabled;
10580-
case NDPI_PROTOCOL_MAIL_IMAP:
10581-
return ndpi_struct->opportunistic_tls_imap_enabled;
10582-
case NDPI_PROTOCOL_MAIL_POP:
10583-
return ndpi_struct->opportunistic_tls_pop_enabled;
10584-
case NDPI_PROTOCOL_FTP_CONTROL:
10585-
return ndpi_struct->opportunistic_tls_ftp_enabled;
10586-
case NDPI_PROTOCOL_STUN:
10587-
return ndpi_struct->opportunistic_tls_stun_enabled;
10588-
default:
10589-
return -1;
10590-
}
10591-
}
10592-
10593-
/* ******************************************************************** */
10594-
10595-
int ndpi_set_protocol_aggressiveness(struct ndpi_detection_module_struct *ndpi_struct,
10596-
u_int16_t proto, u_int32_t value)
10597-
{
10598-
if(!ndpi_struct)
10599-
return -1;
10600-
10601-
switch(proto) {
10602-
case NDPI_PROTOCOL_OOKLA:
10603-
ndpi_struct->aggressiveness_ookla = value;
10604-
return 0;
10605-
default:
10606-
return -1;
10607-
}
10608-
}
10609-
10610-
/* ******************************************************************** */
10611-
10612-
u_int32_t ndpi_get_protocol_aggressiveness(struct ndpi_detection_module_struct *ndpi_struct,
10613-
u_int16_t proto)
10614-
{
10615-
if(!ndpi_struct)
10616-
return -1;
10617-
10618-
switch(proto) {
10619-
case NDPI_PROTOCOL_OOKLA:
10620-
return ndpi_struct->aggressiveness_ookla;
10621-
default:
10622-
return -1;
10623-
}
10624-
}
10625-
10626-
/* ******************************************************************** */
10627-
1062810534
void ndpi_set_user_data(struct ndpi_detection_module_struct *ndpi_str, void *user_data)
1062910535
{
1063010536
if (ndpi_str == NULL)
@@ -10676,7 +10582,6 @@ static u_int16_t __get_proto_id(const char *proto_name_or_id)
1067610582
NDPI_BITMASK_SET_ALL(all);
1067710583
ndpi_set_protocol_detection_bitmask2(module, &all);
1067810584
/* Try to be fast: we need only the protocol name -> protocol id mapping! */
10679-
/* TODO */
1068010585
ndpi_set_config(module, "any", "ip_list.load", "0");
1068110586
ndpi_set_config(module, NULL, "flow_risk_lists.load", "0");
1068210587
ndpi_finalize_initialization(module);
@@ -10885,6 +10790,18 @@ static const struct cfg_param {
1088510790

1088610791
{ "tls", "metadata.sha1_fingerprint.enable", "1", NULL, NULL, CFG_PARAM_ENABLE_DISABLE, __OFF(tls_sha1_fingerprint_enabled) },
1088710792

10793+
{ "smtp", "tls_dissection.enable", "1", NULL, NULL, CFG_PARAM_ENABLE_DISABLE, __OFF(smtp_opportunistic_tls_enabled) },
10794+
10795+
{ "imap", "tls_dissection.enable", "1", NULL, NULL, CFG_PARAM_ENABLE_DISABLE, __OFF(imap_opportunistic_tls_enabled) },
10796+
10797+
{ "pop", "tls_dissection.enable", "1", NULL, NULL, CFG_PARAM_ENABLE_DISABLE, __OFF(pop_opportunistic_tls_enabled) },
10798+
10799+
{ "ftp", "tls_dissection.enable", "1", NULL, NULL, CFG_PARAM_ENABLE_DISABLE, __OFF(ftp_opportunistic_tls_enabled) },
10800+
10801+
{ "stun", "tls_dissection.enable", "1", NULL, NULL, CFG_PARAM_ENABLE_DISABLE, __OFF(stun_opportunistic_tls_enabled) },
10802+
10803+
{ "ookla", "aggressiveness", "0x01", "0", "1", CFG_PARAM_INT, __OFF(ookla_aggressiveness) },
10804+
1088810805
{ "$PROTO_NAME_OR_ID", "ip_list.load", "1", NULL, NULL, CFG_PARAM_PROTOCOL_ENABLE_DISABLE, __OFF(ip_list_bitmask)},
1088910806

1089010807
/* Global parameters */

src/lib/ndpi_private.h

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,18 @@ struct ndpi_detection_module_config_struct {
152152

153153
int tls_sha1_fingerprint_enabled;
154154

155+
int smtp_opportunistic_tls_enabled;
156+
157+
int imap_opportunistic_tls_enabled;
158+
159+
int pop_opportunistic_tls_enabled;
160+
161+
int ftp_opportunistic_tls_enabled;
162+
163+
int stun_opportunistic_tls_enabled;
164+
165+
int ookla_aggressiveness;
166+
155167
NDPI_PROTOCOL_BITMASK ip_list_bitmask;
156168

157169
int flow_risk_lists_enabled;
@@ -272,14 +284,6 @@ struct ndpi_detection_module_struct {
272284

273285
/* *** If you add a new LRU cache, please update lru_cache_type above! *** */
274286

275-
int opportunistic_tls_smtp_enabled;
276-
int opportunistic_tls_imap_enabled;
277-
int opportunistic_tls_pop_enabled;
278-
int opportunistic_tls_ftp_enabled;
279-
int opportunistic_tls_stun_enabled;
280-
281-
u_int32_t aggressiveness_ookla;
282-
283287
int tcp_ack_paylod_heuristic;
284288
int fully_encrypted_based_on_first_pkt_heuristic;
285289

src/lib/protocols/ftp_control.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -640,7 +640,7 @@ static void ndpi_check_ftp_control(struct ndpi_detection_module_struct *ndpi_str
640640
flow->l4.tcp.ftp_imap_pop_smtp.auth_tls == 0) {
641641
flow->ftp_control_stage = 0;
642642
} else if (flow->l4.tcp.ftp_imap_pop_smtp.auth_tls == 1 &&
643-
ndpi_struct->opportunistic_tls_ftp_enabled) {
643+
ndpi_struct->cfg.ftp_opportunistic_tls_enabled) {
644644
flow->host_server_name[0] = '\0'; /* Remove any data set by other dissectors (eg. SMTP) */
645645
/* Switch classification to FTPS */
646646
ndpi_set_detected_protocol(ndpi_struct, flow,

src/lib/protocols/mail_imap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ static void ndpi_search_mail_imap_tcp(struct ndpi_detection_module_struct *ndpi_
110110
if(flow->l4.tcp.mail_imap_starttls == 1) {
111111
NDPI_LOG_DBG2(ndpi_struct, "starttls detected\n");
112112
ndpi_int_mail_imap_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_MAIL_IMAPS);
113-
if(ndpi_struct->opportunistic_tls_imap_enabled) {
113+
if(ndpi_struct->cfg.imap_opportunistic_tls_enabled) {
114114
NDPI_LOG_DBG(ndpi_struct, "Switching to [%d/%d]\n",
115115
flow->detected_protocol_stack[0], flow->detected_protocol_stack[1]);
116116
/* We are done (in IMAP dissector): delegating TLS... */

0 commit comments

Comments
 (0)