bc-java icon indicating copy to clipboard operation
bc-java copied to clipboard

bc-java 1.75 fails to parse (admittedly invalid) certificates that used to be parseable

Open pjsg opened this issue 2 years ago • 3 comments

We use bc-java to parse certificates but 1.75 fails to parse some invalid certificates (which are mostly valid). Ideally bc would return more information about the failure rather than just throw an IllegalArgumentException.

Suggest that a subclass of IllegalArgumentException be thrown with more information about why the certificate was invalid.

I can make this change.....

pjsg avatar Oct 16 '23 14:10 pjsg

Yes, if you would like to submit a pull request, I'd be happy to look at it. Curious to know what the errors are, I'm guessing they may be about malformed integers?

dghgit avatar Oct 17 '23 03:10 dghgit

I stuck up a WIP PR: #1511 which is the functional code that implements the change. I haven't added tests for the changes yet (the actual tests that I have been using are in our private repo which makes use of BC). If this approach seems reasonable, then I'll go ahead and do that.

Some of the issues are malformed integers, but there are others as well -- invalid version numbers etc.

pjsg avatar Oct 19 '23 14:10 pjsg