MCPcopy Create free account
hub / github.com/secdev/scapy / ASN1F_STRING_ENCAPS

Class ASN1F_STRING_ENCAPS

scapy/asn1fields.py:1010–1036  ·  view source on GitHub ↗

ASN1F_STRING that encapsulates a single ASN1 packet.

Source from the content-addressed store, hash-verified

1008
1009
1010class ASN1F_STRING_ENCAPS(ASN1F_STRING_PacketField):
1011 """
1012 ASN1F_STRING that encapsulates a single ASN1 packet.
1013 """
1014
1015 def __init__(self,
1016 name, # type: str
1017 default, # type: Optional[ASN1_Packet]
1018 cls, # type: Type[ASN1_Packet]
1019 context=None, # type: Optional[Any]
1020 implicit_tag=None, # type: Optional[int]
1021 explicit_tag=None, # type: Optional[int]
1022 ):
1023 # type: (...) -> None
1024 self.cls = cls
1025 super(ASN1F_STRING_ENCAPS, self).__init__(
1026 name,
1027 default and bytes(default), # type: ignore
1028 context=context,
1029 implicit_tag=implicit_tag,
1030 explicit_tag=explicit_tag
1031 )
1032
1033 def m2i(self, pkt, s): # type: ignore
1034 # type: (ASN1_Packet, bytes) -> Tuple[ASN1_Packet, bytes]
1035 val = super(ASN1F_STRING_ENCAPS, self).m2i(pkt, s)
1036 return self.cls(val[0].val, _underlayer=pkt), val[1]

Callers 5

SPNEGO_MechListMICClass · 0.90
PA_PK_AS_REQClass · 0.90
DHRepInfoClass · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…