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

openssl net-ssh camellia192 tests fails with jruby9k #2515

Open
mfazekas opened this issue Jan 24, 2015 · 2 comments
Open

openssl net-ssh camellia192 tests fails with jruby9k #2515

mfazekas opened this issue Jan 24, 2015 · 2 comments

Comments

@mfazekas
Copy link

net-ssh master fails on travis-ci with jruby-head.
I haven't looked in details but looks like the ivlen returned is 8 for camellia-192-cbc and it should be 16?

https://travis-ci.org/mfazekas/net-ssh/jobs/48157060

cipher = OpenSSL::Cipher::Cipher.new(ossl_name)
...
puts "Cipher: #{name} #{ossl_name} ivlen:#{cipher.iv_len} keylen:#{cipher.key_len}"
Cipher: camellia192-cbc@openssh.org camellia-192-cbc ivlen:8 keylen:24
E
================================================================================
Error: test_camellia192_cbc_for_decryption(Transport::TestCipherFactory)
: OpenSSL::Cipher::CipherError: IV must be 16 bytes long.
org/jruby/ext/openssl/Cipher.java:1086:in `update'
/home/travis/build/mfazekas/net-ssh/test/transport/test_cipher_factory.rb:437:in `decrypt'
/home/travis/build/mfazekas/net-ssh/test/transport/test_cipher_factory.rb:266:in `test_camellia192_cbc_for_decryption'
     263:         assert_equal CAMELLIA192_CBC, encrypt("camellia192-cbc@openssh.org")
     264:       end
     265:       def test_camellia192_cbc_for_decryption
  => 266:         assert_equal TEXT, decrypt("camellia192-cbc@openssh.org", CAMELLIA192_CBC)
     267:       end
     268:     end
     269: 
================================================================================
Cipher: camellia192-cbc@openssh.org camellia-192-cbc ivlen:8 keylen:24
E
================================================================================
Error: test_camellia192_cbc_for_encryption(Transport::TestCipherFactory)
: OpenSSL::Cipher::CipherError: IV must be 16 bytes long.
org/jruby/ext/openssl/Cipher.java:1086:in `update'
/home/travis/build/mfazekas/net-ssh/test/transport/test_cipher_factory.rb:430:in `encrypt'
/home/travis/build/mfazekas/net-ssh/test/transport/test_cipher_factory.rb:263:in `test_camellia192_cbc_for_encryption'
     260:     if_supported?("camellia192-cbc@openssh.org") do
     261:       CAMELLIA192_CBC = "\x82\xB2\x03\x90\xFA\f2\xA0\xE3\xFA\xF2B\xAB\xDBX\xD5\x04z\xD4G\x19\xB8\xAB\v\x85\x84\xCD:.\xBA\x9Dd\xD5(\xEB.\n\xAA]\xCB\xF3\x0F4\x8Bd\xF8m\xC9!\xE2\xA1=\xEBY\xA6\x83\x86\n\x13\e6\v\x06\xBBNJg\xF2-\x14',[\xC1\xB1.\x85\xF3\xC6\xBF\x1Ff\xCE\x87'\x9C\xB2\xC8!\xF3|\xE2\xD2\x9E\x96\xA1"
     262:       def test_camellia192_cbc_for_encryption
  => 263:         assert_equal CAMELLIA192_CBC, encrypt("camellia192-cbc@openssh.org")
     264:       end
     265:       def test_camellia192_cbc_for_decryption
     266:         assert_equal TEXT, decrypt("camellia192-cbc@openssh.org", CAMELLIA192_CBC)
@mkristian
Copy link
Member

this looks more like a bug in jruby-openssl-0.9.6.gem which ships with
jruby-9k.

should fail with jruby-1.7.x and jruby-openssl-0.9.6 in the same manner.

looking at https://www.rfc-editor.org/rfc/rfc3657.txt I would say the IV
should be 16 bytes long !?

@mfazekas
Copy link
Author

with jruby 1.7.18 (1.9.3p551) the tests are passing, as we skip camellia tests there: https://travis-ci.org/mfazekas/net-ssh/jobs/48157062 i guess that's with old version of the gem

@kares kares added the openssl label Jun 4, 2015
headius added a commit that referenced this issue Oct 30, 2019
=== 2.7.10 / 2019-06-14

Minor enhancements:

* Fix bundler rubygems binstub not properly looking for bundler. Pull request #2426
  by David Rodríguez.
* [BudlerVersionFinder] set .filter! and .compatible? to match only on major versions.
  Pull request #2515 by Colby Swandale.
+ Update for compatibilty with new minitest. Pull request #2118 by MSP-Greg.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants