More reliable way to determine if we are decoded
authorSergey Matveev <stargrave@stargrave.org>
Tue, 3 Oct 2017 06:39:31 +0000 (09:39 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Tue, 3 Oct 2017 10:05:49 +0000 (13:05 +0300)
CHOICE does not have llen. NULL does not have vlen.

pyderasn.py

index 476e4e8bd7d60a1b174276fbeb99c4c3366c130d..5c311e09c11d2c39eed450a0d2f768bd195f1bea 100755 (executable)
@@ -717,7 +717,7 @@ class Obj(object):
     def decoded(self):
         """Is object decoded?
         """
-        return self.llen > 0
+        return (self.llen + self.vlen) > 0
 
     def copy(self):  # pragma: no cover
         """Make a copy of object, safe to be mutated