Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

handle non-caching of long tags properly #6

Merged
merged 1 commit into from Mar 25, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion pyasn1/codec/ber/decoder.py
Expand Up @@ -651,7 +651,9 @@ def __call__(self, substrate, asn1Spec=None, tagSet=None,
tagClass = t&0xC0
tagFormat = t&0x20
tagId = t&0x1F
short = True
if tagId == 0x1F:
short = False
tagId = 0
while 1:
if not substrate:
Expand All @@ -666,7 +668,7 @@ def __call__(self, substrate, asn1Spec=None, tagSet=None,
lastTag = tag.Tag(
tagClass=tagClass, tagFormat=tagFormat, tagId=tagId
)
if tagId < 31:
if short:
# cache short tags
self.__tagCache[firstOctet] = lastTag
if tagSet is None:
Expand Down