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

malformed certificate in existing store prevents opening the store at all #60

Open
janmaesiptor opened this issue Mar 5, 2019 · 1 comment

Comments

@janmaesiptor
Copy link

A malformed certificate in existing store prevents opening the store at all.
Starting with BouncyCastle version 1.58, stricter ASN1 decoding is enforced.

When opening a store that contains a certificate with malformed ASN1 integer encoding, BC doesn't load the keystore but instead throws an exception.

There's a BC option that can be set in System properties to to allow parsing of malformed ASN.1 integers in a similar fashion to what BC 1.56 did. The option is org.bouncycastle.asn1.allow_unsafe_integer.

Note that BC failing to load a PKCS12 store causes portecle to open it as a JKS store under java8+.
The same problem was shown in issue #57: this causes reduced functionality and possible keystore corruption.

@janmaesiptor
Copy link
Author

one-malformed-certificate.zip

Attached a zip containing a PKCS12 store with a malformed certificate as received from a communication partner. The keystore password is: one

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant