]> The Tcpdump Group git mirrors - tcpdump/commit
RADIUS: Modernize packet parsing
authorFrancois-Xavier Le Bail <[email protected]>
Fri, 22 Sep 2023 19:43:25 +0000 (21:43 +0200)
committerfxlb <[email protected]>
Sun, 1 Oct 2023 06:46:28 +0000 (06:46 +0000)
commit790427e0cf2d0a9fd1d0eb6ac714e2428b903c8c
tree06f18c4867d54c7f124c2ac25120ff5176490dad
parent1177f31774e1977735ade2a73ae8c50de02ec3ba
RADIUS: Modernize packet parsing

Add a sanity check: The maximum length is 4096.
Print the protocol name with nd_print_protocol_caps() before any check.
Enable ND_LONGJMP_FROM_TCHECK and remove the 'trunc' labels.
Report invalid packets as invalid. Use ND_ICHECK*() for length check.
Remove some redundant ND_TCHECK_*().
Fix a length check for ARAP-Challenge-Response attribute (s/</!=/).
Add a missing comma between 'id' and 'length' in non-verbose output.
print_vendor_attr(): Factorize some code; print length including
type and length as in most cases.
Use GET_CPY_BYTES() instead of memcpy().
Add a const qualifier for the radius_print() parameter 'length'.

The test file radius_rfc5447_invalid_length.pcap gives now an error:
[length 57 > 56] (invalid); follow-up to f64a4a5f49.
Update RADIUS length (from 44006 to 263) in radius_attr_asan.pcap to pass
the two new tests (length <= 4096 and length <= original length).
Update some test outputs accordingly.

Moreover:
Remove some extra blank lines.
netdissect.h
print-radius.c
tests/radius-rfc3162-v.out
tests/radius_attr_asan.out
tests/radius_attr_asan.pcap
tests/radius_rfc5447_invalid_length-v.out