OpenSSL::Cipher::RC2 doesn't work with jruby
--------------------------------------------

                 Key: JRUBY-3931
                 URL: http://jira.codehaus.org/browse/JRUBY-3931
             Project: JRuby
          Issue Type: Bug
          Components: OpenSSL
    Affects Versions: JRuby-OpenSSL 0.5.2, JRuby 1.4
         Environment: Linux 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]

            Reporter: Luis Landeiro Ribeiro
            Priority: Critical
         Attachments: testCipher.patch

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
+



lribe...@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
lribe...@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


-- 
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


Reply via email to