Skip to content
Snippets Groups Projects
Commit fac5abbd authored by mtu's avatar mtu
Browse files

Fix ASN1_enum_INTEGER representation

parent dba026d6
No related branches found
No related tags found
No related merge requests found
...@@ -185,7 +185,7 @@ class ASN1F_enum_INTEGER(ASN1F_INTEGER): ...@@ -185,7 +185,7 @@ class ASN1F_enum_INTEGER(ASN1F_INTEGER):
return self.any2i_one(pkt, x) return self.any2i_one(pkt, x)
def i2repr_one(self, pkt, x): def i2repr_one(self, pkt, x):
if x is not None: if x is not None:
r = self.i2s.get(x.val) r = self.i2s.get(x)
if r: if r:
return r + " " + repr(x) return r + " " + repr(x)
return repr(x) return repr(x)
...@@ -393,6 +393,10 @@ class ASN1F_optional(ASN1F_field): ...@@ -393,6 +393,10 @@ class ASN1F_optional(ASN1F_field):
if self._field.is_empty(pkt): if self._field.is_empty(pkt):
return "" return ""
return self._field.build(pkt) return self._field.build(pkt)
def any2i(self, pkt, x):
return self._field.any2i(pkt, x)
def i2repr(self, pkt, x):
return self._field.i2repr(pkt, x)
class ASN1F_CHOICE(ASN1F_field): class ASN1F_CHOICE(ASN1F_field):
""" """
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment