SSL - Secure Sockets Layer¶
pcapkit.protocols.application.ssl contains
SSL only,
which is the umbrella base class for the Secure Sockets Layer protocol
family [*] – the SSL versions, Transport Layer Security and Datagram TLS:
SSLv2– SSL 2.0, whose record layer shares no wire format with the others;TLS– SSLv3 and TLS 1.0 through TLS 1.3, withSSLv3as its thin subclass for explicit construction;DTLS– DTLS 1.0, 1.2 and 1.3.
SSL.id lists the direct
concrete subclasses, so a lookup keyed on SSL matches any of them.
The TLS record header (RFC 9846 Section 5.1) is a
ContentType, a legacy record version
and a length. The DTLS DTLSPlaintext header (RFC 9147 Section 4) has
the same fields plus an epoch and a 48-bit sequence number between the
version and the length, and DTLS adds a fragment header to each handshake
message. Each record header is declared in its subclass’s own schema, and
DTLS reads the epoch and sequence
number. This base class carries the logic the two share – content-type
dispatch, handshake-message decoding (including the DTLS fragment header), the
extension registry, and the record-level validation that keeps dispatch from
accepting bytes that cannot be a genuine record.
Added in version 1.6.0.
- class pcapkit.protocols.application.ssl.SSL[_PT: Data, _ST: Schema](file=None, length=None, **kwargs)[source]¶
Bases:
Application[_PT,_ST],Generic[_PT,_ST]Umbrella base class for the SSL protocol family: the SSL versions, TLS and DTLS.
SSL 2.0 (
SSLv2) [draft-hickman-netscape-ssl-00]Transport Layer Security, SSLv3 through TLS 1.3 (
TLS) [RFC 6101, RFC 5246, RFC 9846]Datagram TLS, DTLS 1.0 through DTLS 1.3 (
DTLS) [RFC 4347, RFC 6347, RFC 9147]
The
extension_dataof these extensions decodes, inClientHello,ServerHello,HelloRetryRequestandEncryptedExtensions:Extension Type
Extension Parser
Extension Constructor
- classmethod register_extension(code, meth)[source]¶
Register an extension parser.
- Parameters:
code (
ExtensionType) – TLS/DTLS extension type.meth (
str|tuple[Callable[[ExtensionType,bytes,HandshakeType],ExtensionData|bytes],Callable[[ExtensionType,ExtensionData|None,HandshakeType,Any],bytes]]) – Name of the_read_ext_${name}and_make_ext_${name}methods, or a(parser, constructor)pair of callables; see__extension__.
- Warns:
RegistryWarning– If a different entry is already registered forcode; it is overwritten. Handing back the entry already stored, or one equal to it, is a silent no-op. The entrycodeshipped with is accepted like any other, so an override can be undone (#1362, #1363).
- _read_ext_unknown(ext_type, data, *, msg_type)[source]¶
Read an extension with no decoder registered: its raw octets.
- Parameters:
ext_type (
ExtensionType) – Extension type.data (
bytes) –extension_dataoctets.msg_type (
HandshakeType) – Handshake message carrying the extension.
- Return type:
- Returns:
dataunchanged.
- _read_ext_server_name(ext_type, data, *, msg_type)[source]¶
Read a
server_nameextension.Structure of
ServerNameList[RFC 6066 Section 3]:struct { NameType name_type; select (name_type) { case host_name: HostName; } name; } ServerName; enum { host_name(0), (255) } NameType; opaque HostName<1..2^16-1>; struct { ServerName server_name_list<1..2^16-1> } ServerNameList;- Parameters:
ext_type (
ExtensionType) – Extension type.data (
bytes) –extension_dataoctets.msg_type (
HandshakeType) – Handshake message carrying the extension.
- Return type:
- Returns:
The decoded list; or
datawhen empty, as aServerHello’s and anEncryptedExtensions’ are.- Raises:
ProtocolError – If
datais malformed, or names a type other thanhost_name, whosenamehas no defined structure.
- _read_ext_supported_groups(ext_type, data, *, msg_type)[source]¶
Read a
supported_groupsextension.Structure of
NamedGroupList[RFC 9846 Section 4.3.7]:struct { NamedGroup named_group_list<2..2^16-1>; } NamedGroupList;- Parameters:
ext_type (
ExtensionType) – Extension type.data (
bytes) –extension_dataoctets.msg_type (
HandshakeType) – Handshake message carrying the extension.
- Return type:
- Returns:
The decoded list.
- Raises:
ProtocolError – If
datais malformed.
- _read_ext_signature_algorithms(ext_type, data, *, msg_type)[source]¶
Read a
signature_algorithmsextension.Structure of
SignatureSchemeList[RFC 9846 Section 4.3.3]:struct { SignatureScheme supported_signature_algorithms<2..2^16-2>; } SignatureSchemeList;- Parameters:
ext_type (
ExtensionType) – Extension type.data (
bytes) –extension_dataoctets.msg_type (
HandshakeType) – Handshake message carrying the extension.
- Return type:
- Returns:
The decoded list.
- Raises:
ProtocolError – If
datais malformed.
- _read_ext_alpn(ext_type, data, *, msg_type)[source]¶
Read an
application_layer_protocol_negotiationextension.Structure of
ProtocolNameList[RFC 7301 Section 3.1]:opaque ProtocolName<1..2^8-1>; struct { ProtocolName protocol_name_list<2..2^16-1> } ProtocolNameList;- Parameters:
ext_type (
ExtensionType) – Extension type.data (
bytes) –extension_dataoctets.msg_type (
HandshakeType) – Handshake message carrying the extension.
- Return type:
- Returns:
The decoded list.
- Raises:
ProtocolError – If
datais malformed.
- _read_ext_supported_versions(ext_type, data, *, msg_type)[source]¶
Read a
supported_versionsextension.Structure of
SupportedVersions[RFC 9846 Section 4.3.1]:struct { select (Handshake.msg_type) { case client_hello: ProtocolVersion versions<2..254>; case server_hello: /* and HelloRetryRequest */ ProtocolVersion selected_version; }; } SupportedVersions;- Parameters:
ext_type (
ExtensionType) – Extension type.data (
bytes) –extension_dataoctets.msg_type (
HandshakeType) – Handshake message carrying the extension.
- Return type:
SupportedVersionsClientHello|SupportedVersionsServerHello|bytes- Returns:
The decoded versions for
msg_type; ordatafor a message the structure does not cover.- Raises:
ProtocolError – If
datais malformed.
Read a
key_shareextension.Structure of
key_share[RFC 9846 Section 4.3.8]:struct { NamedGroup group; opaque key_exchange<1..2^16-1>; } KeyShareEntry; struct { KeyShareEntry client_shares<0..2^16-1>; } KeyShareClientHello; struct { NamedGroup selected_group; } KeyShareHelloRetryRequest; struct { KeyShareEntry server_share; } KeyShareServerHello;- Parameters:
ext_type (
ExtensionType) – Extension type.data (
bytes) –extension_dataoctets.msg_type (
HandshakeType) – Handshake message carrying the extension.
- Return type:
KeyShareClientHello|KeyShareHelloRetryRequest|KeyShareServerHello|bytes- Returns:
The decoded structure for
msg_type; ordatafor a message the structure does not cover.- Raises:
ProtocolError – If
datais malformed.
- _read_ext_connection_id(ext_type, data, *, msg_type)[source]¶
Read a
connection_idextension.Structure of
ConnectionId[RFC 9146 Section 3]:struct { opaque cid<0..2^8-1>; } ConnectionId;The extension is DTLS-only (RFC 9146 Section 10.2). A TLS hello carrying it does not conform, and it decodes all the same.
- Parameters:
ext_type (
ExtensionType) – Extension type.data (
bytes) –extension_dataoctets.msg_type (
HandshakeType) – Handshake message carrying the extension.
- Return type:
- Returns:
The decoded connection ID.
- Raises:
ProtocolError – If
datais malformed.
- _make_ext_unknown(ext_type, data=None, *, msg_type, **kwargs)[source]¶
Make an extension with no constructor registered.
- Parameters:
ext_type (
ExtensionType) – Extension type.data (
ExtensionData|None) – Decodedextension_data, which this type has no structure to write.msg_type (
HandshakeType) – Handshake message carrying the extension.**kwargs (
Any) – Arbitrary keyword arguments.
- Return type:
- Returns:
Empty
extension_datawhendataisNone.- Raises:
ProtocolError – If
datais given.
- _make_ext_server_name(ext_type, data=None, *, msg_type, server_name_list=(), **kwargs)[source]¶
Make a
server_nameextension.- Parameters:
ext_type (
ExtensionType) – Extension type.data (
ServerNameList|None) – Decodedextension_data.msg_type (
HandshakeType) – Handshake message carrying the extension.server_name_list (
Iterable[ServerName]) – Server names, ifdatais not given.**kwargs (
Any) – Arbitrary keyword arguments.
- Return type:
- Returns:
Constructed
extension_data.
- _make_ext_supported_groups(ext_type, data=None, *, msg_type, named_group_list=(), **kwargs)[source]¶
Make a
supported_groupsextension.- Parameters:
ext_type (
ExtensionType) – Extension type.data (
NamedGroupList|None) – Decodedextension_data.msg_type (
HandshakeType) – Handshake message carrying the extension.named_group_list (
Iterable[int]) –NamedGroupvalues, ifdatais not given.**kwargs (
Any) – Arbitrary keyword arguments.
- Return type:
- Returns:
Constructed
extension_data.
- _make_ext_signature_algorithms(ext_type, data=None, *, msg_type, supported_signature_algorithms=(), **kwargs)[source]¶
Make a
signature_algorithmsextension.- Parameters:
ext_type (
ExtensionType) – Extension type.data (
SignatureSchemeList|None) – Decodedextension_data.msg_type (
HandshakeType) – Handshake message carrying the extension.supported_signature_algorithms (
Iterable[int]) –SignatureSchemevalues, ifdatais not given.**kwargs (
Any) – Arbitrary keyword arguments.
- Return type:
- Returns:
Constructed
extension_data.
- _make_ext_alpn(ext_type, data=None, *, msg_type, protocol_name_list=(), **kwargs)[source]¶
Make an
application_layer_protocol_negotiationextension.- Parameters:
ext_type (
ExtensionType) – Extension type.data (
ProtocolNameList|None) – Decodedextension_data.msg_type (
HandshakeType) – Handshake message carrying the extension.protocol_name_list (
Iterable[bytes]) –ProtocolNameoctet strings, ifdatais not given.**kwargs (
Any) – Arbitrary keyword arguments.
- Return type:
- Returns:
Constructed
extension_data.
- _make_ext_supported_versions(ext_type, data=None, *, msg_type, versions=(), selected_version=None, **kwargs)[source]¶
Make a
supported_versionsextension.datadecides the structure when given,msg_typeotherwise.- Parameters:
ext_type (
ExtensionType) – Extension type.data (
SupportedVersionsClientHello|SupportedVersionsServerHello|None) – Decodedextension_data.msg_type (
HandshakeType) – Handshake message carrying the extension.versions (
Iterable[int]) –ProtocolVersionvalues for aClientHello, ifdatais not given.selected_version (
int|None) –ProtocolVersionselected by aServerHelloorHelloRetryRequest, ifdatais not given.**kwargs (
Any) – Arbitrary keyword arguments.
- Return type:
- Returns:
Constructed
extension_data.- Raises:
ProtocolError – If neither
datanormsg_typenames a structure, orselected_versionis missing.
Make a
key_shareextension.datadecides the structure when given,msg_typeotherwise.- Parameters:
ext_type (
ExtensionType) – Extension type.data (
KeyShareClientHello|KeyShareHelloRetryRequest|KeyShareServerHello|None) – Decodedextension_data.msg_type (
HandshakeType) – Handshake message carrying the extension.client_shares (
Iterable[KeyShareEntry]) – Key shares for aClientHello, ifdatais not given.selected_group (
int|None) –NamedGroupfor aHelloRetryRequest, ifdatais not given.server_share (
KeyShareEntry|None) – Key share for aServerHello, ifdatais not given.**kwargs (
Any) – Arbitrary keyword arguments.
- Return type:
- Returns:
Constructed
extension_data.- Raises:
ProtocolError – If neither
datanormsg_typenames a structure, or the argument it needs is missing.
- _make_ext_connection_id(ext_type, data=None, *, msg_type, cid=b'', **kwargs)[source]¶
Make a
connection_idextension.- Parameters:
ext_type (
ExtensionType) – Extension type.data (
ConnectionId|None) – Decodedextension_data.msg_type (
HandshakeType) – Handshake message carrying the extension.cid (
bytes) – Connection ID, ifdatais not given.**kwargs (
Any) – Arbitrary keyword arguments.
- Return type:
- Returns:
Constructed
extension_data.
- _validate_tls_record(schema, *, available, dtls)[source]¶
Reject octets that cannot be a genuine TLS/DTLS record.
Dispatch hands this class every payload on its port, most of them mid-stream continuations with no record header. Without this check any octets decode as a record: the content-type registry mints a member for unknown values, and a
lengthpast the buffer is zero-padded byFieldBase.unpack.- Parameters:
- Raises:
ProtocolError – If
schemacannot be a genuine record, so thatbeholder()degrades dispatch toRawinstead of accepting a fabricated one.- Return type:
Note
A record split across TCP segments is rejected too: this layer holds only a fragment of it, and reassembly is
TCP’s job.
- _tls_content_is_cleartext(content_type, fragment, *, dtls, epoch)[source]¶
Whether a record’s fragment is cleartext to decode structurally.
handshake,alertandchange_cipher_speccarry ciphertext once keys are derived, and the record header does not say so. Decoding ciphertext would fabricate content, or fail and lose the cleartext header toRaw.DTLS: epoch 0 is cleartext, any later epoch encrypted (RFC 9147 Section 4.2).
TLS:
handshakemust tile (_tls_handshake_tiles());alertmust be exactly 2 octets andchange_cipher_specexactly 1, which encryption overhead never yields.
Any other content type is reported as not cleartext.
- Parameters:
content_type (
ContentType) – Record content type.fragment (
bytes) – Record fragment, undecoded.dtls (
bool) – Whether this is a DTLS record.epoch (
int) – The DTLS record’s epoch; unused whendtlsis false.
- Return type:
- Returns:
Whether to decode
fragmentstructurally for its content type.
- _read_tls_content(content_type, fragment, *, dtls, epoch=0)[source]¶
Decode a record fragment by its content type.
- Parameters:
content_type (
ContentType) – Record content type.fragment (
bytes) – Record fragment, undecoded.dtls (
bool) – Whether this is a DTLS record, i.e. whether a handshake message carries DTLS’s fragment header.epoch (
int) – The DTLS record’s epoch, which says whether its fragment is encrypted; ignored whendtlsis false, since a TLS record header carries no equivalent.
- Return type:
- Returns:
A
tupleof handshake messages forhandshake, anAlertforalert, aChangeCipherSpecforchange_cipher_spec, orfragmentunchanged for every other content type – application data, heartbeat, ACK, and any content type this version does not name.- Raises:
ProtocolError – If
fragmentis malformed forcontent_type.
Notes
handshake,alertandchange_cipher_specare kept asbyteswhen_tls_content_is_cleartext()says they are encrypted.
- _make_tls_content(content_type, content, *, dtls)[source]¶
Encode a record fragment by its content type – the inverse of
_read_tls_content().- Parameters:
content_type (
ContentType) – Record content type.content (
Any) – Decoded record content, or already-encodedbytes.dtls (
bool) – Whether this is a DTLS record.
- Return type:
- Returns:
Encoded record fragment.
- _read_tls_handshake_messages(fragment, *, dtls)[source]¶
Decode a
handshakerecord fragment into its handshake messages.A record may coalesce several handshake messages.
- Parameters:
fragment (
bytes) – Record fragment, i.e. one or more concatenated handshake messages.dtls (
bool) – Whether each message carries DTLS’s fragment header (message_seq,fragment_offset,fragment_length; RFC 6347 Section 4.2.2) after the 4-octetmsg_type/lengthheader shared with TLS.
- Return type:
- Returns:
The decoded handshake messages, in order.
- Raises:
ProtocolError – If a message’s header or body runs past the end of
fragment.
Notes
Only an unfragmented
ClientHello,ServerHelloorEncryptedExtensionsbody is decoded; other bodies stay undecoded (#2437). A fragmented DTLS message is decoded once reassembled, bydtls_handshake()(#2440).
- _make_tls_handshake_messages(messages, *, dtls)[source]¶
Encode handshake messages back into a record fragment – the inverse of
_read_tls_handshake_messages().- Parameters:
messages (
tuple[Any,...]) – Handshake messages, as returned by_read_tls_handshake_messages(), or already-encodedbytesper message. A fragmented DTLS message’s body is its fragment’s octets, or the whole message, of which only the fragment’s range is written.dtls (
bool) – Whether to write DTLS’s fragment header after each message’smsg_type/lengthheader.
- Return type:
- Returns:
Encoded record fragment.
- Raises:
ProtocolError – If a fragmented DTLS message’s body does not yield exactly
fragment_lengthoctets, which a fragment carries (RFC 6347 Section 4.2.3).
- _read_tls_client_hello(body, *, dtls)[source]¶
Decode a
ClientHellohandshake message body.Structure of TLS’s
ClientHello[RFC 9846 Section 4.2.2]:uint16 ProtocolVersion; opaque Random[32]; uint8 CipherSuite[2]; /* Cryptographic suite selector */ struct { ProtocolVersion legacy_version = 0x0303; /* TLS v1.2 */ Random random; opaque legacy_session_id<0..32>; CipherSuite cipher_suites<2..2^16-2>; opaque legacy_compression_methods<1..2^8-1>; Extension extensions<7..2^16-1>; } ClientHello;DTLS inserts a
cookieafterlegacy_session_id[RFC 6347 Section 4.2.1, RFC 9147 Section 5.3]:struct { ProtocolVersion legacy_version = { 254,253 }; // DTLSv1.2 Random random; opaque legacy_session_id<0..32>; opaque legacy_cookie<0..2^8-1>; // DTLS CipherSuite cipher_suites<2..2^16-2>; opaque legacy_compression_methods<1..2^8-1>; Extension extensions<8..2^16-1>; } ClientHello;- Parameters:
- Return type:
- Returns:
Decoded
ClientHello.- Raises:
ProtocolError – If
bodyis malformed.
- _make_tls_client_hello(data, *, dtls)[source]¶
Encode a
ClientHellohandshake message body – the inverse of_read_tls_client_hello().- Parameters:
data (
ClientHello) – DecodedClientHello.dtls (
bool) – Whether this is a DTLSClientHello, i.e. whether to write thecookiefield.
- Return type:
- Returns:
Encoded message body.
- _read_tls_server_hello(body)[source]¶
Decode a
ServerHellohandshake message body, or aHelloRetryRequest’s, whoserandomis_HRR_RANDOM.Structure of
ServerHello[RFC 9846 Section 4.2.3]:struct { ProtocolVersion legacy_version = 0x0303; /* TLS v1.2 */ Random random; opaque legacy_session_id_echo<0..32>; CipherSuite cipher_suite; uint8 legacy_compression_method = 0; Extension extensions<6..2^16-1>; } ServerHello;- Parameters:
body (
bytes) – Message body.- Return type:
- Returns:
Decoded
ServerHello.- Raises:
ProtocolError – If
bodyis malformed.
- _make_tls_server_hello(data)[source]¶
Encode a
ServerHellohandshake message body – the inverse of_read_tls_server_hello().- Parameters:
data (
ServerHello) – DecodedServerHello.- Return type:
- Returns:
Encoded message body.
- _read_tls_encrypted_extensions(body)[source]¶
Decode an
EncryptedExtensionshandshake message body.Structure of
EncryptedExtensions[RFC 9846 Section 4.4.1]:struct { Extension extensions<0..2^16-1>; } EncryptedExtensions;- Parameters:
body (
bytes) – Message body.- Return type:
- Returns:
Decoded
EncryptedExtensions.- Raises:
ProtocolError – If
bodyis malformed.
- _make_tls_encrypted_extensions(data)[source]¶
Encode an
EncryptedExtensionshandshake message body – the inverse of_read_tls_encrypted_extensions().- Parameters:
data (
EncryptedExtensions) – DecodedEncryptedExtensions.- Return type:
- Returns:
Encoded message body.
- _read_tls_extensions(data, *, msg_type)[source]¶
Decode an extension list.
Structure of one extension [RFC 9846 Section 4.3]:
struct { ExtensionType extension_type; opaque extension_data<0..2^16-1>; } Extension;Each
extension_datais read by the parser__extension__registers for its type. The framing delimits it, so one its parser rejects with aProtocolErroris kept as its raw octets rather than failing the message. The parser runs in aCaughtByCallerblock, so that error is quiet: nothing is logged and no exception hook installed.- Parameters:
data (
bytes) – The extension list, i.e. one or more concatenated extensions, with no further length prefix of its own.msg_type (
HandshakeType) – Handshake message carrying the list, which the structure of some extensions depends on;hello_retry_requestfor aServerHellothat is aHelloRetryRequest.
- Return type:
- Returns:
The decoded extensions, in order.
- Raises:
ProtocolError – If an extension’s header or body runs past the end of
data.
- _make_tls_extensions(extensions, *, msg_type)[source]¶
Encode an extension list – the inverse of
_read_tls_extensions().Raw
extension_dataoctets are written as they are; anything else goes to the constructor__extension__registers for the type.- Parameters:
extensions (
Iterable[Extension|tuple[ExtensionType|int,dict[str,Any]]]) – Decoded extensions, or(type, kwargs)pairs for the registered constructor to build from.msg_type (
HandshakeType) – Handshake message carrying the list, as for_read_tls_extensions().
- Return type:
- Returns:
Encoded extension list, with no further length prefix of its own.
- Raises:
ProtocolError – If the type of a
(type, kwargs)pair is a name, abool, or a member or code the 16-bit extension type field cannot carry.
- __extension__: DefaultDict[ExtensionType | int, str | tuple[Callable[[ExtensionType, bytes, HandshakeType], ExtensionData | bytes], Callable[[ExtensionType, ExtensionData | None, HandshakeType, Any], bytes]]]¶
Extension type to method mapping, see
_read_tls_extensions()and_make_tls_extensions(). Astrvalue names the methods_read_ext_${name}and_make_ext_${name}, falling back to_read_ext_unknown()and_make_ext_unknown()when the class has no such method, as an unregistered type does; any other value is a(parser, constructor)pair of callables.
Data Models¶
- class pcapkit.protocols.data.application.tls.Handshake(*args, **kwargs)[source]¶
Bases:
DataData model for a TLS/DTLS handshake message.
bodyholds aClientHello,ServerHelloorEncryptedExtensionsfor those message types, and the raw, undecoded message body for every otherHandshakeType– message-TYPE-level framing only (#2437).- msg_type: HandshakeType¶
Handshake message type.
- body: ClientHello | ServerHello | EncryptedExtensions | bytes¶
Message body.
- class pcapkit.protocols.data.application.tls.ClientHello(version, random, session_id, cookie, cipher_suites, compression_methods, extensions)[source]¶
Bases:
DataData model for a TLS/DTLS
ClientHellohandshake message body.- cookie: bytes | None¶
DTLS’s
cookie(RFC 6347 Section 4.2.1; carried forward aslegacy_cookieby RFC 9147 Section 5.3), orNonefor TLS, whoseClientHellocarries no cookie field at all – distinct from DTLS’s empty cookie, which isb''.
- class pcapkit.protocols.data.application.tls.ServerHello(version, random, session_id, cipher_suite, compression_method, extensions)[source]¶
Bases:
DataData model for a TLS/DTLS
ServerHellohandshake message body.A
HelloRetryRequestshares the structure and is told apart by itsrandom(RFC 9846 Section 4.2.3); its extensions decode in the shapes aHelloRetryRequestgives them.
- class pcapkit.protocols.data.application.tls.EncryptedExtensions(extensions)[source]¶
Bases:
DataData model for a TLS/DTLS
EncryptedExtensionshandshake message body (RFC 9846 Section 4.4.1).
- class pcapkit.protocols.data.application.tls.Extension(type, data)[source]¶
Bases:
DataData model for a TLS/DTLS extension list entry (RFC 9846 Section 4.3).
dataholds the decodedextension_datawhereSSL.__extension__registers a decoder fortype, and the raw octets otherwise – including a body its decoder cannot read exactly, or one in a message whose structure for it the decoder does not know.- type: ExtensionType¶
Extension type.
- data: ExtensionData | bytes¶
Extension data – decoded, or the raw octets.
- class pcapkit.protocols.data.application.tls.ExtensionData(*args, **kwargs)[source]¶
Bases:
DataData model for a decoded TLS/DTLS
extension_datafield.Each subclass is the structure one
ExtensionTypecarries, named as its specification names it.
- class pcapkit.protocols.data.application.tls.ServerNameList(server_name_list)[source]¶
Bases:
ExtensionDataData model for the
server_nameextension (RFC 6066 Section 3).A
ServerHelloorEncryptedExtensionscarries the extension with emptyextension_data, which staysb''.- server_name_list: tuple[ServerName, ...]¶
Server names.
- class pcapkit.protocols.data.application.tls.ServerName(name_type, name)[source]¶
Bases:
DataData model for one
ServerNameof aserver_nameextension (RFC 6066 Section 3).
- class pcapkit.protocols.data.application.tls.NamedGroupList(named_group_list)[source]¶
Bases:
ExtensionDataData model for the
supported_groupsextension (RFC 9846 Section 4.3.7).
- class pcapkit.protocols.data.application.tls.SignatureSchemeList(supported_signature_algorithms)[source]¶
Bases:
ExtensionDataData model for the
signature_algorithmsextension (RFC 9846 Section 4.3.3).
- class pcapkit.protocols.data.application.tls.ProtocolNameList(protocol_name_list)[source]¶
Bases:
ExtensionDataData model for the
application_layer_protocol_negotiationextension (RFC 7301 Section 3.1).
- class pcapkit.protocols.data.application.tls.SupportedVersionsClientHello(versions)[source]¶
Bases:
ExtensionDataData model for a
ClientHello’ssupported_versionsextension (RFC 9846 Section 4.3.1).
- class pcapkit.protocols.data.application.tls.SupportedVersionsServerHello(selected_version)[source]¶
Bases:
ExtensionDataData model for a
ServerHello’s orHelloRetryRequest’ssupported_versionsextension (RFC 9846 Section 4.3.1).
Bases:
ExtensionDataData model for a
ClientHello’skey_shareextension (RFC 9846 Section 4.3.8).Key shares offered, most preferred first.
Bases:
ExtensionDataData model for a
HelloRetryRequest’skey_shareextension (RFC 9846 Section 4.3.8).NamedGroupthe server asks a retriedClientHelloto share.
Bases:
ExtensionDataData model for a
ServerHello’skey_shareextension (RFC 9846 Section 4.3.8).The server’s key share.
Bases:
DataData model for one
KeyShareEntryof akey_shareextension (RFC 9846 Section 4.3.8).NamedGroupof the key.
Key exchange information.
- class pcapkit.protocols.data.application.tls.ConnectionId(cid)[source]¶
Bases:
ExtensionDataData model for the
connection_idextension (RFC 9146 Section 3).The extension is DTLS-only (RFC 9146 Section 10.2); a TLS hello that carries it, which does not conform, decodes to this model all the same.
- class pcapkit.protocols.data.application.tls.Alert(level, description)[source]¶
Bases:
DataData model for a TLS/DTLS
Alertrecord.
- class pcapkit.protocols.data.application.tls.ChangeCipherSpec(msg)[source]¶
Bases:
DataData model for a TLS/DTLS
ChangeCipherSpecrecord.
Footnotes