Skip to content

Commit

Permalink
Apply suggestion
Browse files Browse the repository at this point in the history
  • Loading branch information
gpotter2 authored Sep 24, 2024
1 parent 3a448af commit 6fc8ed7
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions scapy/layers/tls/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -1167,11 +1167,10 @@ 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 metadata.get("original", None) is None:
underlayer = TCP()
else:
underlayer = metadata["original"][TCP].copy()
underlayer.remove_payload()
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
tls_session = None
if conf.tls_session_enable:
Expand Down

0 comments on commit 6fc8ed7

Please sign in to comment.