|
20 | 20 | SigAndHashAlgsField, _tls_hash_sig) |
21 | 21 | from scapy.layers.tls.session import _GenericTLSSessionInheritance |
22 | 22 | from scapy.layers.tls.crypto.groups import _tls_named_groups |
| 23 | +from scapy.layers.tls.crypto.suites import _tls_cipher_suites |
23 | 24 | from scapy.themes import AnsiColorTheme |
24 | 25 | from scapy.compat import raw |
25 | 26 | from scapy.config import conf |
|
61 | 62 | 0x33: "key_share", |
62 | 63 | 0x3374: "next_protocol_negotiation", |
63 | 64 | # RFC-draft-agl-tls-nextprotoneg-03 |
64 | | - 0xff01: "renegotiation_info" # RFC 5746 |
| 65 | + 0xff01: "renegotiation_info", # RFC 5746 |
| 66 | + 0xffce: "encrypted_server_name" |
65 | 67 | } |
66 | 68 |
|
67 | 69 |
|
@@ -182,6 +184,27 @@ class TLS_Ext_ServerName(TLS_Ext_PrettyPacketList): # RFC 4366 |
182 | 184 | length_from=lambda pkt: pkt.servernameslen)] |
183 | 185 |
|
184 | 186 |
|
| 187 | +class TLS_Ext_EncryptedServerName(TLS_Ext_PrettyPacketList): |
| 188 | + name = "TLS Extension - Encrypted Server Name" |
| 189 | + fields_desc = [ShortEnumField("type", 0xffce, _tls_ext), |
| 190 | + ShortField("len", None), |
| 191 | + EnumField("cipher", None, _tls_cipher_suites), |
| 192 | + ShortEnumField("key_exchange_group", None, |
| 193 | + _tls_named_groups), |
| 194 | + FieldLenField("key_exchange_len", None, |
| 195 | + length_of="key_exchange", fmt="H"), |
| 196 | + XStrLenField("key_exchange", "", |
| 197 | + length_from=lambda pkt: pkt.key_exchange_len), |
| 198 | + FieldLenField("record_digest_len", |
| 199 | + None, length_of="record_digest"), |
| 200 | + XStrLenField("record_digest", "", |
| 201 | + length_from=lambda pkt: pkt.record_digest_len), |
| 202 | + FieldLenField("encrypted_sni_len", None, |
| 203 | + length_of="encrypted_sni", fmt="H"), |
| 204 | + XStrLenField("encrypted_sni", "", |
| 205 | + length_from=lambda pkt: pkt.encrypted_sni_len)] |
| 206 | + |
| 207 | + |
185 | 208 | class TLS_Ext_MaxFragLen(TLS_Ext_Unknown): # RFC 4366 |
186 | 209 | name = "TLS Extension - Max Fragment Length" |
187 | 210 | fields_desc = [ShortEnumField("type", 1, _tls_ext), |
@@ -669,7 +692,8 @@ class TLS_Ext_RecordSizeLimit(TLS_Ext_Unknown): # RFC 8449 |
669 | 692 | # 0x2f: TLS_Ext_CertificateAuthorities, #XXX |
670 | 693 | # 0x30: TLS_Ext_OIDFilters, #XXX |
671 | 694 | 0x3374: TLS_Ext_NPN, |
672 | | - 0xff01: TLS_Ext_RenegotiationInfo |
| 695 | + 0xff01: TLS_Ext_RenegotiationInfo, |
| 696 | + 0xffce: TLS_Ext_EncryptedServerName |
673 | 697 | } |
674 | 698 |
|
675 | 699 |
|
|
0 commit comments