X-Git-Url: http://www.git.cypherpunks.ru/?p=pyderasn.git;a=blobdiff_plain;f=pyderasn.py;h=ed5b763ccef4123c790d52569d9b376ef2acf168;hp=ea1b0b926ca295cea669fedaa2ed7d2c279f7f98;hb=ad6ac8681ad5479b7274165a056624433e0ca2f1;hpb=a5f63bdd812919be17945607d974825895448804 diff --git a/pyderasn.py b/pyderasn.py index ea1b0b9..ed5b763 100755 --- a/pyderasn.py +++ b/pyderasn.py @@ -5816,13 +5816,14 @@ class Set(Sequence): 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