-
-
Notifications
You must be signed in to change notification settings - Fork 51
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
BER: fix decoding of extended fields in sequence #351
Conversation
I think the solution here is adding the tag for extension additions, right? It shouldn't be that major, it would be just adding a |
Yeah, it might be better. I just noticed that decoding logic seems to rely on that assert and it cannot be modified easily. |
It was one rabbit hole of potential issues on the same area if we want to cover all the cases properly. I fixed also #272 at the same time and other improvements for explicit prefix related. However, I did not do the same for extension additions. It might add quite bit of complexity in there, as it feels like we need to repeat most functions for extension additions than normal types currently have if we want to get the error information upstream. Some Maybe there is a better way? Or maybe that error information is not necessary. |
Use of explicit prefix also drops the constraints for non-extended fields. |
I'll merge this for now, and let's address those issues in a followup.
I think it is necessary because we want to provide the best error information possible. Maybe we can reduce the codeine complexity with a macro so we are repeating ourselves less, but I don't think we can get around that need. |
BER currently does not handle the decoding of extended fields correctly.
decode_extension_addition
and function does not have the parameter), so assert of tag value will fail later inrasn/src/ber/de/parser.rs
Lines 23 to 25 in d1208da
I am not sure if it is possible to fix without major changes or complete removal of the assert, so I just changed assert to apply for non-universal tags.
Maybe cargo.lock update fixes the main as well?