scapy.contrib.automotive.autosar.secoc_canfd

SecOC PDU

class scapy.contrib.automotive.autosar.secoc_canfd.SecOC_CANFD(_pkt, /, *, flags=<Flag 0 ()>, identifier=0, length=None, fd_flags=<Flag 4 (fd_frame)>, reserved=0, pdu_payload=<Raw  |>, tfv=0, tmac=None)[source]

Bases: CANFD, SecOCMixin

aliastypes
classmethod dispatch_hook(s: bytes | None = None, *_args: Any, **_kwds: Any) Packet_metaclass[source]

dispatch_hook determines if PDU is protected by SecOC. If PDU is protected, SecOC_PDU will be returned, otherwise AutoSAR PDU will be returned.

extract_padding(s: bytes) Tuple[bytes, bytes | None][source]
fields_desc
Display RFC-like schema
 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|FLAGS|                        IDENTIFIER                       |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|     LENGTH    |    FD FLAGS   |            RESERVED           |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|          PDU PAYLOAD          |      TFV      |      TMAC     |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

                         Fig. SecOC_CANFD                         
SecOC_CANFD fields

flags

FlagsField

<Flag 0 ()>

identifier

XBitField (29 bits)

0

length

FieldLenField

None

fd_flags

FlagsField

<Flag 4 (fd_frame)>

reserved

ShortField

0

pdu_payload

PduPayloadField

<Raw  |>

tfv

XByteField

0

tmac

XStrFixedLenField

None

classmethod get_pdu_payload_cls(pkt: Packet, data: bytes) Packet[source]
get_secoc_payload() bytes[source]

Override this method for customization

secoc_authenticate() None[source]
secoc_verify() bool[source]