Skip to content

Commit

Permalink
Fix crash with StreamSocket and TLS (#4535)
Browse files Browse the repository at this point in the history
Co-authored-by: Guillaume Valadon <guillaume.valadon@gitguardian.com>
Co-authored-by: gpotter2 <10530980+gpotter2@users.noreply.github.com>
  • Loading branch information
3 people authored Sep 24, 2024
1 parent bf8652b commit a07e5d5
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions scapy/layers/tls/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -1167,6 +1167,8 @@ def tcp_reassemble(cls, data, metadata, session):
length = struct.unpack("!H", data[3:5])[0] + 5
if len(data) >= length:
# get the underlayer as it is used to populate tls_session
if "original" not in metadata:
return cls(data)
underlayer = metadata["original"][TCP].copy()
underlayer.remove_payload()
# eventually get the tls_session now for TLS.dispatch_hook
Expand Down

0 comments on commit a07e5d5

Please sign in to comment.