net-ssh 2.9.4 → 2.10.0.beta1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/.travis.yml +11 -4
- data/CHANGES.txt +15 -5
- data/README.rdoc +1 -1
- data/Rakefile +12 -5
- data/lib/net/ssh.rb +16 -1
- data/lib/net/ssh/authentication/key_manager.rb +20 -11
- data/lib/net/ssh/authentication/methods/keyboard_interactive.rb +11 -4
- data/lib/net/ssh/authentication/methods/password.rb +3 -1
- data/lib/net/ssh/authentication/pageant.rb +32 -12
- data/lib/net/ssh/connection/channel.rb +7 -26
- data/lib/net/ssh/connection/session.rb +2 -11
- data/lib/net/ssh/proxy/command.rb +14 -3
- data/lib/net/ssh/ruby_compat.rb +0 -5
- data/lib/net/ssh/transport/algorithms.rb +3 -4
- data/lib/net/ssh/transport/cipher_factory.rb +0 -1
- data/lib/net/ssh/transport/session.rb +8 -7
- data/lib/net/ssh/version.rb +4 -4
- data/net-ssh-public_cert.pem +15 -15
- data/net-ssh.gemspec +9 -5
- data/setup.rb +1 -1
- data/test/README.txt +6 -13
- data/test/authentication/methods/test_keyboard_interactive.rb +21 -0
- data/test/authentication/test_key_manager.rb +5 -1
- data/test/connection/test_channel.rb +0 -3
- data/test/connection/test_session.rb +8 -17
- data/test/integration/README.txt +19 -0
- data/test/integration/Vagrantfile +12 -0
- data/test/integration/common.rb +57 -0
- data/test/integration/playbook.yml +46 -0
- data/test/integration/test_id_rsa_keys.rb +78 -0
- data/test/start/test_options.rb +8 -1
- data/test/test_all.rb +1 -0
- data/test/transport/kex/test_diffie_hellman_group1_sha1.rb +5 -1
- data/test/transport/kex/test_diffie_hellman_group_exchange_sha1.rb +5 -1
- data/test/transport/kex/test_diffie_hellman_group_exchange_sha256.rb +2 -17
- data/test/transport/test_algorithms.rb +21 -17
- data/test/transport/test_session.rb +1 -1
- metadata +24 -20
- metadata.gz.sig +0 -0
- data/Rudyfile +0 -96
@@ -0,0 +1,46 @@
|
|
1
|
+
---
|
2
|
+
- hosts: all
|
3
|
+
sudo: yes
|
4
|
+
vars:
|
5
|
+
ruby_version: '2.0.0-p598'
|
6
|
+
rvm1_install_path: '/usr/local/rvm'
|
7
|
+
foopwd: "$6$mhOzf/yapZwS$3RwDl4GfWZ5VcfcsHrK9xNNTxyzLOJBsmMttDNaegIbXxMahV86.v/5HsNtit16MEl0EFf5CSW8Dz2yXV.8GB0"
|
8
|
+
foo2pwd: "$6$JiB7y7.M0yI$Abt.ZGIc4DwkRWeI6nKxzzPUZcux7hLRXSdpoKoZvswJz1SZyg5GRQWn9pGID0dgC6e4wFglfW6ev/qZoTqGk/"
|
9
|
+
pre_tasks:
|
10
|
+
- name: get currently installed ruby version
|
11
|
+
command: "{{rvm1_install_path}}/rubies/ruby-{{ruby_version}}/bin/ruby -e 'puts \"#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}\"'"
|
12
|
+
register: current_ruby_version
|
13
|
+
ignore_errors: True
|
14
|
+
roles:
|
15
|
+
- { role: rvm_io.rvm1-ruby,
|
16
|
+
tags: ruby, sudo: True,
|
17
|
+
rvm1_rubies: ["ruby-{{ruby_version}}"],
|
18
|
+
rvm1_install_path: "{{rvm1_install_path}}",
|
19
|
+
when: "'{{current_ruby_version.stdout|default()}}' != '{{ruby_version}}'" }
|
20
|
+
tasks:
|
21
|
+
- user: name=net_ssh_1 password="{{foopwd}}" group=vagrant state=present
|
22
|
+
- user: name=net_ssh_2 password="{{foo2pwd}}" group=vagrant state=present
|
23
|
+
- file: dest=/home/net_ssh_1/.ssh/ state=directory mode=0740 owner=net_ssh_1
|
24
|
+
- file: dest=/home/net_ssh_2/.ssh/ state=directory mode=0740 owner=net_ssh_2
|
25
|
+
- lineinfile: dest=/etc/sudoers.d/net_ssh_1 mode=0440 state=present create=yes
|
26
|
+
line='net_ssh_1 ALL=(ALL) NOPASSWD:ALL' regexp=net_ssh_1
|
27
|
+
- lineinfile: dest=/etc/sudoers.d/net_ssh_1 mode=0440 state=present create=yes
|
28
|
+
line='net_ssh_2 ALL=(ALL) NOPASSWD:ALL' regexp=net_ssh_2
|
29
|
+
- command: ssh-keygen -A
|
30
|
+
args:
|
31
|
+
creates: /etc/ssh/ssh_host_ed25519_key
|
32
|
+
notify: restart sshd
|
33
|
+
- name: sshd debug
|
34
|
+
lineinfile: dest='/etc/ssh/sshd_config' line='LogLevel DEBUG' regexp=LogLevel
|
35
|
+
notify: restart sshd
|
36
|
+
- gem: name="{{item}}" state=present executable=/usr/local/rvm/rubies/ruby-{{ruby_version}}/bin/gem
|
37
|
+
with_items:
|
38
|
+
- byebug
|
39
|
+
- jeweler
|
40
|
+
- mocha
|
41
|
+
- rbnacl
|
42
|
+
- rbnacl-libsodium
|
43
|
+
handlers:
|
44
|
+
- name: restart sshd
|
45
|
+
service: name=ssh state=restarted
|
46
|
+
|
@@ -0,0 +1,78 @@
|
|
1
|
+
require 'common'
|
2
|
+
require 'fileutils'
|
3
|
+
require 'tmpdir'
|
4
|
+
|
5
|
+
require 'net/ssh'
|
6
|
+
|
7
|
+
# see Vagrantfile,playbook for env.
|
8
|
+
# we're running as net_ssh_1 user password foo
|
9
|
+
# and usually connecting to net_ssh_2 user password foo2pwd
|
10
|
+
class TestIDRSAPKeys < Test::Unit::TestCase
|
11
|
+
include IntegrationTestHelpers
|
12
|
+
|
13
|
+
def test_in_file_no_password
|
14
|
+
Dir.mktmpdir do |dir| dir = "/tmp/test"
|
15
|
+
sh "rm -rf #{dir}/id_rsa #{dir}/id_rsa.pub"
|
16
|
+
sh "ssh-keygen -f #{dir}/id_rsa -t rsa -N ''"
|
17
|
+
set_authorized_key('net_ssh_1',"#{dir}/id_rsa.pub")
|
18
|
+
|
19
|
+
sshopts = '-vvvv -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no'
|
20
|
+
#sh "ssh -i #{dir}/id_rsa #{sshopts} net_ssh_1@localhost echo 'hello'"
|
21
|
+
|
22
|
+
ret = Net::SSH.start("localhost", "net_ssh_1", {keys: "#{dir}/id_rsa"}) do |ssh|
|
23
|
+
ssh.exec! 'echo "hello from:$USER"'
|
24
|
+
end
|
25
|
+
assert_equal "hello from:net_ssh_1\n", ret
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
|
30
|
+
def test_ssh_agent
|
31
|
+
Dir.mktmpdir do |dir| dir = "/tmp/test"
|
32
|
+
with_agent do
|
33
|
+
sh "rm -rf #{dir}/id_rsa #{dir}/id_rsa.pub"
|
34
|
+
sh "ssh-keygen -f #{dir}/id_rsa -t rsa -N 'pwd123'"
|
35
|
+
set_authorized_key('net_ssh_1',"#{dir}/id_rsa.pub")
|
36
|
+
ssh_add("#{dir}/id_rsa","pwd123")
|
37
|
+
|
38
|
+
ret = Net::SSH.start("localhost", "net_ssh_1",verbose: :debug) do |ssh|
|
39
|
+
ssh.exec! 'echo "hello from:$USER"'
|
40
|
+
end
|
41
|
+
assert_equal "hello from:net_ssh_1\n", ret
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
def test_ssh_agent_ignores_if_already_in_agent
|
47
|
+
Dir.mktmpdir do |dir| dir = "/tmp/test"
|
48
|
+
with_agent do
|
49
|
+
sh "rm -rf #{dir}/id_rsa #{dir}/id_rsa.pub"
|
50
|
+
sh "ssh-keygen -f #{dir}/id_rsa -t rsa -N 'pwd123'"
|
51
|
+
set_authorized_key('net_ssh_1',"#{dir}/id_rsa.pub")
|
52
|
+
ssh_add("#{dir}/id_rsa","pwd123")
|
53
|
+
|
54
|
+
ret = Net::SSH.start("localhost", "net_ssh_1",verbose: :debug, keys: ["#{dir}/id_rsa"]) do |ssh|
|
55
|
+
ssh.exec! 'echo "hello from:$USER"'
|
56
|
+
end
|
57
|
+
assert_equal "hello from:net_ssh_1\n", ret
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
def test_in_file_with_password
|
63
|
+
Dir.mktmpdir do |dir| dir = "/tmp/test"
|
64
|
+
sh "rm -rf #{dir}/id_rsa #{dir}/id_rsa.pub"
|
65
|
+
sh "ssh-keygen -f #{dir}/id_rsa -t rsa -N 'pwd12'"
|
66
|
+
set_authorized_key('net_ssh_1',"#{dir}/id_rsa.pub")
|
67
|
+
|
68
|
+
sshopts = '-vvvv -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no'
|
69
|
+
#sh "ssh -i #{dir}/id_rsa #{sshopts} net_ssh_1@localhost echo 'hello'"
|
70
|
+
|
71
|
+
ret = Net::SSH.start("localhost", "net_ssh_1", {keys: "#{dir}/id_rsa",
|
72
|
+
passphrase: 'pwd12', verbose: :debug}) do |ssh|
|
73
|
+
ssh.exec! 'echo "hello from:$USER"'
|
74
|
+
end
|
75
|
+
assert_equal "hello from:net_ssh_1\n", ret
|
76
|
+
end
|
77
|
+
end
|
78
|
+
end
|
data/test/start/test_options.rb
CHANGED
@@ -32,12 +32,19 @@ module NetSSH
|
|
32
32
|
end
|
33
33
|
end
|
34
34
|
|
35
|
-
def
|
35
|
+
def test_start_should_accept_number_of_password_prompts_option
|
36
36
|
assert_nothing_raised do
|
37
37
|
options = { :number_of_password_prompts => 2 }
|
38
38
|
Net::SSH.start('localhost', 'testuser', options)
|
39
39
|
end
|
40
40
|
end
|
41
|
+
|
42
|
+
def test_start_should_accept_non_interactive_option
|
43
|
+
assert_nothing_raised do
|
44
|
+
options = { :non_interactive => true }
|
45
|
+
Net::SSH.start('localhost', 'testuser', options)
|
46
|
+
end
|
47
|
+
end
|
41
48
|
end
|
42
49
|
end
|
43
50
|
|
data/test/test_all.rb
CHANGED
@@ -4,6 +4,7 @@ $: << '.'
|
|
4
4
|
# $ ruby -Ilib -Itest -rrubygems test/transport/test_server_version.rb
|
5
5
|
Dir.chdir(File.dirname(__FILE__)) do
|
6
6
|
test_files = Dir['**/test_*.rb']-['test_all.rb'] # prevent circular require
|
7
|
+
test_files -= Dir['integration/test_*.rb']
|
7
8
|
test_files = test_files.reject { |f| f =~ /^manual/ }
|
8
9
|
test_files = test_files.select { |f| f =~ Regexp.new(ENV['ONLY']) } if ENV['ONLY']
|
9
10
|
test_files = test_files.reject { |f| f =~ Regexp.new(ENV['EXCEPT']) } if ENV['EXCEPT']
|
@@ -12,12 +12,16 @@ module Transport; module Kex
|
|
12
12
|
@packet_data = @shared_secret = nil
|
13
13
|
end
|
14
14
|
|
15
|
+
def digest_type
|
16
|
+
OpenSSL::Digest::SHA1
|
17
|
+
end
|
18
|
+
|
15
19
|
def test_exchange_keys_should_return_expected_results_when_successful
|
16
20
|
result = exchange!
|
17
21
|
assert_equal session_id, result[:session_id]
|
18
22
|
assert_equal server_key.to_blob, result[:server_key].to_blob
|
19
23
|
assert_equal shared_secret, result[:shared_secret]
|
20
|
-
assert_equal
|
24
|
+
assert_equal digest_type, result[:hashing_algorithm]
|
21
25
|
end
|
22
26
|
|
23
27
|
def test_exchange_keys_with_unverifiable_host_should_raise_exception
|
@@ -69,6 +69,10 @@ module Transport; module Kex
|
|
69
69
|
Net::SSH::Transport::Kex::DiffieHellmanGroupExchangeSHA1
|
70
70
|
end
|
71
71
|
|
72
|
+
def digest_type
|
73
|
+
OpenSSL::Digest::SHA1
|
74
|
+
end
|
75
|
+
|
72
76
|
def session_id
|
73
77
|
@session_id ||= begin
|
74
78
|
buffer = Net::SSH::Buffer.from(:string, packet_data[:client_version_string],
|
@@ -84,7 +88,7 @@ module Transport; module Kex
|
|
84
88
|
:bignum, dh.dh.pub_key,
|
85
89
|
:bignum, server_dh_pubkey,
|
86
90
|
:bignum, shared_secret)
|
87
|
-
|
91
|
+
digest_type.digest(buffer.to_s)
|
88
92
|
end
|
89
93
|
end
|
90
94
|
end
|
@@ -11,23 +11,8 @@ module Transport; module Kex
|
|
11
11
|
Net::SSH::Transport::Kex::DiffieHellmanGroupExchangeSHA256
|
12
12
|
end
|
13
13
|
|
14
|
-
def
|
15
|
-
|
16
|
-
buffer = Net::SSH::Buffer.from(:string, packet_data[:client_version_string],
|
17
|
-
:string, packet_data[:server_version_string],
|
18
|
-
:string, packet_data[:client_algorithm_packet],
|
19
|
-
:string, packet_data[:server_algorithm_packet],
|
20
|
-
:string, Net::SSH::Buffer.from(:key, server_key),
|
21
|
-
:long, 1024,
|
22
|
-
:long, 1024,
|
23
|
-
:long, 8192,
|
24
|
-
:bignum, dh.dh.p,
|
25
|
-
:bignum, dh.dh.g,
|
26
|
-
:bignum, dh.dh.pub_key,
|
27
|
-
:bignum, server_dh_pubkey,
|
28
|
-
:bignum, shared_secret)
|
29
|
-
OpenSSL::Digest::SHA256.digest(buffer.to_s)
|
30
|
-
end
|
14
|
+
def digest_type
|
15
|
+
OpenSSL::Digest::SHA256
|
31
16
|
end
|
32
17
|
end
|
33
18
|
|
@@ -36,7 +36,7 @@ module Transport
|
|
36
36
|
end
|
37
37
|
|
38
38
|
def test_constructor_with_preferred_host_key_type_should_put_preferred_host_key_type_first
|
39
|
-
assert_equal %w(ssh-dss ssh-rsa ssh-rsa-cert-v01@openssh.com ssh-rsa-cert-v00@openssh.com)+ec_host_keys, algorithms(:host_key => "ssh-dss")[:host_key]
|
39
|
+
assert_equal %w(ssh-dss ssh-rsa ssh-rsa-cert-v01@openssh.com ssh-rsa-cert-v00@openssh.com)+ec_host_keys, algorithms(:host_key => "ssh-dss", :append_all_supported_algorithms => true)[:host_key]
|
40
40
|
end
|
41
41
|
|
42
42
|
def test_constructor_with_known_hosts_reporting_known_host_key_should_use_that_host_key_type
|
@@ -53,7 +53,7 @@ module Transport
|
|
53
53
|
end
|
54
54
|
|
55
55
|
def test_constructor_with_unrecognized_host_key_type_should_return_whats_supported
|
56
|
-
assert_equal %w(ssh-rsa ssh-dss ssh-rsa-cert-v01@openssh.com ssh-rsa-cert-v00@openssh.com )+ec_host_keys, algorithms(:host_key => "bogus ssh-rsa")[:host_key]
|
56
|
+
assert_equal %w(ssh-rsa ssh-dss ssh-rsa-cert-v01@openssh.com ssh-rsa-cert-v00@openssh.com )+ec_host_keys, algorithms(:host_key => "bogus ssh-rsa",:append_all_supported_algorithms => true)[:host_key]
|
57
57
|
end
|
58
58
|
|
59
59
|
def ec_kex
|
@@ -65,52 +65,56 @@ module Transport
|
|
65
65
|
end
|
66
66
|
|
67
67
|
def test_constructor_with_preferred_kex_should_put_preferred_kex_first
|
68
|
-
assert_equal %w(diffie-hellman-group1-sha1 diffie-hellman-group-exchange-sha1 diffie-hellman-group14-sha1 diffie-hellman-group-exchange-sha256)+ec_kex, algorithms(:kex => "diffie-hellman-group1-sha1")[:kex]
|
68
|
+
assert_equal %w(diffie-hellman-group1-sha1 diffie-hellman-group-exchange-sha1 diffie-hellman-group14-sha1 diffie-hellman-group-exchange-sha256)+ec_kex, algorithms(:kex => "diffie-hellman-group1-sha1", :append_all_supported_algorithms => true)[:kex]
|
69
69
|
end
|
70
70
|
|
71
|
-
def
|
72
|
-
assert_equal %w(diffie-hellman-group1-sha1 diffie-hellman-group-exchange-sha1 diffie-hellman-group14-sha1 diffie-hellman-group-exchange-sha256)+ec_kex, algorithms(
|
71
|
+
def test_constructor_with_unrecognized_kex_should_not_raise_exception
|
72
|
+
assert_equal %w(diffie-hellman-group1-sha1 diffie-hellman-group-exchange-sha1 diffie-hellman-group14-sha1 diffie-hellman-group-exchange-sha256)+ec_kex, algorithms(
|
73
|
+
:kex => %w(bogus diffie-hellman-group1-sha1),:append_all_supported_algorithms => true)[:kex]
|
73
74
|
end
|
74
75
|
|
75
76
|
def test_constructor_with_preferred_encryption_should_put_preferred_encryption_first
|
76
|
-
assert_equal %w(aes256-cbc aes128-cbc 3des-cbc blowfish-cbc cast128-cbc aes192-cbc rijndael-cbc@lysator.liu.se idea-cbc none arcfour128 arcfour256 arcfour aes128-ctr aes192-ctr aes256-ctr camellia128-cbc camellia192-cbc camellia256-cbc camellia128-cbc@openssh.org camellia192-cbc@openssh.org camellia256-cbc@openssh.org camellia128-ctr camellia192-ctr camellia256-ctr camellia128-ctr@openssh.org camellia192-ctr@openssh.org camellia256-ctr@openssh.org cast128-ctr blowfish-ctr 3des-ctr), algorithms(:encryption => "aes256-cbc"
|
77
|
+
assert_equal %w(aes256-cbc aes128-cbc 3des-cbc blowfish-cbc cast128-cbc aes192-cbc rijndael-cbc@lysator.liu.se idea-cbc none arcfour128 arcfour256 arcfour aes128-ctr aes192-ctr aes256-ctr camellia128-cbc camellia192-cbc camellia256-cbc camellia128-cbc@openssh.org camellia192-cbc@openssh.org camellia256-cbc@openssh.org camellia128-ctr camellia192-ctr camellia256-ctr camellia128-ctr@openssh.org camellia192-ctr@openssh.org camellia256-ctr@openssh.org cast128-ctr blowfish-ctr 3des-ctr), algorithms(:encryption => "aes256-cbc",
|
78
|
+
:append_all_supported_algorithms => true)[:encryption]
|
77
79
|
end
|
78
80
|
|
79
81
|
def test_constructor_with_multiple_preferred_encryption_should_put_all_preferred_encryption_first
|
80
|
-
assert_equal %w(aes256-cbc 3des-cbc idea-cbc aes128-cbc blowfish-cbc cast128-cbc aes192-cbc rijndael-cbc@lysator.liu.se none arcfour128 arcfour256 arcfour aes128-ctr aes192-ctr aes256-ctr camellia128-cbc camellia192-cbc camellia256-cbc camellia128-cbc@openssh.org camellia192-cbc@openssh.org camellia256-cbc@openssh.org camellia128-ctr camellia192-ctr camellia256-ctr camellia128-ctr@openssh.org camellia192-ctr@openssh.org camellia256-ctr@openssh.org cast128-ctr blowfish-ctr 3des-ctr), algorithms(:encryption => %w(aes256-cbc 3des-cbc idea-cbc))[:encryption]
|
82
|
+
assert_equal %w(aes256-cbc 3des-cbc idea-cbc aes128-cbc blowfish-cbc cast128-cbc aes192-cbc rijndael-cbc@lysator.liu.se none arcfour128 arcfour256 arcfour aes128-ctr aes192-ctr aes256-ctr camellia128-cbc camellia192-cbc camellia256-cbc camellia128-cbc@openssh.org camellia192-cbc@openssh.org camellia256-cbc@openssh.org camellia128-ctr camellia192-ctr camellia256-ctr camellia128-ctr@openssh.org camellia192-ctr@openssh.org camellia256-ctr@openssh.org cast128-ctr blowfish-ctr 3des-ctr), algorithms(:encryption => %w(aes256-cbc 3des-cbc idea-cbc), :append_all_supported_algorithms => true)[:encryption]
|
81
83
|
end
|
82
84
|
|
83
85
|
def test_constructor_with_unrecognized_encryption_should_keep_whats_supported
|
84
|
-
assert_equal %w(aes256-cbc aes128-cbc 3des-cbc blowfish-cbc cast128-cbc aes192-cbc rijndael-cbc@lysator.liu.se idea-cbc none arcfour128 arcfour256 arcfour aes128-ctr aes192-ctr aes256-ctr camellia128-cbc camellia192-cbc camellia256-cbc camellia128-cbc@openssh.org camellia192-cbc@openssh.org camellia256-cbc@openssh.org camellia128-ctr camellia192-ctr camellia256-ctr camellia128-ctr@openssh.org camellia192-ctr@openssh.org camellia256-ctr@openssh.org cast128-ctr blowfish-ctr 3des-ctr), algorithms(:encryption => %w(bogus aes256-cbc))[:encryption]
|
86
|
+
assert_equal %w(aes256-cbc aes128-cbc 3des-cbc blowfish-cbc cast128-cbc aes192-cbc rijndael-cbc@lysator.liu.se idea-cbc none arcfour128 arcfour256 arcfour aes128-ctr aes192-ctr aes256-ctr camellia128-cbc camellia192-cbc camellia256-cbc camellia128-cbc@openssh.org camellia192-cbc@openssh.org camellia256-cbc@openssh.org camellia128-ctr camellia192-ctr camellia256-ctr camellia128-ctr@openssh.org camellia192-ctr@openssh.org camellia256-ctr@openssh.org cast128-ctr blowfish-ctr 3des-ctr), algorithms(:encryption => %w(bogus aes256-cbc), :append_all_supported_algorithms => true)[:encryption]
|
85
87
|
end
|
86
88
|
|
87
89
|
def test_constructor_with_preferred_hmac_should_put_preferred_hmac_first
|
88
|
-
assert_equal %w(hmac-md5-96 hmac-sha1 hmac-md5 hmac-sha1-96 hmac-ripemd160 hmac-ripemd160@openssh.com hmac-sha2-256 hmac-sha2-512 hmac-sha2-256-96 hmac-sha2-512-96 none), algorithms(:hmac => "hmac-md5-96")[:hmac]
|
90
|
+
assert_equal %w(hmac-md5-96 hmac-sha1 hmac-md5 hmac-sha1-96 hmac-ripemd160 hmac-ripemd160@openssh.com hmac-sha2-256 hmac-sha2-512 hmac-sha2-256-96 hmac-sha2-512-96 none), algorithms(:hmac => "hmac-md5-96", :append_all_supported_algorithms => true)[:hmac]
|
89
91
|
end
|
90
92
|
|
91
93
|
def test_constructor_with_multiple_preferred_hmac_should_put_all_preferred_hmac_first
|
92
|
-
assert_equal %w(hmac-md5-96 hmac-sha1-96 hmac-sha1 hmac-md5 hmac-ripemd160 hmac-ripemd160@openssh.com hmac-sha2-256 hmac-sha2-512 hmac-sha2-256-96 hmac-sha2-512-96 none), algorithms(:hmac => %w(hmac-md5-96 hmac-sha1-96))[:hmac]
|
94
|
+
assert_equal %w(hmac-md5-96 hmac-sha1-96 hmac-sha1 hmac-md5 hmac-ripemd160 hmac-ripemd160@openssh.com hmac-sha2-256 hmac-sha2-512 hmac-sha2-256-96 hmac-sha2-512-96 none), algorithms(:hmac => %w(hmac-md5-96 hmac-sha1-96), :append_all_supported_algorithms => true)[:hmac]
|
93
95
|
end
|
94
96
|
|
95
97
|
def test_constructor_with_unrecognized_hmac_should_ignore_those
|
96
98
|
assert_equal %w(hmac-md5-96 hmac-sha1 hmac-md5 hmac-sha1-96 hmac-ripemd160 hmac-ripemd160@openssh.com hmac-sha2-256 hmac-sha2-512 hmac-sha2-256-96 hmac-sha2-512-96 none),
|
97
|
-
algorithms(:hmac => "hmac-md5-96")[:hmac]
|
99
|
+
algorithms(:hmac => "hmac-md5-96", :append_all_supported_algorithms => true)[:hmac]
|
98
100
|
end
|
99
101
|
|
100
102
|
def test_constructor_with_preferred_compression_should_put_preferred_compression_first
|
101
|
-
assert_equal %w(zlib none zlib@openssh.com), algorithms(:compression => "zlib")[:compression]
|
103
|
+
assert_equal %w(zlib none zlib@openssh.com), algorithms(:compression => "zlib", :append_all_supported_algorithms => true)[:compression]
|
102
104
|
end
|
103
105
|
|
104
106
|
def test_constructor_with_multiple_preferred_compression_should_put_all_preferred_compression_first
|
105
|
-
assert_equal %w(zlib@openssh.com zlib none), algorithms(:compression => %w(zlib@openssh.com zlib)
|
107
|
+
assert_equal %w(zlib@openssh.com zlib none), algorithms(:compression => %w(zlib@openssh.com zlib),
|
108
|
+
:append_all_supported_algorithms => true)[:compression]
|
106
109
|
end
|
107
110
|
|
108
111
|
def test_constructor_with_general_preferred_compression_should_put_none_last
|
109
|
-
assert_equal %w(zlib@openssh.com zlib none), algorithms(
|
112
|
+
assert_equal %w(zlib@openssh.com zlib none), algorithms(
|
113
|
+
:compression => true, :append_all_supported_algorithms => true)[:compression]
|
110
114
|
end
|
111
115
|
|
112
116
|
def test_constructor_with_unrecognized_compression_should_return_whats_supported
|
113
|
-
assert_equal %w(none zlib zlib@openssh.com), algorithms(:compression => %w(bogus none zlib))[:compression]
|
117
|
+
assert_equal %w(none zlib zlib@openssh.com), algorithms(:compression => %w(bogus none zlib), :append_all_supported_algorithms => true)[:compression]
|
114
118
|
end
|
115
119
|
|
116
120
|
def test_initial_state_should_be_neither_pending_nor_initialized
|
@@ -185,7 +189,7 @@ module Transport
|
|
185
189
|
end
|
186
190
|
|
187
191
|
def test_exchange_with_zlib_compression_enabled_sets_compression_to_standard
|
188
|
-
algorithms :compression => "zlib"
|
192
|
+
algorithms :compression => "zlib", :append_all_supported_algorithms => true
|
189
193
|
|
190
194
|
transport.expect do |t, buffer|
|
191
195
|
assert_kexinit(buffer, :compression_client => "zlib,none,zlib@openssh.com", :compression_server => "zlib,none,zlib@openssh.com")
|
@@ -200,7 +204,7 @@ module Transport
|
|
200
204
|
end
|
201
205
|
|
202
206
|
def test_exchange_with_zlib_at_openssh_dot_com_compression_enabled_sets_compression_to_delayed
|
203
|
-
algorithms :compression => "zlib@openssh.com"
|
207
|
+
algorithms :compression => "zlib@openssh.com", :append_all_supported_algorithms => true
|
204
208
|
|
205
209
|
transport.expect do |t, buffer|
|
206
210
|
assert_kexinit(buffer, :compression_client => "zlib@openssh.com,none,zlib", :compression_server => "zlib@openssh.com,none,zlib")
|
@@ -315,7 +315,7 @@ module Transport
|
|
315
315
|
def session(options={})
|
316
316
|
@session ||= begin
|
317
317
|
host = options.delete(:host) || "net.ssh.test"
|
318
|
-
TCPSocket.stubs(:open).with(host, options[:port] || 22).returns(socket)
|
318
|
+
TCPSocket.stubs(:open).with(host, options[:port] || 22, nil).returns(socket)
|
319
319
|
Net::SSH::Transport::ServerVersion.stubs(:new).returns(server_version)
|
320
320
|
Net::SSH::Transport::Algorithms.stubs(:new).returns(algorithms)
|
321
321
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: net-ssh
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.10.0.beta1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jamis Buck
|
@@ -14,24 +14,24 @@ cert_chain:
|
|
14
14
|
-----BEGIN CERTIFICATE-----
|
15
15
|
MIIDODCCAiCgAwIBAgIBADANBgkqhkiG9w0BAQUFADBCMRAwDgYDVQQDDAduZXQt
|
16
16
|
c3NoMRkwFwYKCZImiZPyLGQBGRYJc29sdXRpb3VzMRMwEQYKCZImiZPyLGQBGRYD
|
17
|
-
|
17
|
+
Y29tMB4XDTE0MTIwMjE3MzkyMFoXDTE1MTIwMjE3MzkyMFowQjEQMA4GA1UEAwwH
|
18
18
|
bmV0LXNzaDEZMBcGCgmSJomT8ixkARkWCXNvbHV0aW91czETMBEGCgmSJomT8ixk
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
19
|
+
ARkWA2NvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAJ0qnw4JV5JN
|
20
|
+
MWelqu7pnW2z6GZJ7+zLFYJQNETJyF0U5zo7aCRK08OeUxnpu/TCCXK8iQVkNLfz
|
21
|
+
9pVIhF+X8pMEIruAkYGwBt1aWfuSNeyodyMk0vpZdxBHbOTJ4qBRUc6qOtNOeOzv
|
22
|
+
8ObYUX52P/EMMaeXTRU+e7MGkB9pb6FvPPNx5akxwIaoRvtcMsc/hJnQuP5r96w6
|
23
|
+
t06MgKbXhWAX6gev0RVlrQqzxXst6iuvsrgZGjFqzob5wbTiX9M0+bFAB0EI7tJC
|
24
|
+
sv5keEbtNRaU7p3ZbMm4wTHHJLOtD+BpUCSzwv4ToNj9mZtJBMYw2Eeo7z1DklEG
|
25
|
+
mr95zbe+zNMCAwEAAaM5MDcwCQYDVR0TBAIwADAdBgNVHQ4EFgQU1bTfpzmitXwv
|
26
|
+
LmTXi0IO5vd8NGYwCwYDVR0PBAQDAgSwMA0GCSqGSIb3DQEBBQUAA4IBAQA0Aps8
|
27
|
+
UPINGa8XUUtrZtzrgX0/iyXNkKY1ld85g1N3WKEAVLfQI7TlGr0Qv2Ekx6RqlxbR
|
28
|
+
Vyq08pytSnghW2otR3bIGMGQzqxAeRLb25cjEwH7YIJ32n7ZC1fpMnBZOBDmueWA
|
29
|
+
B9EonmoO3ne7AJSgIvBbZzBPhzM4HrQGRW8LsPFsuj+dcJI43HOQwkmv2TRz0+t6
|
30
|
+
mGZldmqLcK0abv4JepLfB9XTue3kuyA29NGBibqyvRwlKckLpvKfHZX6Jxad8xxm
|
31
|
+
MbvRpzgROzyfw1qYi4dnIyMwTtXFFcZ0a2jpxHPkcTYFK6TzvFgDLAP0Y/u9jqUQ
|
32
|
+
eZ7/3CdSi/isZHEw
|
33
33
|
-----END CERTIFICATE-----
|
34
|
-
date:
|
34
|
+
date: 2015-05-21 00:00:00.000000000 Z
|
35
35
|
dependencies:
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: test-unit
|
@@ -77,7 +77,6 @@ files:
|
|
77
77
|
- Manifest
|
78
78
|
- README.rdoc
|
79
79
|
- Rakefile
|
80
|
-
- Rudyfile
|
81
80
|
- THANKS.txt
|
82
81
|
- lib/net/ssh.rb
|
83
82
|
- lib/net/ssh/authentication/agent.rb
|
@@ -191,6 +190,11 @@ files:
|
|
191
190
|
- test/configs/wild_cards
|
192
191
|
- test/connection/test_channel.rb
|
193
192
|
- test/connection/test_session.rb
|
193
|
+
- test/integration/README.txt
|
194
|
+
- test/integration/Vagrantfile
|
195
|
+
- test/integration/common.rb
|
196
|
+
- test/integration/playbook.yml
|
197
|
+
- test/integration/test_id_rsa_keys.rb
|
194
198
|
- test/known_hosts/github
|
195
199
|
- test/manual/test_forward.rb
|
196
200
|
- test/manual/test_pageant.rb
|
@@ -243,9 +247,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
243
247
|
version: '0'
|
244
248
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
245
249
|
requirements:
|
246
|
-
- - "
|
250
|
+
- - ">"
|
247
251
|
- !ruby/object:Gem::Version
|
248
|
-
version:
|
252
|
+
version: 1.3.1
|
249
253
|
requirements: []
|
250
254
|
rubyforge_project: net-ssh
|
251
255
|
rubygems_version: 2.4.6
|
metadata.gz.sig
CHANGED
Binary file
|
data/Rudyfile
DELETED
@@ -1,96 +0,0 @@
|
|
1
|
-
# Rudyfile
|
2
|
-
#
|
3
|
-
# This configuration is used to test installing
|
4
|
-
# and running net-ssh on a clean machine.
|
5
|
-
#
|
6
|
-
# Usage:
|
7
|
-
#
|
8
|
-
# $ rudy -vv startup
|
9
|
-
# $ rudy -vv testsuite
|
10
|
-
# $ rudy -vv shutdown
|
11
|
-
#
|
12
|
-
# Requires: Rudy 0.9 (http://code.google.com/p/rudy/)
|
13
|
-
#
|
14
|
-
|
15
|
-
defaults do
|
16
|
-
color true
|
17
|
-
environment :test
|
18
|
-
role :netssh
|
19
|
-
end
|
20
|
-
|
21
|
-
machines do
|
22
|
-
region :'us-east-1' do
|
23
|
-
ami 'ami-e348af8a' # Alestic Debian 5.0, 32-bit (US)
|
24
|
-
end
|
25
|
-
env :test do
|
26
|
-
role :netssh do
|
27
|
-
user :root
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|
31
|
-
|
32
|
-
commands do
|
33
|
-
allow :apt_get, "apt-get", :y, :q
|
34
|
-
allow :gem_install, "/usr/bin/gem", "install", :n, '/usr/bin', :y, :V, "--no-rdoc", "--no-ri"
|
35
|
-
allow :gem_sources, "/usr/bin/gem", "sources"
|
36
|
-
allow :gem_uninstall, "/usr/bin/gem", "uninstall", :V
|
37
|
-
allow :update_rubygems
|
38
|
-
allow :rm
|
39
|
-
end
|
40
|
-
|
41
|
-
routines do
|
42
|
-
|
43
|
-
testsuite do
|
44
|
-
before :sysupdate, :installdeps, :install_gem
|
45
|
-
|
46
|
-
remote :root do
|
47
|
-
directory_upload 'test', '/tmp/'
|
48
|
-
cd '/tmp'
|
49
|
-
ruby :I, 'lib/', :I, 'test/', :r, 'rubygems', 'test/test_all.rb'
|
50
|
-
end
|
51
|
-
|
52
|
-
after :install_rubyforge, :install_github
|
53
|
-
end
|
54
|
-
|
55
|
-
install_gem do
|
56
|
-
before :package_gem
|
57
|
-
remote :root do
|
58
|
-
disable_safe_mode
|
59
|
-
file_upload "pkg/net-ssh-*.gem", "/tmp/"
|
60
|
-
gem_install "/tmp/net-ssh-*.gem"
|
61
|
-
end
|
62
|
-
end
|
63
|
-
|
64
|
-
package_gem do
|
65
|
-
local do
|
66
|
-
rm :r, :f, 'pkg'
|
67
|
-
rake 'package'
|
68
|
-
end
|
69
|
-
end
|
70
|
-
|
71
|
-
remove do
|
72
|
-
remote :root do
|
73
|
-
gem_uninstall 'net-ssh'
|
74
|
-
end
|
75
|
-
end
|
76
|
-
|
77
|
-
installdeps do
|
78
|
-
remote :root do
|
79
|
-
gem_install "rye", "test-unit", "mocha"
|
80
|
-
rye 'authorize-local'
|
81
|
-
end
|
82
|
-
end
|
83
|
-
|
84
|
-
sysupdate do
|
85
|
-
remote :root do
|
86
|
-
apt_get "update"
|
87
|
-
apt_get "install", "build-essential", "git-core"
|
88
|
-
apt_get "install", "ruby1.8-dev", "rdoc", "libzlib-ruby", "rubygems"
|
89
|
-
mkdir :p, "/var/lib/gems/1.8/bin" # Doesn't get created, but causes Rubygems to fail
|
90
|
-
gem_install "builder", "session"
|
91
|
-
gem_install 'rubygems-update', "-v=1.3.4" # circular issue with 1.3.5 and hoe
|
92
|
-
update_rubygems
|
93
|
-
end
|
94
|
-
end
|
95
|
-
end
|
96
|
-
|