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

Class _TLSClientVersionField

scapy/layers/tls/basefields.py:49–69  ·  view source on GitHub ↗

We use the advertised_tls_version if it has been defined, and the legacy 0x0303 for TLS 1.3 packets.

Source from the content-addressed store, hash-verified

47
48
49class _TLSClientVersionField(ShortEnumField):
50 """
51 We use the advertised_tls_version if it has been defined,
52 and the legacy 0x0303 for TLS 1.3 packets.
53 """
54
55 def i2h(self, pkt, x):
56 if x is None:
57 v = pkt.tls_session.advertised_tls_version
58 if v:
59 return _tls13_version_filter(v, 0x0303)
60 return ""
61 return x
62
63 def i2m(self, pkt, x):
64 if x is None:
65 v = pkt.tls_session.advertised_tls_version
66 if v:
67 return _tls13_version_filter(v, 0x0303)
68 return b""
69 return x
70
71
72class _TLSVersionField(ShortEnumField):

Callers 3

TLSClientHelloClass · 0.90
TLS13ClientHelloClass · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…