kbandla / dpkt

fast, simple packet creation / parsing, with definitions for the basic TCP/IP protocols
Other
1.08k stars 270 forks source link

Fix tls records unpacking #640

Closed obormot closed 1 year ago

obormot commented 1 year ago

Refactor unpacking of TLS. class TLS is just a container for TLSRecords. As such, it doesn't need its own __hdr__. In current code it just copies the header of the 1st TLSRecord, which is technically incorrect. A better pattern would be that TLS delegates unpacking to the underlying TLSRecord and advances the buffer. The proposed change does just that.

coveralls commented 1 year ago

Coverage Status

Coverage decreased (-5.0e-05%) to 99.817% when pulling 8e63d35d3e3239609a14a81be2819d6876299284 on fix-tls-records-unpacking into 0ac9dc84b10b6f9209c70d24a919d06e644ed62b on master.

obormot commented 1 year ago

This is potentially a breaking change, since it removes TLS.__hdr__, so going to merge into master and give it some soak time.