Brief description
The curent code does not correctly compute the hash of the TCP MD5 option.
According to RFC2385, tcpdump, and the Linux kernel, the TCP options must be skipped when hashing the packet, while their lengths still affect the result through the segment length in the TCP pseudo header and data offset in the TCP header, both of which are part of the hash input.
Scapy version
251daec
Python version
3.14.7
Operating system
Arch Linux 7.2.3-arch1-3
Additional environment information
No response
How to reproduce
Actual result
IP6 ::1.20 > ::1.9999: Flags [S], seq 0, win 8192, options [md5 (invalid),eol], length 0
IP 127.0.0.1.20 > 127.0.0.1.9999: Flags [S], seq 0, win 8192, options [md5 (invalid),eol], length 0
The md5 (invalid) is the problem.
Expected result
IP6 ::1.20 > ::1.9999: Flags [S], seq 0, win 8192, options [md5 valid,eol], length 0
IP 127.0.0.1.20 > 127.0.0.1.9999: Flags [S], seq 0, win 8192, options [md5 valid,eol], length 0
The md5 valid is what you should see.
Related resources
No response
Brief description
The curent code does not correctly compute the hash of the TCP MD5 option.
According to RFC2385,
tcpdump, and the Linux kernel, the TCP options must be skipped when hashing the packet, while their lengths still affect the result through the segment length in the TCP pseudo header and data offset in the TCP header, both of which are part of the hash input.Scapy version
251daec
Python version
3.14.7
Operating system
Arch Linux 7.2.3-arch1-3
Additional environment information
No response
How to reproduce
tcpdumpwith-M ...configuring the key used to verify the MD5 checksumPython3/scapyto forge and send packets with the same key (12345678) used aboveActual result
The
md5 (invalid)is the problem.Expected result
The
md5 validis what you should see.Related resources
No response