Added check for invalid HTTP URLs

This commit is contained in:
Luca Deri
2020-05-16 00:10:35 +02:00
parent c375782b96
commit 3d9285f1be
15 changed files with 878 additions and 849 deletions
+2 -2
View File
@@ -1029,12 +1029,12 @@ extern "C" {
void ndpi_data_print_window_values(struct ndpi_analyze_struct *s); /* debug */
ndpi_risk ndpi_validate_url(char *url);
ndpi_risk_enum ndpi_validate_url(char *url);
u_int8_t ndpi_is_protocol_detected(struct ndpi_detection_module_struct *ndpi_str,
ndpi_protocol proto);
const char* ndpi_risk2str(ndpi_risk risk);
const char* ndpi_risk2str(ndpi_risk_enum risk);
#ifdef __cplusplus
}
#endif
+1
View File
@@ -278,6 +278,7 @@
#define NDPI_CLR_BIT(num, n) num &= ~(1UL << n)
#define NDPI_CLR_BIT(num, n) num &= ~(1UL << n)
#define NDPI_ISSET_BIT(num, n) (num & (1 << n))
#define NDPI_ZERO_BIT(num) num = 0
/* this is a very very tricky macro *g*,
* the compiler will remove all shifts here if the protocol is static...
+4 -1
View File
@@ -64,10 +64,13 @@ typedef enum {
NDPI_TLS_CERTIFICATE_MISMATCH,
NDPI_HTTP_SUSPICIOUS_USER_AGENT,
NDPI_HTTP_NUMERIC_IP_HOST,
NDPI_HTTP_SUSPICIOUS_URL,
/* Leave this as last member */
NDPI_MAX_RISK
} ndpi_risk;
} ndpi_risk_enum;
typedef u_int32_t ndpi_risk;
/* NDPI_VISIT */
typedef enum {