Initialization vector length handled differently than in MRI
-------------------------------------------------------------
Key: JRUBY-4012
URL: http://jira.codehaus.org/browse/JRUBY-4012
Project: JRuby
Issue Type: Bug
Components: OpenSSL
Affects Versions: JRuby 1.3
Environment: Windows Vista,
ruby 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin32],
jruby 1.3.0 (ruby 1.8.6p287) (2009-06-03 5dc2e22) (Java HotSpot(TM) Client VM
1.6.0-oem) [x86-java]
Reporter: Heath Anderson
Priority: Minor
The following works in MRI but not in JRuby:
-------------------------------------------------------------
des = OpenSSL::Cipher::Cipher.new("des-ede3-cbc")
des.encrypt
des.key = '0123456789abcdef01234567890'
des.iv = iv =
"ed87acdcca419954edccb736f7dc77a74f5ac8dfe3861c3d5f77248e21592131a5423d63ff91f07956ce1aa386f8359931b5"
# 100 characters
data = iv + data
puts data
-------------------------------------------------------------
JRuby expects the IV to be the correct length (8 characters in my example). If
provided with an IV that is too short JRuby gives back an appropriate 'iv
length to short (OpenSSL::Cipher::CipherError)' error, but when the IV is too
long a cryptic 'No message available (OpenSSL::Cipher::CipherError)' error is
given.
I don't know whether this should be considered a bug in JRuby or MRI, but a
more descriptive error on the JRuby side would be appreciated.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email