Skip to content
Snippets Groups Projects
Commit f91eae08 authored by gpotter2's avatar gpotter2
Browse files

TLS continuous data

parent 6a783f4a
No related branches found
No related tags found
No related merge requests found
......@@ -288,6 +288,11 @@ class TLS(_GenericTLSSessionInheritance):
if s.rcs and not isinstance(s.rcs.cipher, Cipher_NULL):
from scapy.layers.tls.record_tls13 import TLS13
return TLS13
if _pkt and len(_pkt) < 5:
# Layer detected as TLS but too small to be a real packet (len<5).
# Those packets appear when sessions are interrupted or to flush buffers.
# Scapy should not try to decode them
return conf.raw_layer
return TLS
### Parsing methods
......
......@@ -968,6 +968,9 @@ assert(not t7.pad and not t7.padlen)
assert(isinstance(t7.msg[0], _TLSEncryptedContent))
len(t7.msg[0].load) == 478
= Reading TLS msg dissect - Packet too small
assert isinstance(TLS(b"\x00"), Raw)
= Reading TLS msg dissect - Wrong data
from scapy.layers.tls.record import _TLSMsgListField
assert isinstance(_TLSMsgListField.m2i(_TLSMsgListField("", []), TLS(type=0), '\x00\x03\x03\x00\x03abc'), Raw)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment