MCPcopy Create free account
hub / github.com/secdev/scapy / SSLv2ServerHello

Class SSLv2ServerHello

scapy/layers/tls/handshake_sslv2.py:161–199  ·  view source on GitHub ↗

SSLv2 ServerHello.

Source from the content-addressed store, hash-verified

159
160
161class SSLv2ServerHello(_SSLv2Handshake):
162 """
163 SSLv2 ServerHello.
164 """
165 name = "SSLv2 Handshake - Server Hello"
166 fields_desc = [ByteEnumField("msgtype", 4, _sslv2_handshake_type),
167
168 ByteField("sid_hit", 0),
169 ByteEnumField("certtype", 1, {1: "x509_cert"}),
170 _TLSVersionField("version", 0x0002, _tls_version),
171
172 FieldLenField("certlen", None, fmt="!H",
173 length_of="cert"),
174 FieldLenField("cipherslen", None, fmt="!H",
175 length_of="ciphers"),
176 FieldLenField("connection_idlen", None, fmt="!H",
177 length_of="connection_id"),
178
179 _SSLv2CertDataField("cert", b"",
180 length_from=lambda pkt: pkt.certlen),
181 _SSLv2CipherSuitesField("ciphers", [], _tls_cipher_suites,
182 length_from=lambda pkt: pkt.cipherslen), # noqa: E501
183 XStrLenField("connection_id", b"",
184 length_from=lambda pkt: pkt.connection_idlen)]
185
186 def tls_session_update(self, msg_str):
187 """
188 XXX Something should be done about the session ID here.
189 """
190 super(SSLv2ServerHello, self).tls_session_update(msg_str)
191
192 s = self.tls_session
193 client_cs = s.sslv2_common_cs
194 css = [cs for cs in client_cs if cs in self.ciphers]
195 s.sslv2_common_cs = css
196 s.sslv2_connection_id = self.connection_id
197 s.tls_version = self.version
198 if self.cert is not None:
199 s.server_certs = [self.cert]
200
201
202###############################################################################

Callers 1

Calls 7

ByteEnumFieldClass · 0.90
ByteFieldClass · 0.90
_TLSVersionFieldClass · 0.90
FieldLenFieldClass · 0.90
XStrLenFieldClass · 0.90
_SSLv2CertDataFieldClass · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…