pyderasn.py | 15 ++++++++------- diff --git a/pyderasn.py b/pyderasn.py index 887256bc9b1e697ecac32338d18a835672590488fabebf2d76cfe3c4329dc283..e5d3f2b0fe3c7e1545acbc72cd692f94d64171de5c01c9c32babc301495b1960 100755 --- a/pyderasn.py +++ b/pyderasn.py @@ -5816,13 +5816,14 @@ ) tail = v[EOC_LEN:] obj.lenindef = True obj._value = values - if not obj.ready: - raise DecodeError( - "not all values are ready", - klass=self.__class__, - decode_path=decode_path, - offset=offset, - ) + for name, spec in iteritems(self.specs): + if name not in values and not spec.optional: + raise DecodeError( + "%s value is not ready" % name, + klass=self.__class__, + decode_path=decode_path, + offset=offset, + ) obj.ber_encoded = ber_encoded return obj, tail