INNER CODE UNIT · Python

RecordMergingSocket

wolfSSL/wolfssl · scripts/multi-msg-record.py:258

class RecordMergingSocket:
    """Socket wrapper that rewrites consecutive TLS handshake records into
    a single multi-message record.  Only merges plaintext records that
    precede ChangeCipherSpec."""

    def __init__(self, sock):
        self._sock = sock
        self._pending = bytearray()
        self._ver = 0x0303
        self._after_ccs = False
        self.merged_msgs = []          # [(n_msgs, [names], size)]

    def _flush(self):
        if not self._pending:
            return
        msgs = _parse_hs_types(self._pending)
        n = len(msgs)
        hdr = struct.pack("!BHH", 22, self._ver, len(self._pending))

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…