Skip to content

fix load error: jopenssl/load -- java.lang.VerifyError: Bad type on operand stack when using bouncycastle 1.51 or 1.52 #62

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

Merged
merged 1 commit into from
Aug 15, 2015

Conversation

cheister
Copy link

This should fix #4

In BouncyCastle 1.51 they changed the hierarchy of ASN1ObjectIdentifier so it is a parent of DERObjectIdentifier instead of a descendant of it. In the code, if we pass a string id instead of the ASN1ObjectIdentifier object then BouncyCastle will create the correct ASN1ObjectIdentifier object.

…perand stack when using bouncycastle 1.51 or 1.52
@kares
Copy link
Member

kares commented Aug 14, 2015

thanks we'd appreciate a test-case esp. as we might still need to support at least BC 1.50 (> 1.50 was not fully really reviewed yet - not sure what's missing hopefully not match) and this might break older versions

@cheister
Copy link
Author

You can reproduce the error if you run mvn verify -P test-1.7.19 -Dbc.versions=1.51 or mvn verify -P test-1.7.19 -Dbc.versions=1.52.

mvn verify -P test-1.7.19 -Dbc.versions=1.50 passes with this change

It would be very surprising if this broke previous versions since the X509V3CertificateGenerator.addExtension(String, boolean, ASN1Encodable) method is just delegating to the X509V3CertificateGenerator.addExtension(DERObjectIdentifier, boolean, ASN1Encodable) method in 1.50 and the X509V3CertificateGenerator.addExtension(ASN1ObjectIdentifier, boolean, ASN1Encodable) in 1.51 and 1.52. https://github.com/bcgit/bc-java/blob/master/prov/src/main/java/org/bouncycastle/x509/X509V3CertificateGenerator.java#L225

@kares
Copy link
Member

kares commented Aug 15, 2015

understood, thanks for explaining this further.

kares added a commit that referenced this pull request Aug 15, 2015
fix load error: jopenssl/load -- java.lang.VerifyError: Bad type on operand stack when using bouncycastle 1.51 or 1.52
@kares kares merged commit 61aa256 into jruby:master Aug 15, 2015
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

Successfully merging this pull request may close these issues.

Bouncycastle 1.51 causes load error: jopenssl/load -- java.lang.VerifyError: Bad type on operand stack
2 participants