diff options
author | Ilya Etingof <etingof@gmail.com> | 2019-07-12 23:24:08 +0200 |
---|---|---|
committer | Ilya Etingof <etingof@gmail.com> | 2019-07-12 23:24:37 +0200 |
commit | bce62d5e146a83d3c2d003443875d16271e30a61 (patch) | |
tree | 2eb823ea8da98616788a92e987bfcb13636259d2 /pyasn1 | |
parent | 62efcb94b15ca7fbd5261ca999bf5eca5680de5f (diff) | |
download | pyasn1-git-bce62d5e146a83d3c2d003443875d16271e30a61.tar.gz |
Fix to pass decoder `options` to open type decoder
Prior to this fix, recursively encoded open types won't get
fully decoded all the way.
Diffstat (limited to 'pyasn1')
-rw-r--r-- | pyasn1/codec/ber/decoder.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/pyasn1/codec/ber/decoder.py b/pyasn1/codec/ber/decoder.py index 655af04..ddd8f83 100644 --- a/pyasn1/codec/ber/decoder.py +++ b/pyasn1/codec/ber/decoder.py @@ -681,7 +681,7 @@ class UniversalConstructedTypeDecoder(AbstractConstructedDecoder): component, rest = decodeFun( containerValue[pos].asOctets(), - asn1Spec=openType + asn1Spec=openType, **options ) containerValue[pos] = component @@ -689,7 +689,7 @@ class UniversalConstructedTypeDecoder(AbstractConstructedDecoder): else: component, rest = decodeFun( asn1Object.getComponentByPosition(idx).asOctets(), - asn1Spec=openType + asn1Spec=openType, **options ) asn1Object.setComponentByPosition(idx, component) @@ -741,7 +741,8 @@ class UniversalConstructedTypeDecoder(AbstractConstructedDecoder): if asn1Spec is None: return self._decodeComponents( - substrate, tagSet=tagSet, decodeFun=decodeFun, allowEoo=True, **options + substrate, tagSet=tagSet, decodeFun=decodeFun, + **dict(options, allowEoo=True) ) asn1Object = asn1Spec.clone() @@ -863,7 +864,7 @@ class UniversalConstructedTypeDecoder(AbstractConstructedDecoder): component, rest = decodeFun( containerValue[pos].asOctets(), - asn1Spec=openType, allowEoo=True + asn1Spec=openType, **dict(options, allowEoo=True) ) containerValue[pos] = component @@ -871,7 +872,7 @@ class UniversalConstructedTypeDecoder(AbstractConstructedDecoder): else: component, rest = decodeFun( asn1Object.getComponentByPosition(idx).asOctets(), - asn1Spec=openType, allowEoo=True + asn1Spec=openType, **dict(options, allowEoo=True) ) if component is not eoo.endOfOctets: |