flextls.protocol.Protocol.assemble

Here are the examples of the python api flextls.protocol.Protocol.assemble taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

3 Examples 7

Example 1

Project: python-flextls Source File: __init__.py
Function: assemble
    def assemble(self):
        Protocol.assemble(self)
        # ToDo: Fragmentation is not supported
        self.fragment_offset = 0
        self.fragment_length = self.length
        return Protocol.assemble(self)

Example 2

Project: python-flextls Source File: __init__.py
Function: assemble
    def assemble(self):
        cipher_data = b""
        for cipher in self.cipher_suites:
            cipher_data = cipher_data + cipher.assemble()

        if len(self.challenge) == 0:
            # ToDo: error
            pass

        self.cipher_suites_length = len(cipher_data)
        self.session_id_length = len(self.session_id)
        self.challenge_length = len(self.challenge)

        data = cipher_data
        data += self.session_id
        data += self.challenge

        data = Protocol.assemble(self) + data
        return data

Example 3

Project: python-flextls Source File: heartbeat.py
Function: assemble
    def assemble(self):
        data = Protocol.assemble(self)
        data = data + self.padding
        return data