Skip to content

Commit

Permalink
Transparent fragmentation support in TLSSocket
Browse files Browse the repository at this point in the history
  • Loading branch information
alexmgr committed Jul 23, 2015
1 parent 1f8a10b commit a1e0b8a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion scapy_ssl_tls/ssl_tls.py
Original file line number Diff line number Diff line change
Expand Up @@ -764,7 +764,12 @@ def __getattr__(self, attr):
def sendall(self, pkt, timeout=2):
prev_timeout = self._s.gettimeout()
self._s.settimeout(timeout)
self._s.sendall(str(pkt))
try:
pkt_bytes = str(pkt)
except TLSFragmentationError:
pkt = tls_fragment_payload(pkt.payload, pkt)
pkt_bytes = str(pkt)
self._s.sendall(pkt_bytes)
self.tls_ctx.insert(pkt)
self._s.settimeout(prev_timeout)

Expand Down

0 comments on commit a1e0b8a

Please sign in to comment.