Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: JRuby-OpenSSL 0.6
-
Fix Version/s: JRuby-OpenSSL 0.7
-
Component/s: OpenSSL
-
Labels:None
-
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]
-
Number of attachments :
Description
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.
What version of the jruby-openssl gem is being used?
I was unable to reproduce the error with jruby 1.5.0dev and jruby-openssl 0.5.2.