Closed jeroentrappers closed 2 years ago
@wstrange can you take a look at this pull request?
Sorry - it was not clear to me that you wanted this merged.
How about making this an optional named parameter (relaxedParsing=false or strictParsing=true?) that leaves the default behavior unchanged. That way it won't be a breaking change. I think some users may want stricter parsing.
If you can also bump the minor version as well, and add a changelog entry
It's not really a matter of strict vs relaxed. The original library is just incomplete and the way it handled unsupported structures is not very useful outside the scope of what is supported. This change makes it possible to parse more general ASN.1 structures without the assumptions enforced by the library.
Hi Jeron - I think I understand the change.
I believe some users will want an exception to be generated if unhandled ASN1 is passed to the parser. For example - if the system is supposed to always send parsable ASN1, but there is an error in the server where it sends malformed bytes, they might want the parser to throw the exception instead of returning a generic ASN1 object. At least this is my read of the issue - but I can be convinced otherwise.
In your case you want to return the generic ASN1 object. If you added a named parameter, and kept the current default, that would solve your problem as I understand it, and it would not be a breaking change for any consumers.
Related - if the parser does not handle your desired ASN1 config, is it worth a PR to add the additional handling for your object types?
@jeroentrappers Are you still interested in landing this PR or should I close the PR? Thanks
No, you can close the PR, but the name of the library suggest it would be able to parse arbitrary ASN.1 structures, which it doesn't. Maybe the documentation should mention that it only supports a narrow subset of ASN.1 as used in x509 certificates.
Just to let you know that we created a fork for this. The ASN1 lib is incomplete and is not failing gracefully.
Don't merge this, because the pubspec is also updated ;-)