diff options
author | Luca Deri <lucaderi@users.noreply.github.com> | 2019-01-13 11:11:10 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-13 11:11:10 +0100 |
commit | 4a6b0d7de52d2156b7da705e6b6b0787f7a4202d (patch) | |
tree | 8ce7b474dfb8b125e853c7fb286c0efed1672af5 | |
parent | f41ffe136a8736a2b6b4d884136d1c447c440b4e (diff) | |
parent | 396f794bf47178f0afc983eee3cd4a7f3d1fe686 (diff) |
Merge pull request #654 from u-devel/patch-1
Update radius.c to RFC2865
-rw-r--r-- | src/lib/protocols/radius.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/lib/protocols/radius.c b/src/lib/protocols/radius.c index 1c85f48d7..209e71177 100644 --- a/src/lib/protocols/radius.c +++ b/src/lib/protocols/radius.c @@ -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); |