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

Adding support for auth_tag for GCM based crypto [WIP] #75

Closed
wants to merge 2 commits into from

Conversation

trashhalo
Copy link

This pr is far from mergable but it gives us enough to keep going with our migration from mri to jruby.

The issue is java 8 does not support using an IvParameterSpec with GCM as can be seen in this bug. SANTUARIO-392 so we added a conditional block to use the gcm spec object. Additionally, ruby 2 cipher supports getting ahold of the auth_tag but only after you call final, which we needed for our use case.

@kares
Copy link
Member

kares commented Oct 13, 2015

thanks, seems good. I believe a passing test or two could make this merge material ...

@trashhalo
Copy link
Author

@kares Sure I can clean this up!

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project jruby-openssl: Compilation failure: Compilation failure:
[ERROR] /home/travis/build/jruby/jruby-openssl/src/main/java/org/jruby/ext/openssl/Cipher.java:[49,25] cannot find symbol
[ERROR] symbol  : class GCMParameterSpec
[ERROR] location: package javax.crypto.spec
[ERROR] /home/travis/build/jruby/jruby-openssl/src/main/java/org/jruby/ext/openssl/Cipher.java:[49,25] cannot find symbol
[ERROR] symbol  : class GCMParameterSpec
[ERROR] location: package javax.crypto.spec
[ERROR] /home/travis/build/jruby/jruby-openssl/src/main/java/org/jruby/ext/openssl/Cipher.java:[1048,29] cannot find symbol
[ERROR] symbol  : class GCMParameterSpec
[ERROR] location: class org.jruby.ext.openssl.Cipher

So GCMParameterSpec was only added in java 7. Do you want me to check for its presence and use if available otherwise keep using Iv?

@kares
Copy link
Member

kares commented Oct 13, 2015

you can try to make this work in Java 7+ only and we're worry about making it Java 6 compatible later ...

@trashhalo
Copy link
Author

@kares If I am reading the travis output right build passed on all openjdk7+

@trashhalo trashhalo closed this Oct 21, 2015
@trashhalo
Copy link
Author

Closing the pr till we can get an end to end test working (doesnt seem to be working atm) jruby encrypted mri decrypted

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.

None yet

2 participants