From fac5abbd3880e3d7655c9b7054ff98098db74fef Mon Sep 17 00:00:00 2001
From: mtu <maxence.tury@ssi.gouv.fr>
Date: Mon, 25 Jan 2016 16:31:59 +0100
Subject: [PATCH] Fix ASN1_enum_INTEGER representation

---
 scapy/asn1fields.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/scapy/asn1fields.py b/scapy/asn1fields.py
index 97e6f954..c7c364e7 100644
--- a/scapy/asn1fields.py
+++ b/scapy/asn1fields.py
@@ -185,7 +185,7 @@ class ASN1F_enum_INTEGER(ASN1F_INTEGER):
             return self.any2i_one(pkt, x)        
     def i2repr_one(self, pkt, x):
         if x is not None:
-            r = self.i2s.get(x.val)
+            r = self.i2s.get(x)
             if r:
                 return r + " " + repr(x)
         return repr(x)
@@ -393,6 +393,10 @@ class ASN1F_optional(ASN1F_field):
         if self._field.is_empty(pkt):
             return ""
         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):
     """
-- 
GitLab