scapy.layers.tls.extensions

TLS handshake extensions.

class scapy.layers.tls.extensions.OCSPStatusRequest

Bases: scapy.packet.Packet

This is the structure defined in RFC 6066, not in RFC 6960!

aliastypes
fields_desc
OCSPStatusRequest fields

respidlen

FieldLenField

None

respid

PacketListField

[]

reqextlen

FieldLenField

None

reqext

PacketField

b''

guess_payload_class(p)
class scapy.layers.tls.extensions.ProtocolListField(name, default, cls=None, count_from=None, length_from=None, next_cls_cb=None)

Bases: scapy.fields.PacketListField

i2repr(pkt, x)
class scapy.layers.tls.extensions.ProtocolName

Bases: scapy.packet.Packet

aliastypes
fields_desc
ProtocolName fields

len

FieldLenField

None

protocol

StrLenField

b''

guess_payload_class(p)
class scapy.layers.tls.extensions.ResponderID

Bases: scapy.packet.Packet

aliastypes
fields_desc
ResponderID fields

respidlen

FieldLenField

None

respid

StrLenField

b''

guess_payload_class(p)
class scapy.layers.tls.extensions.ServerLenField(name, default, length_of=None, fmt='H', count_of=None, adjust=<function FieldLenField.<lambda>>, fld=None)

Bases: scapy.fields.FieldLenField

There is no length when there are no servernames (as in a ServerHello).

addfield(pkt, s, val)
class scapy.layers.tls.extensions.ServerListField(name, default, cls=None, count_from=None, length_from=None, next_cls_cb=None)

Bases: scapy.fields.PacketListField

i2repr(pkt, x)
class scapy.layers.tls.extensions.ServerName

Bases: scapy.packet.Packet

aliastypes
fields_desc
ServerName fields

nametype

ByteEnumField

0

namelen

FieldLenField

None

servername

StrLenField

b''

guess_payload_class(p)
class scapy.layers.tls.extensions.TACertSHA1Hash

Bases: scapy.packet.Packet

aliastypes
fields_desc
TACertSHA1Hash fields

idtype

ByteEnumField

3

id

StrFixedLenField

None

guess_payload_class(p)
class scapy.layers.tls.extensions.TAKeySHA1Hash

Bases: scapy.packet.Packet

aliastypes
fields_desc
TAKeySHA1Hash fields

idtype

ByteEnumField

1

id

StrFixedLenField

None

guess_payload_class(p)
class scapy.layers.tls.extensions.TAPreAgreed

Bases: scapy.packet.Packet

aliastypes
fields_desc
TAPreAgreed fields

idtype

ByteEnumField

0

guess_payload_class(p)
class scapy.layers.tls.extensions.TAX509Name

Bases: scapy.packet.Packet

XXX Section 3.4 of RFC 4366. Implement a more specific DNField rather than current StrLenField.

aliastypes
fields_desc
TAX509Name fields

idtype

ByteEnumField

2

dnlen

FieldLenField

None

dn

StrLenField

b''

guess_payload_class(p)
class scapy.layers.tls.extensions.TLS_Ext_ALPN(_pkt='', post_transform=None, _internal=0, _underlayer=None, tls_session=None, **fields)

Bases: scapy.layers.tls.extensions.TLS_Ext_PrettyPacketList

aliastypes
fields_desc
TLS_Ext_ALPN fields

type

ShortEnumField

16

len

ShortField

None

protocolslen

FieldLenField

None

protocols

ProtocolListField

[]

class scapy.layers.tls.extensions.TLS_Ext_CSR(_pkt='', post_transform=None, _internal=0, _underlayer=None, tls_session=None, **fields)

Bases: scapy.layers.tls.extensions.TLS_Ext_Unknown

aliastypes
fields_desc
TLS_Ext_CSR fields

type

ShortEnumField

5

len

ShortField

None

stype

ByteEnumField

None

req

_StatusReqField

[]

class scapy.layers.tls.extensions.TLS_Ext_ClientAuthz(_pkt='', post_transform=None, _internal=0, _underlayer=None, tls_session=None, **fields)

Bases: scapy.layers.tls.extensions.TLS_Ext_Unknown

XXX Unsupported

aliastypes
fields_desc
TLS_Ext_ClientAuthz fields

type

ShortEnumField

7

len

ShortField

None

class scapy.layers.tls.extensions.TLS_Ext_ClientCertType(_pkt='', post_transform=None, _internal=0, _underlayer=None, tls_session=None, **fields)

Bases: scapy.layers.tls.extensions.TLS_Ext_Unknown

aliastypes
fields_desc
TLS_Ext_ClientCertType fields

type

ShortEnumField

9

len

ShortField

None

ctypeslen

FieldLenField

None

ctypes

FieldListField

[0, 1]

class scapy.layers.tls.extensions.TLS_Ext_ClientCertURL(_pkt='', post_transform=None, _internal=0, _underlayer=None, tls_session=None, **fields)

Bases: scapy.layers.tls.extensions.TLS_Ext_Unknown

aliastypes
fields_desc
TLS_Ext_ClientCertURL fields

type

ShortEnumField

2

len

ShortField

None

Bases: scapy.layers.tls.extensions.TLS_Ext_Unknown

aliastypes
fields_desc
TLS_Ext_Cookie fields

type

ShortEnumField

44

len

ShortField

None

cookielen

FieldLenField

None

cookie

XStrLenField

b''

class scapy.layers.tls.extensions.TLS_Ext_EarlyDataIndication(_pkt='', post_transform=None, _internal=0, _underlayer=None, tls_session=None, **fields)

Bases: scapy.layers.tls.extensions.TLS_Ext_Unknown

aliastypes
fields_desc
TLS_Ext_EarlyDataIndication fields

type

ShortEnumField

42

len

ShortField

None

class scapy.layers.tls.extensions.TLS_Ext_EarlyDataIndicationTicket(_pkt='', post_transform=None, _internal=0, _underlayer=None, tls_session=None, **fields)

Bases: scapy.layers.tls.extensions.TLS_Ext_Unknown

aliastypes
fields_desc
TLS_Ext_EarlyDataIndicationTicket fields

type

ShortEnumField

42

len

ShortField

None

max_early_data_size

IntField

0

class scapy.layers.tls.extensions.TLS_Ext_EncryptThenMAC(_pkt='', post_transform=None, _internal=0, _underlayer=None, tls_session=None, **fields)

Bases: scapy.layers.tls.extensions.TLS_Ext_Unknown

aliastypes
fields_desc
TLS_Ext_EncryptThenMAC fields

type

ShortEnumField

22

len

ShortField

None

class scapy.layers.tls.extensions.TLS_Ext_ExtendedMasterSecret(_pkt='', post_transform=None, _internal=0, _underlayer=None, tls_session=None, **fields)

Bases: scapy.layers.tls.extensions.TLS_Ext_Unknown

aliastypes
fields_desc
TLS_Ext_ExtendedMasterSecret fields

type

ShortEnumField

23

len

ShortField

None

class scapy.layers.tls.extensions.TLS_Ext_Heartbeat(_pkt='', post_transform=None, _internal=0, _underlayer=None, tls_session=None, **fields)

Bases: scapy.layers.tls.extensions.TLS_Ext_Unknown

aliastypes
fields_desc
TLS_Ext_Heartbeat fields

type

ShortEnumField

15

len

ShortField

None

heartbeat_mode

ByteEnumField

2

class scapy.layers.tls.extensions.TLS_Ext_KeyShare(_pkt='', post_transform=None, _internal=0, _underlayer=None, tls_session=None, **fields)

Bases: scapy.layers.tls.extensions.TLS_Ext_Unknown

aliastypes
fields_desc
TLS_Ext_KeyShare fields

type

ShortEnumField

51

len

ShortField

None

class scapy.layers.tls.extensions.TLS_Ext_MaxFragLen(_pkt='', post_transform=None, _internal=0, _underlayer=None, tls_session=None, **fields)

Bases: scapy.layers.tls.extensions.TLS_Ext_Unknown

aliastypes
fields_desc
TLS_Ext_MaxFragLen fields

type

ShortEnumField

1

len

ShortField

None

maxfraglen

ByteEnumField

4

class scapy.layers.tls.extensions.TLS_Ext_NPN(_pkt='', post_transform=None, _internal=0, _underlayer=None, tls_session=None, **fields)

Bases: scapy.layers.tls.extensions.TLS_Ext_PrettyPacketList

Defined in RFC-draft-agl-tls-nextprotoneg-03. Deprecated in favour of ALPN.

aliastypes
fields_desc
TLS_Ext_NPN fields

type

ShortEnumField

13172

len

FieldLenField

None

protocols

ProtocolListField

[]

class scapy.layers.tls.extensions.TLS_Ext_PSKKeyExchangeModes(_pkt='', post_transform=None, _internal=0, _underlayer=None, tls_session=None, **fields)

Bases: scapy.layers.tls.extensions.TLS_Ext_Unknown

aliastypes
fields_desc
TLS_Ext_PSKKeyExchangeModes fields

type

ShortEnumField

45

len

ShortField

None

kxmodeslen

FieldLenField

None

kxmodes

FieldListField

[]

class scapy.layers.tls.extensions.TLS_Ext_Padding(_pkt='', post_transform=None, _internal=0, _underlayer=None, tls_session=None, **fields)

Bases: scapy.layers.tls.extensions.TLS_Ext_Unknown

aliastypes
fields_desc
TLS_Ext_Padding fields

type

ShortEnumField

21

len

FieldLenField

None

padding

StrLenField

b''

class scapy.layers.tls.extensions.TLS_Ext_PostHandshakeAuth(_pkt='', post_transform=None, _internal=0, _underlayer=None, tls_session=None, **fields)

Bases: scapy.layers.tls.extensions.TLS_Ext_Unknown

aliastypes
fields_desc
TLS_Ext_PostHandshakeAuth fields

type

ShortEnumField

49

len

ShortField

None

class scapy.layers.tls.extensions.TLS_Ext_PreSharedKey(_pkt='', post_transform=None, _internal=0, _underlayer=None, tls_session=None, **fields)

Bases: scapy.layers.tls.extensions.TLS_Ext_Unknown

aliastypes
fields_desc
TLS_Ext_PreSharedKey fields

type

ShortEnumField

41

len

ShortField

None

class scapy.layers.tls.extensions.TLS_Ext_PrettyPacketList(_pkt='', post_transform=None, _internal=0, _underlayer=None, tls_session=None, **fields)

Bases: scapy.layers.tls.extensions.TLS_Ext_Unknown

Dummy extension used for server_name/ALPN/NPN for a lighter representation: the final field is showed as a 1-line list rather than as lots of packets. XXX Define a new condition for packet lists in Packet._show_or_dump?

aliastypes
fields_desc
TLS_Ext_PrettyPacketList fields

type

ShortEnumField

None

len

FieldLenField

None

val

StrLenField

b''

class scapy.layers.tls.extensions.TLS_Ext_RecordSizeLimit(_pkt='', post_transform=None, _internal=0, _underlayer=None, tls_session=None, **fields)

Bases: scapy.layers.tls.extensions.TLS_Ext_Unknown

aliastypes
fields_desc
TLS_Ext_RecordSizeLimit fields

type

ShortEnumField

28

len

ShortField

None

record_size_limit

ShortField

None

class scapy.layers.tls.extensions.TLS_Ext_RenegotiationInfo(_pkt='', post_transform=None, _internal=0, _underlayer=None, tls_session=None, **fields)

Bases: scapy.layers.tls.extensions.TLS_Ext_Unknown

aliastypes
fields_desc
TLS_Ext_RenegotiationInfo fields

type

ShortEnumField

65281

len

ShortField

None

reneg_conn_len

FieldLenField

None

renegotiated_connection

StrLenField

b''

class scapy.layers.tls.extensions.TLS_Ext_ServerAuthz(_pkt='', post_transform=None, _internal=0, _underlayer=None, tls_session=None, **fields)

Bases: scapy.layers.tls.extensions.TLS_Ext_Unknown

XXX Unsupported

aliastypes
fields_desc
TLS_Ext_ServerAuthz fields

type

ShortEnumField

8

len

ShortField

None

class scapy.layers.tls.extensions.TLS_Ext_ServerCertType(_pkt='', post_transform=None, _internal=0, _underlayer=None, tls_session=None, **fields)

Bases: scapy.layers.tls.extensions.TLS_Ext_Unknown

aliastypes
fields_desc
TLS_Ext_ServerCertType fields

type

ShortEnumField

9

len

ShortField

None

ctype

ByteEnumField

None

class scapy.layers.tls.extensions.TLS_Ext_ServerName(_pkt='', post_transform=None, _internal=0, _underlayer=None, tls_session=None, **fields)

Bases: scapy.layers.tls.extensions.TLS_Ext_PrettyPacketList

aliastypes
fields_desc
TLS_Ext_ServerName fields

type

ShortEnumField

0

len

FieldLenField

None

servernameslen

ServerLenField

None

servernames

ServerListField

[]

class scapy.layers.tls.extensions.TLS_Ext_SessionTicket(_pkt='', post_transform=None, _internal=0, _underlayer=None, tls_session=None, **fields)

Bases: scapy.layers.tls.extensions.TLS_Ext_Unknown

RFC 5077 updates RFC 4507 according to most implementations, which do not use another (useless) ‘ticketlen’ field after the global ‘len’ field.

aliastypes
fields_desc
TLS_Ext_SessionTicket fields

type

ShortEnumField

35

len

FieldLenField

None

ticket

StrLenField

b''

class scapy.layers.tls.extensions.TLS_Ext_SignatureAlgorithms(_pkt='', post_transform=None, _internal=0, _underlayer=None, tls_session=None, **fields)

Bases: scapy.layers.tls.extensions.TLS_Ext_Unknown

aliastypes
fields_desc
TLS_Ext_SignatureAlgorithms fields

type

ShortEnumField

13

len

ShortField

None

sig_algs_len

SigAndHashAlgsLenField

None

sig_algs

SigAndHashAlgsField

[]

class scapy.layers.tls.extensions.TLS_Ext_SignatureAlgorithmsCert(_pkt='', post_transform=None, _internal=0, _underlayer=None, tls_session=None, **fields)

Bases: scapy.layers.tls.extensions.TLS_Ext_Unknown

aliastypes
fields_desc
TLS_Ext_SignatureAlgorithmsCert fields

type

ShortEnumField

49

len

ShortField

None

sig_algs_len

SigAndHashAlgsLenField

None

sig_algs

SigAndHashAlgsField

[]

class scapy.layers.tls.extensions.TLS_Ext_SupportedEllipticCurves(_pkt='', post_transform=None, _internal=0, _underlayer=None, tls_session=None, **fields)

Bases: scapy.layers.tls.extensions.TLS_Ext_SupportedGroups

aliastypes
fields_desc
TLS_Ext_SupportedEllipticCurves fields

type

ShortEnumField

10

len

ShortField

None

groupslen

FieldLenField

None

groups

FieldListField

[]

class scapy.layers.tls.extensions.TLS_Ext_SupportedGroups(_pkt='', post_transform=None, _internal=0, _underlayer=None, tls_session=None, **fields)

Bases: scapy.layers.tls.extensions.TLS_Ext_Unknown

This extension was known as ‘Supported Elliptic Curves’ before TLS 1.3 merged both group selection mechanisms for ECDH and FFDH.

aliastypes
fields_desc
TLS_Ext_SupportedGroups fields

type

ShortEnumField

10

len

ShortField

None

groupslen

FieldLenField

None

groups

FieldListField

[]

class scapy.layers.tls.extensions.TLS_Ext_SupportedPointFormat(_pkt='', post_transform=None, _internal=0, _underlayer=None, tls_session=None, **fields)

Bases: scapy.layers.tls.extensions.TLS_Ext_Unknown

aliastypes
fields_desc
TLS_Ext_SupportedPointFormat fields

type

ShortEnumField

11

len

ShortField

None

ecpllen

FieldLenField

None

ecpl

FieldListField

[0]

class scapy.layers.tls.extensions.TLS_Ext_SupportedVersion_CH(_pkt='', post_transform=None, _internal=0, _underlayer=None, tls_session=None, **fields)

Bases: scapy.layers.tls.extensions.TLS_Ext_Unknown

aliastypes
fields_desc
TLS_Ext_SupportedVersion_CH fields

type

ShortEnumField

43

len

ShortField

None

versionslen

FieldLenField

None

versions

FieldListField

[]

class scapy.layers.tls.extensions.TLS_Ext_SupportedVersion_SH(_pkt='', post_transform=None, _internal=0, _underlayer=None, tls_session=None, **fields)

Bases: scapy.layers.tls.extensions.TLS_Ext_Unknown

aliastypes
fields_desc
TLS_Ext_SupportedVersion_SH fields

type

ShortEnumField

43

len

ShortField

None

version

ShortEnumField

None

class scapy.layers.tls.extensions.TLS_Ext_SupportedVersions(_pkt='', post_transform=None, _internal=0, _underlayer=None, tls_session=None, **fields)

Bases: scapy.layers.tls.extensions.TLS_Ext_Unknown

aliastypes
fields_desc
TLS_Ext_SupportedVersions fields

type

ShortEnumField

43

len

ShortField

None

class scapy.layers.tls.extensions.TLS_Ext_TicketEarlyDataInfo(_pkt='', post_transform=None, _internal=0, _underlayer=None, tls_session=None, **fields)

Bases: scapy.layers.tls.extensions.TLS_Ext_Unknown

aliastypes
fields_desc
TLS_Ext_TicketEarlyDataInfo fields

type

ShortEnumField

46

len

ShortField

None

max_early_data_size

IntField

0

class scapy.layers.tls.extensions.TLS_Ext_TruncatedHMAC(_pkt='', post_transform=None, _internal=0, _underlayer=None, tls_session=None, **fields)

Bases: scapy.layers.tls.extensions.TLS_Ext_Unknown

aliastypes
fields_desc
TLS_Ext_TruncatedHMAC fields

type

ShortEnumField

4

len

ShortField

None

class scapy.layers.tls.extensions.TLS_Ext_TrustedCAInd(_pkt='', post_transform=None, _internal=0, _underlayer=None, tls_session=None, **fields)

Bases: scapy.layers.tls.extensions.TLS_Ext_Unknown

aliastypes
fields_desc
TLS_Ext_TrustedCAInd fields

type

ShortEnumField

3

len

ShortField

None

talen

FieldLenField

None

ta

_TAListField

[]

class scapy.layers.tls.extensions.TLS_Ext_Unknown(_pkt='', post_transform=None, _internal=0, _underlayer=None, tls_session=None, **fields)

Bases: scapy.layers.tls.session._GenericTLSSessionInheritance

We put this here rather than in extensions.py in order to avoid circular imports…

aliastypes
fields_desc
TLS_Ext_Unknown fields

type

ShortEnumField

None

len

FieldLenField

None

val

StrLenField

b''

post_build(p, pay)
class scapy.layers.tls.extensions.TLS_Ext_UserMapping(_pkt='', post_transform=None, _internal=0, _underlayer=None, tls_session=None, **fields)

Bases: scapy.layers.tls.extensions.TLS_Ext_Unknown

aliastypes
fields_desc
TLS_Ext_UserMapping fields

type

ShortEnumField

6

len

ShortField

None

umlen

FieldLenField

None

um

FieldListField

[]