scapy.layers.tls.keyexchange_tls13

TLS 1.3 key exchange logic.

class scapy.layers.tls.keyexchange_tls13.KeyShareEntry(*args, **kargs)

Bases: scapy.packet.Packet

When building from scratch, we create a DH private key, and when dissecting, we create a DH public key. Default group is secp256r1.

aliastypes
create_privkey(**kwargs)
do_build()

We need this hack, else ‘self’ would be replaced by __iter__.next().

extract_padding(s)
fields_desc
KeyShareEntry fields

group

ShortEnumField

None

kxlen

FieldLenField

None

key_exchange

StrLenField

b''

post_build(pkt, pay)
post_dissection(r)
privkey
pubkey
register_pubkey(**kwargs)
class scapy.layers.tls.keyexchange_tls13.PSKBinderEntry

Bases: scapy.packet.Packet

aliastypes
fields_desc
PSKBinderEntry fields

binder_len

FieldLenField

None

binder

StrLenField

b''

class scapy.layers.tls.keyexchange_tls13.PSKIdentity

Bases: scapy.packet.Packet

aliastypes
fields_desc
PSKIdentity fields

identity_len

FieldLenField

None

identity

TicketField

b''

obfuscated_ticket_age

IntField

0

class scapy.layers.tls.keyexchange_tls13.TLS_Ext_KeyShare_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_KeyShare_CH fields

type

ShortEnumField

51

len

ShortField

None

client_shares_len

FieldLenField

None

client_shares

PacketListField

[]

post_build(pkt, pay)
post_dissection(r)
class scapy.layers.tls.keyexchange_tls13.TLS_Ext_KeyShare_HRR(_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_HRR fields

type

ShortEnumField

51

len

ShortField

None

selected_group

ShortEnumField

None

class scapy.layers.tls.keyexchange_tls13.TLS_Ext_KeyShare_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_KeyShare_SH fields

type

ShortEnumField

51

len

ShortField

None

server_share

PacketField

None

post_build(pkt, pay)
post_dissection(r)
class scapy.layers.tls.keyexchange_tls13.TLS_Ext_PreSharedKey_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_PreSharedKey_CH fields

type

ShortEnumField

41

len

ShortField

None

identities_len

FieldLenField

None

identities

PacketListField

[]

binders_len

FieldLenField

None

binders

PacketListField

[]

class scapy.layers.tls.keyexchange_tls13.TLS_Ext_PreSharedKey_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_PreSharedKey_SH fields

type

ShortEnumField

41

len

ShortField

None

selected_identity

ShortField

None

class scapy.layers.tls.keyexchange_tls13.Ticket

Bases: scapy.packet.Packet

aliastypes
fields_desc
Ticket fields

key_name

StrFixedLenField

None

iv

StrFixedLenField

None

encstatelen

FieldLenField

None

encstate

StrLenField

b''

mac

StrFixedLenField

None

class scapy.layers.tls.keyexchange_tls13.TicketField(name, default, length_from=None, **kargs)

Bases: scapy.fields.PacketField

length_from
m2i(pkt, m)