Skip to content

Commit a07e5d5

Browse files
guedougg-gvaladongpotter2
authored
Fix crash with StreamSocket and TLS (#4535)
Co-authored-by: Guillaume Valadon <guillaume.valadon@gitguardian.com> Co-authored-by: gpotter2 <10530980+gpotter2@users.noreply.github.com>
1 parent bf8652b commit a07e5d5

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

scapy/layers/tls/session.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1167,6 +1167,8 @@ def tcp_reassemble(cls, data, metadata, session):
11671167
length = struct.unpack("!H", data[3:5])[0] + 5
11681168
if len(data) >= length:
11691169
# get the underlayer as it is used to populate tls_session
1170+
if "original" not in metadata:
1171+
return cls(data)
11701172
underlayer = metadata["original"][TCP].copy()
11711173
underlayer.remove_payload()
11721174
# eventually get the tls_session now for TLS.dispatch_hook

0 commit comments

Comments
 (0)