|
31 | 31 | BER_tagging_enc, |
32 | 32 | ) |
33 | 33 | from scapy.base_classes import BasePacket |
34 | | -from scapy.compat import raw |
35 | 34 | from scapy.volatile import ( |
36 | 35 | GeneralizedTime, |
37 | 36 | RandChoice, |
@@ -489,6 +488,7 @@ def m2i(self, pkt, s): |
489 | 488 | obj.set_val(pkt, None) |
490 | 489 | else: |
491 | 490 | for obj in self.seq: |
| 491 | + # DEBUG: print(repr(obj), repr) |
492 | 492 | try: |
493 | 493 | s = obj.dissect(pkt, s) |
494 | 494 | except ASN1F_badsequence: |
@@ -599,7 +599,7 @@ def build(self, pkt): |
599 | 599 | elif val is None: |
600 | 600 | s = b"" |
601 | 601 | else: |
602 | | - s = b"".join(raw(i) for i in val) |
| 602 | + s = b"".join(bytes(i) for i in val) |
603 | 603 | return self.i2m(pkt, s) |
604 | 604 |
|
605 | 605 | def i2repr(self, pkt, x): |
@@ -769,7 +769,7 @@ def i2m(self, pkt, x): |
769 | 769 | if x is None: |
770 | 770 | s = b"" |
771 | 771 | else: |
772 | | - s = raw(x) |
| 772 | + s = bytes(x) |
773 | 773 | if hash(type(x)) in self.pktchoices: |
774 | 774 | imp, exp = self.pktchoices[hash(type(x))] |
775 | 775 | s = BER_tagging_enc(s, |
@@ -852,11 +852,11 @@ def i2m(self, |
852 | 852 | s = x |
853 | 853 | elif isinstance(x, ASN1_Object): |
854 | 854 | if x.val: |
855 | | - s = raw(x.val) |
| 855 | + s = bytes(x.val) |
856 | 856 | else: |
857 | 857 | s = b"" |
858 | 858 | else: |
859 | | - s = raw(x) |
| 859 | + s = bytes(x) |
860 | 860 | if not hasattr(x, "ASN1_root"): |
861 | 861 | # A normal Packet (!= ASN1) |
862 | 862 | return s |
@@ -897,7 +897,7 @@ def __init__(self, |
897 | 897 | self.cls = cls |
898 | 898 | super(ASN1F_BIT_STRING_ENCAPS, self).__init__( # type: ignore |
899 | 899 | name, |
900 | | - default and raw(default), |
| 900 | + default and bytes(default), |
901 | 901 | context=context, |
902 | 902 | implicit_tag=implicit_tag, |
903 | 903 | explicit_tag=explicit_tag |
|
0 commit comments