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

Cipher#iv_len returns incorrect IV length for AES cipher in ECB mode #169

Open
revodoge opened this issue Jun 29, 2018 · 0 comments
Open

Comments

@revodoge
Copy link

Cipher#iv_len is not returning the proper value for an ECB mode AES cipher.

MRI:

2.5.1 :002 > OpenSSL::Cipher.new("AES-128-ECB").iv_len
 => 0

JRuby:

jruby-9.1.15.0 :002 > OpenSSL::Cipher.new("AES-128-ECB").iv_len
 => 16

Since ECB mode does not rely on an IV, else if ( "ECB".equals(mode) ) should be above if ( "AES".equals(base) ) here so it returns 0

https://github.com/jruby/jruby-openssl/blob/master/src/main/java/org/jruby/ext/openssl/Cipher.java#L630

@kares kares added this to the 0.10.5 milestone Mar 17, 2020
@kares kares removed this from the 0.10.5 milestone Apr 10, 2021
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

2 participants