Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Critical
-
Resolution: Fixed
-
Affects Version/s: JRuby 1.4
-
Fix Version/s: None
-
Component/s: OpenSSL
-
Labels:None
-
Environment:HideLinux darkkhaki 2.6.31-8-generic #28-Ubuntu SMP Thu Aug 27 14:43:30 UTC 2009 i686 GNU/Linux
jruby 1.4.0dev (ruby 1.8.7p174) (2009-08-20 6586) (Java HotSpot(TM) Client VM 1.6.0_15) [i386-java]
ruby 1.9.1p129 (2009-05-12 revision 23412) [i686-linux]
ShowLinux darkkhaki 2.6.31-8-generic #28-Ubuntu SMP Thu Aug 27 14:43:30 UTC 2009 i686 GNU/Linux jruby 1.4.0dev (ruby 1.8.7p174) (2009-08-20 6586) (Java HotSpot(TM) Client VM 1.6.0_15) [i386-java] ruby 1.9.1p129 (2009-05-12 revision 23412) [i686-linux]
-
Testcase included:yes
-
Patch Submitted:Yes
-
Number of attachments :
Description
OpenSSL::Cipher::RC2 doesn't work with jruby,
I always get the error No message available
test_rc2(TestCipher):
OpenSSL::Cipher::CipherError: No message available
test/test_cipher.rb:69:in `do_repeated_encrypt_test'
test/test_cipher.rb:57:in `do_repeated_test'
test/test_cipher.rb:47:in `test_rc2'
below are the attached outcomes of running a testcase for this issue in jruby and ruby 1.9.1.
I also attach a patch for the test I've done.
The added code was:
+ def test_rc2
+ do_repeated_test(
+ "RC2",
+ "foobarbazboofarf",
+ "\x18imZ\x9Ed\x15\xF3\xD6\xE6M\xCDf\xAA\xD3\xFE",
+ "\xEF\xF7\x16\x06\x93)-##\xB2~\xAD,\xAD\x82\xF5"
+ )
+ end
+
lribeiro@darkkhaki:~/Work/tools/jruby-openssl$ jruby test/test_cipher.rb
Loaded suite test/test_cipher
Started
.E.F
Finished in 1.085 seconds.
1) Error:
test_rc2(TestCipher):
OpenSSL::Cipher::CipherError: No message available
test/test_cipher.rb:69:in `do_repeated_encrypt_test'
test/test_cipher.rb:57:in `do_repeated_test'
test/test_cipher.rb:47:in `test_rc2'
2) Failure:
test_repeated_des(TestCipher)
[test/test_cipher.rb:69:in `do_repeated_encrypt_test'
test/test_cipher.rb:57:in `do_repeated_test'
test/test_cipher.rb:28:in `test_repeated_des']:
<":\022Q\211ex\370\332\374\274\214\356\301\260V\025"> expected but was
<"\354Z\335\327\t\344Up\374.P\370\204\254\332}">.
4 tests, 5 assertions, 1 failures, 1 errors
lribeiro@darkkhaki:~/Work/tools/jruby-openssl$ ruby test/test_cipher.rb
Loaded suite test/test_cipher
Started
test/test_cipher.rb:18: warning: argumtents for OpenSSL::Cipher::Cipher#encrypt and OpenSSL::Cipher::Cipher#decrypt were deprecated; use OpenSSL::Cipher::Cipher#pkcs5_keyivgen to derive key and IV
....
Finished in 0.000513 seconds.
4 tests, 12 assertions, 0 failures, 0 errors, 0 skips
Yes, we could use a fix for this...