TLS: better handling of encrypted/cleartext alert messages (#3095)

This commit is contained in:
Ivan Nardi 2026-01-19 17:33:01 +00:00 committed by GitHub
parent 6755d3309a
commit 009a85ef53
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1509,7 +1509,10 @@ int ndpi_search_tls_tcp(struct ndpi_detection_module_struct *ndpi_struct,
printf("[TLS] *** TLS ALERT ***\n");
#endif
if(len >= 7) {
/* Basic heuristic to tell if the alert is encrypted or not */
if(len == 7 &&
(message->buffer[5] == 1 ||
message->buffer[5] == 2)) {
u_int8_t alert_level = message->buffer[5];
if(alert_level == 2 /* Warning (1), Fatal (2) */)