MCPcopy Create free account
hub / github.com/mozilla/cipherscan / ServerHello

Class ServerHello

cscan/messages.py:72–93  ·  view source on GitHub ↗

Class with enhanced human-readable serialisation.

Source from the content-addressed store, hash-verified

70
71
72class ServerHello(messages.ServerHello):
73 """Class with enhanced human-readable serialisation."""
74
75 def __format__(self, formatstr):
76 """Return human readable representation of the object."""
77 extensions = format_array(self.extensions, formatstr)
78 random = format_bytearray(self.random, formatstr)
79 session_id = format_bytearray(self.session_id, formatstr)
80 cipher_suite = CipherSuite.ietfNames.get(self.cipher_suite,
81 self.cipher_suite)
82
83 if 'v' in formatstr:
84 cipher_suite = "CipherSuite.{0}".format(cipher_suite)
85
86 # TODO cipher_suites (including verbose)
87 # TODO compression_method (including verbose)
88 return ("ServerHello(server_version=({0[0]}, {0[1]}), random={1}, "
89 "session_id={2!r}, cipher_suite={3}, compression_method={4}, "
90 "_tack_ext={5}, extensions={6})").format(
91 self.server_version, random, session_id,
92 cipher_suite, self.compression_method, self._tack_ext,
93 extensions)
94
95
96class Certificate(messages.Certificate):

Callers 1

parseMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected