Merge pull request #654 from u-devel/patch-1

Update radius.c to RFC2865
This commit is contained in:
Luca Deri
2019-01-13 11:11:10 +01:00
committed by GitHub
+4 -1
View File
@@ -39,10 +39,13 @@ static void ndpi_check_radius(struct ndpi_detection_module_struct *ndpi_struct,
if(packet->udp != NULL) {
struct radius_header *h = (struct radius_header*)packet->payload;
/* RFC2865: The minimum length is 20 and maximum length is 4096. */
if((payload_len < 20) || (payload_len > 4096))
return;
if((payload_len > sizeof(struct radius_header))
&& (h->code > 0)
&& (h->code <= 5)
&& (h->code <= 13)
&& (ntohs(h->len) == payload_len)) {
NDPI_LOG_INFO(ndpi_struct, "Found radius\n");
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_RADIUS, NDPI_PROTOCOL_UNKNOWN);