summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordelano <delano@solutious.com>2010-08-25 09:13:31 -0400
committerdelano <delano@solutious.com>2010-08-25 09:13:31 -0400
commit8a332480bec1b4c241c3cc240d855df4a044432c (patch)
tree7456c8547dd76e035f50347c698af0b068428770
parent33bb87e95d1e142d5b6a3b12f8460f415decbdda (diff)
downloadnet-ssh-8a332480bec1b4c241c3cc240d855df4a044432c.tar.gz
wip
-rw-r--r--THANKS.rdoc5
-rw-r--r--test/authentication/methods/test_hostbased.rb2
-rw-r--r--test/authentication/methods/test_publickey.rb2
-rw-r--r--test/authentication/test_agent.rb4
-rw-r--r--test/authentication/test_key_manager.rb4
-rw-r--r--test/test_key_factory.rb4
-rw-r--r--test/transport/kex/test_diffie_hellman_group1_sha1.rb4
-rw-r--r--test/transport/test_packet_stream.rb7
-rw-r--r--test/transport/test_state.rb10
9 files changed, 30 insertions, 12 deletions
diff --git a/THANKS.rdoc b/THANKS.rdoc
index d060dce..33317e7 100644
--- a/THANKS.rdoc
+++ b/THANKS.rdoc
@@ -5,7 +5,7 @@ contributions:
GOTOU Yuuzou <gotoyuzo@notwork.org>
* help and code related to OpenSSL
-Guillaume Marçais <guillaume.marcais@free.fr>
+Guillaume Marçais <guillaume.marcais@free.fr>
* support for communicating with the the PuTTY "pageant" process
Daniel Berger <djberg96@yahoo.com>
@@ -14,3 +14,6 @@ Daniel Berger <djberg96@yahoo.com>
Chris Andrews <chris@nodnol.org> and Lee Jensen <lee@outerim.com>
* support for ssh agent forwarding
+
+Hiroshi Nakamura
+ * fixed errors with JRuby tests \ No newline at end of file
diff --git a/test/authentication/methods/test_hostbased.rb b/test/authentication/methods/test_hostbased.rb
index 281c86d..599d402 100644
--- a/test/authentication/methods/test_hostbased.rb
+++ b/test/authentication/methods/test_hostbased.rb
@@ -75,7 +75,7 @@ module Authentication; module Methods
@@keys = nil
def keys
- @@keys ||= [OpenSSL::PKey::RSA.new(32), OpenSSL::PKey::DSA.new(32)]
+ @@keys ||= [OpenSSL::PKey::RSA.new(512), OpenSSL::PKey::DSA.new(512)]
end
def key_manager(options={})
diff --git a/test/authentication/methods/test_publickey.rb b/test/authentication/methods/test_publickey.rb
index f4f544f..94d7e3e 100644
--- a/test/authentication/methods/test_publickey.rb
+++ b/test/authentication/methods/test_publickey.rb
@@ -106,7 +106,7 @@ module Authentication; module Methods
@@keys = nil
def keys
- @@keys ||= [OpenSSL::PKey::RSA.new(32), OpenSSL::PKey::DSA.new(32)]
+ @@keys ||= [OpenSSL::PKey::RSA.new(512), OpenSSL::PKey::DSA.new(512)]
end
def key_manager(options={})
diff --git a/test/authentication/test_agent.rb b/test/authentication/test_agent.rb
index 248a3d7..5fc763b 100644
--- a/test/authentication/test_agent.rb
+++ b/test/authentication/test_agent.rb
@@ -96,7 +96,7 @@ module Authentication
def test_identities_should_augment_identities_with_comment_field
key1 = key
- key2 = OpenSSL::PKey::DSA.new(32)
+ key2 = OpenSSL::PKey::DSA.new(512)
socket.expect do |s, type, buffer|
assert_equal SSH2_AGENT_REQUEST_IDENTITIES, type
@@ -180,7 +180,7 @@ module Authentication
end
def key
- @key ||= OpenSSL::PKey::RSA.new(32)
+ @key ||= OpenSSL::PKey::RSA.new(512)
end
def socket
diff --git a/test/authentication/test_key_manager.rb b/test/authentication/test_key_manager.rb
index af8422b..dc8beda 100644
--- a/test/authentication/test_key_manager.rb
+++ b/test/authentication/test_key_manager.rb
@@ -84,12 +84,12 @@ module Authentication
key.expects(:public_key).returns(key)
end
- def rsa(size=32)
+ def rsa(size=512)
@rsa ||= OpenSSL::PKey::RSA.new(size)
end
def dsa
- @dsa ||= OpenSSL::PKey::DSA.new(32)
+ @dsa ||= OpenSSL::PKey::DSA.new(512)
end
def agent
diff --git a/test/test_key_factory.rb b/test/test_key_factory.rb
index e5a38bb..5ca574f 100644
--- a/test/test_key_factory.rb
+++ b/test/test_key_factory.rb
@@ -48,10 +48,12 @@ class TestKeyFactory < Test::Unit::TestCase
private
def rsa_key
- @rsa_key ||= OpenSSL::PKey::RSA.new("0@\002\001\000\002\t\000\300\030\317\2132\340 \267\002\003\001\000\001\002\t\000\236~\232\025\350Y=\341\002\005\000\352D\217\a\002\005\000\321\352\304\321\002\005\000\242\350\206%\002\005\000\270\021\217\361\002\004~\253\214j")
+ # 512 bits
+ @rsa_key ||= OpenSSL::PKey::RSA.new("0\202\001;\002\001\000\002A\000\235\236\374N\e@2E\321\3757\003\354c\276N\f\003\3479Ko\005\317\0027\a\255=\345!\306\220\340\211;\027u\331\260\362\2063x\332\301y4\353\v%\032\214v\312\304\212\271GJ\353\2701\031\002\003\001\000\001\002@\022Y\306*\031\306\031\224Cde\231QV3{\306\256U\2477\377\017\000\020\323\363R\332\027\351\034\224OU\020\227H|pUS\n\263+%\304\341\321\273/\271\e\004L\250\273\020&,\t\304By\002!\000\311c\246%a\002\305\277\262R\266\244\250\025V_\351]\264\016\265\341\355\305\223\347Z$8\205#\023\002!\000\310\\\367|\243I\363\350\020\307\246\302\365\ed\212L\273\2158M\223w\a\367 C\t\224A4\243\002!\000\262]+}\327\231\331\002\2331^\312\036\204'g\363\f&\271\020\245\365-\024}\306\374e\202\2459\002 }\231\341\276\3551\277\307{5\\\361\233\353G\024wS\237\fk}\004\302&\205\277\340rb\211\327\002!\000\223\307\025I:\215_\260\370\252\3757\256Y&X\364\354\342\215\350\203E8\227|\f\237M\375D|")
end
def dsa_key
+ # 512 bits
@dsa_key ||= OpenSSL::PKey::DSA.new("0\201\367\002\001\000\002A\000\203\316/\037u\272&J\265\003l3\315d\324h\372{\t8\252#\331_\026\006\035\270\266\255\343\353Z\302\276\335\336\306\220\375\202L\244\244J\206>\346\b\315\211\302L\246x\247u\a\376\366\345\302\016#\002\025\000\244\274\302\221Og\275/\302+\356\346\360\024\373wI\2573\361\002@\027\215\270r*\f\213\350C\245\021:\350 \006\\\376\345\022`\210b\262\3643\023XLKS\320\370\002\276\347A\nU\204\276\324\256`=\026\240\330\306J\316V\213\024\e\030\215\355\006\037q\337\356ln\002@\017\257\034\f\260\333'S\271#\237\230E\321\312\027\021\226\331\251Vj\220\305\316\036\v\266+\000\230\270\177B\003?t\a\305]e\344\261\334\023\253\323\251\223M\2175)a(\004\"lI8\312\303\307\a\002\024_\aznW\345\343\203V\326\246ua\203\376\201o\350\302\002")
end
diff --git a/test/transport/kex/test_diffie_hellman_group1_sha1.rb b/test/transport/kex/test_diffie_hellman_group1_sha1.rb
index 619b716..f62dbcb 100644
--- a/test/transport/kex/test_diffie_hellman_group1_sha1.rb
+++ b/test/transport/kex/test_diffie_hellman_group1_sha1.rb
@@ -95,9 +95,9 @@ module Transport; module Kex
Net::SSH::Transport::Kex::DiffieHellmanGroup1SHA1
end
- # 368 bits is the smallest possible key that will work with this, so
+ # 512 bits is the smallest possible key that will work with this, so
# we use it for speed reasons
- def server_key(bits=368)
+ def server_key(bits=512)
@server_key ||= OpenSSL::PKey::RSA.new(bits)
end
diff --git a/test/transport/test_packet_stream.rb b/test/transport/test_packet_stream.rb
index fc713fc..756f29a 100644
--- a/test/transport/test_packet_stream.rb
+++ b/test/transport/test_packet_stream.rb
@@ -378,6 +378,13 @@ module Transport
next
end
+ # JRuby Zlib implementation (1.4 & 1.5) does not have byte-to-byte compatibility with MRI's.
+ # skip these 80 or more tests under JRuby.
+ if defined?(JRUBY_VERSION)
+ puts "Skipping zlib tests for JRuby"
+ next
+ end
+
hmacs.each do |hmac_name|
[false, :standard].each do |compress|
cipher_method_name = cipher_name.gsub(/\W/, "_")
diff --git a/test/transport/test_state.rb b/test/transport/test_state.rb
index 87fad5c..8785e68 100644
--- a/test/transport/test_state.rb
+++ b/test/transport/test_state.rb
@@ -114,12 +114,18 @@ module Transport
end
def test_compress_when_compression_is_enabled_should_return_compressed_text
- state.set :compression => :standard
+ state.set :compression => :standard
+ # JRuby Zlib implementation (1.4 & 1.5) does not have byte-to-byte compatibility with MRI's.
+ # skip this test under JRuby.
+ return if defined?(JRUBY_VERSION)
assert_equal "x\234\312H\315\311\311WH-K-\252L\312O\251\004\000\000\000\377\377", state.compress("hello everybody")
end
def test_decompress_when_compression_is_enabled_should_return_decompressed_text
- state.set :compression => :standard
+ state.set :compression => :standard
+ # JRuby Zlib implementation (1.4 & 1.5) does not have byte-to-byte compatibility with MRI's.
+ # skip this test under JRuby.
+ return if defined?(JRUBY_VERSION)
assert_equal "hello everybody", state.decompress("x\234\312H\315\311\311WH-K-\252L\312O\251\004\000\000\000\377\377")
end