We use the advertised_tls_version if it has been defined, and the legacy 0x0303 for TLS 1.3 packets.
| 47 | |
| 48 | |
| 49 | class _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 | |
| 72 | class _TLSVersionField(ShortEnumField): |
no outgoing calls
no test coverage detected
searching dependent graphs…