-
Notifications
You must be signed in to change notification settings - Fork 161
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
Problem with decoding custom ASN1 messages #85
Comments
I checked this point using another lib (https://www.npmjs.com/package/asn1js)
and saw this object:
the most interesting thing is a field:
which is not valid for us but, we also have another value from this object
which is exactly what we need and of course I wouldn't want to use this library, because I need process each value and also this library works twice as slow |
Actually it's not very difficult (while not very documented), you could do it like this: if (this.sub !== null) { // has inner structures
if (this.tag.tagConstructed)
// this is a constructed content (for sure)
else
// this is a (supposedly) encapsulated content
} |
BTW I'm not sure I understood this correctly, as the rest of you message seems (to me) to be about a structure which was erroneously decoded, not a structure that hasn't been decoded but should have been. Can you clarify? |
Hello!
Not necessarily a bug more of an issue when receiving messages from an application with specific rules
asn1js/asn1.js
Lines 442 to 450 in 6fa69ff
There are cases when an application specifically considers that the client should parse a BitString, however the recurse variable defined in Line 332:
is triggered. This cause the JS client to be unable to parse the correct value contained within it. It would be very nice to be able to force this variable to force under certain circumstances.
Example hex:
When decoding this, you can find the following data:
In this case the BitString should have just remained a BitString of length 128 but it gets decoded into an unknown type 9 with a length of 14 bytes.
The text was updated successfully, but these errors were encountered: