abiquo-installer-tests 20120104 → 20121023.3
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +11 -7
- data/bin/abiquo-installer-tests +68 -43
- data/tests/1.8.5/abiquo_ciab.rb +21 -0
- data/tests/1.8.5/abiquo_kvm.rb +25 -0
- data/tests/1.8.5/abiquo_lvmiscsi.rb +17 -0
- data/tests/1.8.5/abiquo_monolithic.rb +12 -0
- data/tests/1.8.5/abiquo_nfs_repository.rb +23 -0
- data/tests/1.8.5/abiquo_platform.rb +39 -0
- data/tests/1.8.5/abiquo_remote_services.rb +115 -0
- data/tests/1.8.5/abiquo_server.rb +63 -0
- data/tests/1.8.5/abiquo_v2v.rb +37 -0
- data/tests/1.8.5/abiquo_vbox.rb +27 -0
- data/tests/1.8.5/abiquo_xen.rb +27 -0
- data/tests/2.0/abiquo_ciab.rb +9 -0
- data/tests/2.0/abiquo_community_hypervisor.rb +52 -0
- data/tests/2.0/abiquo_kvm.rb +5 -23
- data/tests/2.0/abiquo_monolithic.rb +12 -1
- data/tests/2.0/abiquo_platform.rb +2 -2
- data/tests/2.0/abiquo_remote_services.rb +15 -38
- data/tests/2.0/abiquo_server.rb +7 -1
- data/tests/2.0/abiquo_v2v.rb +42 -0
- data/tests/2.0/abiquo_vbox.rb +5 -25
- data/tests/2.0/abiquo_xen.rb +5 -25
- data/tests/2.2.0/abiquo_ciab.rb +30 -0
- data/tests/2.2.0/abiquo_community_hypervisor.rb +52 -0
- data/tests/2.2.0/abiquo_kvm.rb +7 -0
- data/tests/2.2.0/abiquo_lvmiscsi.rb +17 -0
- data/tests/2.2.0/abiquo_monolithic.rb +23 -0
- data/tests/2.2.0/abiquo_nfs_repository.rb +23 -0
- data/tests/2.2.0/abiquo_platform.rb +35 -0
- data/tests/2.2.0/abiquo_remote_services.rb +96 -0
- data/tests/2.2.0/abiquo_server.rb +95 -0
- data/tests/2.2.0/abiquo_v2v.rb +79 -0
- data/tests/2.2.0/abiquo_vbox.rb +7 -0
- data/tests/2.2.0/abiquo_xen.rb +7 -0
- data/tests/2.3.0/abiquo_ciab.rb +30 -0
- data/tests/2.3.0/abiquo_community_hypervisor.rb +52 -0
- data/tests/2.3.0/abiquo_kvm.rb +7 -0
- data/tests/2.3.0/abiquo_lvmiscsi.rb +17 -0
- data/tests/2.3.0/abiquo_monolithic.rb +23 -0
- data/tests/2.3.0/abiquo_nfs_repository.rb +23 -0
- data/tests/2.3.0/abiquo_platform.rb +35 -0
- data/tests/2.3.0/abiquo_remote_services.rb +96 -0
- data/tests/2.3.0/abiquo_server.rb +95 -0
- data/tests/2.3.0/abiquo_v2v.rb +79 -0
- data/tests/2.3.0/abiquo_vbox.rb +7 -0
- data/tests/2.3.0/abiquo_xen.rb +7 -0
- data/tests/abiquo_postinst_test.rb +12 -1
- data/vendor/net-scp-1.0.4/CHANGELOG.rdoc +29 -0
- data/vendor/net-scp-1.0.4/Manifest +17 -0
- data/vendor/net-scp-1.0.4/README.rdoc +98 -0
- data/vendor/net-scp-1.0.4/Rakefile +83 -0
- data/vendor/net-scp-1.0.4/lib/net/scp.rb +432 -0
- data/vendor/net-scp-1.0.4/lib/net/scp/download.rb +150 -0
- data/vendor/net-scp-1.0.4/lib/net/scp/errors.rb +5 -0
- data/vendor/net-scp-1.0.4/lib/net/scp/upload.rb +142 -0
- data/vendor/net-scp-1.0.4/lib/net/scp/version.rb +18 -0
- data/vendor/net-scp-1.0.4/lib/uri/open-scp.rb +18 -0
- data/vendor/net-scp-1.0.4/lib/uri/scp.rb +35 -0
- data/vendor/net-scp-1.0.4/net-scp.gemspec +34 -0
- data/vendor/net-scp-1.0.4/setup.rb +1331 -0
- data/vendor/net-scp-1.0.4/test/common.rb +153 -0
- data/vendor/net-scp-1.0.4/test/test_all.rb +3 -0
- data/vendor/net-scp-1.0.4/test/test_download.rb +170 -0
- data/vendor/net-scp-1.0.4/test/test_scp.rb +60 -0
- data/vendor/net-scp-1.0.4/test/test_upload.rb +269 -0
- data/vendor/net-sftp-2.0.5/CHANGELOG.rdoc +49 -0
- data/vendor/net-sftp-2.0.5/Manifest +55 -0
- data/vendor/net-sftp-2.0.5/README.rdoc +96 -0
- data/vendor/net-sftp-2.0.5/Rakefile +30 -0
- data/vendor/net-sftp-2.0.5/lib/net/sftp.rb +70 -0
- data/vendor/net-sftp-2.0.5/lib/net/sftp/constants.rb +187 -0
- data/vendor/net-sftp-2.0.5/lib/net/sftp/errors.rb +39 -0
- data/vendor/net-sftp-2.0.5/lib/net/sftp/operations/dir.rb +93 -0
- data/vendor/net-sftp-2.0.5/lib/net/sftp/operations/download.rb +364 -0
- data/vendor/net-sftp-2.0.5/lib/net/sftp/operations/file.rb +176 -0
- data/vendor/net-sftp-2.0.5/lib/net/sftp/operations/file_factory.rb +60 -0
- data/vendor/net-sftp-2.0.5/lib/net/sftp/operations/upload.rb +387 -0
- data/vendor/net-sftp-2.0.5/lib/net/sftp/packet.rb +21 -0
- data/vendor/net-sftp-2.0.5/lib/net/sftp/protocol.rb +32 -0
- data/vendor/net-sftp-2.0.5/lib/net/sftp/protocol/01/attributes.rb +315 -0
- data/vendor/net-sftp-2.0.5/lib/net/sftp/protocol/01/base.rb +268 -0
- data/vendor/net-sftp-2.0.5/lib/net/sftp/protocol/01/name.rb +43 -0
- data/vendor/net-sftp-2.0.5/lib/net/sftp/protocol/02/base.rb +31 -0
- data/vendor/net-sftp-2.0.5/lib/net/sftp/protocol/03/base.rb +35 -0
- data/vendor/net-sftp-2.0.5/lib/net/sftp/protocol/04/attributes.rb +152 -0
- data/vendor/net-sftp-2.0.5/lib/net/sftp/protocol/04/base.rb +94 -0
- data/vendor/net-sftp-2.0.5/lib/net/sftp/protocol/04/name.rb +67 -0
- data/vendor/net-sftp-2.0.5/lib/net/sftp/protocol/05/base.rb +66 -0
- data/vendor/net-sftp-2.0.5/lib/net/sftp/protocol/06/attributes.rb +107 -0
- data/vendor/net-sftp-2.0.5/lib/net/sftp/protocol/06/base.rb +63 -0
- data/vendor/net-sftp-2.0.5/lib/net/sftp/protocol/base.rb +50 -0
- data/vendor/net-sftp-2.0.5/lib/net/sftp/request.rb +91 -0
- data/vendor/net-sftp-2.0.5/lib/net/sftp/response.rb +76 -0
- data/vendor/net-sftp-2.0.5/lib/net/sftp/session.rb +952 -0
- data/vendor/net-sftp-2.0.5/lib/net/sftp/version.rb +18 -0
- data/vendor/net-sftp-2.0.5/net-sftp.gemspec +34 -0
- data/vendor/net-sftp-2.0.5/setup.rb +1331 -0
- data/vendor/net-sftp-2.0.5/test/common.rb +172 -0
- data/vendor/net-sftp-2.0.5/test/protocol/01/test_attributes.rb +97 -0
- data/vendor/net-sftp-2.0.5/test/protocol/01/test_base.rb +210 -0
- data/vendor/net-sftp-2.0.5/test/protocol/01/test_name.rb +27 -0
- data/vendor/net-sftp-2.0.5/test/protocol/02/test_base.rb +26 -0
- data/vendor/net-sftp-2.0.5/test/protocol/03/test_base.rb +27 -0
- data/vendor/net-sftp-2.0.5/test/protocol/04/test_attributes.rb +148 -0
- data/vendor/net-sftp-2.0.5/test/protocol/04/test_base.rb +74 -0
- data/vendor/net-sftp-2.0.5/test/protocol/04/test_name.rb +53 -0
- data/vendor/net-sftp-2.0.5/test/protocol/05/test_base.rb +62 -0
- data/vendor/net-sftp-2.0.5/test/protocol/06/test_attributes.rb +124 -0
- data/vendor/net-sftp-2.0.5/test/protocol/06/test_base.rb +51 -0
- data/vendor/net-sftp-2.0.5/test/protocol/test_base.rb +42 -0
- data/vendor/net-sftp-2.0.5/test/test_all.rb +7 -0
- data/vendor/net-sftp-2.0.5/test/test_dir.rb +47 -0
- data/vendor/net-sftp-2.0.5/test/test_download.rb +252 -0
- data/vendor/net-sftp-2.0.5/test/test_file.rb +159 -0
- data/vendor/net-sftp-2.0.5/test/test_file_factory.rb +48 -0
- data/vendor/net-sftp-2.0.5/test/test_packet.rb +9 -0
- data/vendor/net-sftp-2.0.5/test/test_protocol.rb +17 -0
- data/vendor/net-sftp-2.0.5/test/test_request.rb +71 -0
- data/vendor/net-sftp-2.0.5/test/test_response.rb +53 -0
- data/vendor/net-sftp-2.0.5/test/test_session.rb +741 -0
- data/vendor/net-sftp-2.0.5/test/test_upload.rb +219 -0
- data/vendor/net-ssh-2.5.2/CHANGELOG.rdoc +295 -0
- data/vendor/net-ssh-2.5.2/LICENSE.rdoc +19 -0
- data/vendor/net-ssh-2.5.2/Manifest +132 -0
- data/vendor/net-ssh-2.5.2/README.rdoc +184 -0
- data/vendor/net-ssh-2.5.2/Rakefile +88 -0
- data/vendor/net-ssh-2.5.2/Rudyfile +96 -0
- data/vendor/net-ssh-2.5.2/THANKS.rdoc +19 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh.rb +223 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/authentication/agent.rb +23 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/authentication/agent/java_pageant.rb +85 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/authentication/agent/socket.rb +170 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/authentication/constants.rb +18 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/authentication/key_manager.rb +253 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/authentication/methods/abstract.rb +60 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/authentication/methods/hostbased.rb +75 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/authentication/methods/keyboard_interactive.rb +70 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/authentication/methods/password.rb +43 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/authentication/methods/publickey.rb +96 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/authentication/pageant.rb +264 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/authentication/session.rb +154 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/buffer.rb +350 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/buffered_io.rb +198 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/config.rb +207 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/connection/channel.rb +630 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/connection/constants.rb +33 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/connection/session.rb +597 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/connection/term.rb +178 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/errors.rb +88 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/key_factory.rb +107 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/known_hosts.rb +141 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/loggable.rb +61 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/packet.rb +102 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/prompt.rb +93 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/proxy/command.rb +75 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/proxy/errors.rb +14 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/proxy/http.rb +94 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/proxy/socks4.rb +70 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/proxy/socks5.rb +142 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/ruby_compat.rb +51 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/service/forward.rb +298 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/test.rb +89 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/test/channel.rb +129 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/test/extensions.rb +152 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/test/kex.rb +44 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/test/local_packet.rb +51 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/test/packet.rb +81 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/test/remote_packet.rb +38 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/test/script.rb +157 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/test/socket.rb +64 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/transport/algorithms.rb +407 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/transport/cipher_factory.rb +106 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/transport/constants.rb +32 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/transport/ctr.rb +95 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/transport/hmac.rb +45 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/transport/hmac/abstract.rb +79 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/transport/hmac/md5.rb +12 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/transport/hmac/md5_96.rb +11 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/transport/hmac/none.rb +15 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/transport/hmac/ripemd160.rb +13 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/transport/hmac/sha1.rb +13 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/transport/hmac/sha1_96.rb +11 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/transport/hmac/sha2_256.rb +15 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/transport/hmac/sha2_256_96.rb +13 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/transport/hmac/sha2_512.rb +14 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/transport/hmac/sha2_512_96.rb +13 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/transport/identity_cipher.rb +55 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/transport/kex.rb +28 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/transport/kex/diffie_hellman_group14_sha1.rb +44 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/transport/kex/diffie_hellman_group1_sha1.rb +216 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/transport/kex/diffie_hellman_group_exchange_sha1.rb +80 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/transport/kex/diffie_hellman_group_exchange_sha256.rb +15 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/transport/kex/ecdh_sha2_nistp256.rb +93 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/transport/kex/ecdh_sha2_nistp384.rb +13 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/transport/kex/ecdh_sha2_nistp521.rb +13 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/transport/key_expander.rb +26 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/transport/openssl.rb +237 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/transport/packet_stream.rb +235 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/transport/server_version.rb +71 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/transport/session.rb +278 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/transport/state.rb +206 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/verifiers/lenient.rb +30 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/verifiers/null.rb +12 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/verifiers/strict.rb +53 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/version.rb +62 -0
- data/vendor/net-ssh-2.5.2/net-ssh.gemspec +172 -0
- data/vendor/net-ssh-2.5.2/setup.rb +1585 -0
- data/vendor/net-ssh-2.5.2/support/arcfour_check.rb +20 -0
- data/vendor/net-ssh-2.5.2/support/ssh_tunnel_bug.rb +65 -0
- data/vendor/net-ssh-2.5.2/test/README.txt +43 -0
- data/vendor/net-ssh-2.5.2/test/authentication/methods/common.rb +28 -0
- data/vendor/net-ssh-2.5.2/test/authentication/methods/test_abstract.rb +51 -0
- data/vendor/net-ssh-2.5.2/test/authentication/methods/test_hostbased.rb +114 -0
- data/vendor/net-ssh-2.5.2/test/authentication/methods/test_keyboard_interactive.rb +100 -0
- data/vendor/net-ssh-2.5.2/test/authentication/methods/test_password.rb +52 -0
- data/vendor/net-ssh-2.5.2/test/authentication/methods/test_publickey.rb +148 -0
- data/vendor/net-ssh-2.5.2/test/authentication/test_agent.rb +205 -0
- data/vendor/net-ssh-2.5.2/test/authentication/test_key_manager.rb +218 -0
- data/vendor/net-ssh-2.5.2/test/authentication/test_session.rb +106 -0
- data/vendor/net-ssh-2.5.2/test/common.rb +107 -0
- data/vendor/net-ssh-2.5.2/test/configs/eqsign +3 -0
- data/vendor/net-ssh-2.5.2/test/configs/exact_match +8 -0
- data/vendor/net-ssh-2.5.2/test/configs/host_plus +10 -0
- data/vendor/net-ssh-2.5.2/test/configs/multihost +4 -0
- data/vendor/net-ssh-2.5.2/test/configs/nohost +19 -0
- data/vendor/net-ssh-2.5.2/test/configs/numeric_host +4 -0
- data/vendor/net-ssh-2.5.2/test/configs/wild_cards +14 -0
- data/vendor/net-ssh-2.5.2/test/connection/test_channel.rb +467 -0
- data/vendor/net-ssh-2.5.2/test/connection/test_session.rb +488 -0
- data/vendor/net-ssh-2.5.2/test/known_hosts/github +1 -0
- data/vendor/net-ssh-2.5.2/test/manual/test_forward.rb +223 -0
- data/vendor/net-ssh-2.5.2/test/start/test_transport.rb +28 -0
- data/vendor/net-ssh-2.5.2/test/test_all.rb +9 -0
- data/vendor/net-ssh-2.5.2/test/test_buffer.rb +426 -0
- data/vendor/net-ssh-2.5.2/test/test_buffered_io.rb +63 -0
- data/vendor/net-ssh-2.5.2/test/test_config.rb +120 -0
- data/vendor/net-ssh-2.5.2/test/test_key_factory.rb +121 -0
- data/vendor/net-ssh-2.5.2/test/test_known_hosts.rb +13 -0
- data/vendor/net-ssh-2.5.2/test/transport/hmac/test_md5.rb +39 -0
- data/vendor/net-ssh-2.5.2/test/transport/hmac/test_md5_96.rb +25 -0
- data/vendor/net-ssh-2.5.2/test/transport/hmac/test_none.rb +34 -0
- data/vendor/net-ssh-2.5.2/test/transport/hmac/test_ripemd160.rb +34 -0
- data/vendor/net-ssh-2.5.2/test/transport/hmac/test_sha1.rb +34 -0
- data/vendor/net-ssh-2.5.2/test/transport/hmac/test_sha1_96.rb +25 -0
- data/vendor/net-ssh-2.5.2/test/transport/hmac/test_sha2_256.rb +35 -0
- data/vendor/net-ssh-2.5.2/test/transport/hmac/test_sha2_256_96.rb +25 -0
- data/vendor/net-ssh-2.5.2/test/transport/hmac/test_sha2_512.rb +35 -0
- data/vendor/net-ssh-2.5.2/test/transport/hmac/test_sha2_512_96.rb +25 -0
- data/vendor/net-ssh-2.5.2/test/transport/kex/test_diffie_hellman_group14_sha1.rb +13 -0
- data/vendor/net-ssh-2.5.2/test/transport/kex/test_diffie_hellman_group1_sha1.rb +146 -0
- data/vendor/net-ssh-2.5.2/test/transport/kex/test_diffie_hellman_group_exchange_sha1.rb +92 -0
- data/vendor/net-ssh-2.5.2/test/transport/kex/test_diffie_hellman_group_exchange_sha256.rb +33 -0
- data/vendor/net-ssh-2.5.2/test/transport/kex/test_ecdh_sha2_nistp256.rb +161 -0
- data/vendor/net-ssh-2.5.2/test/transport/kex/test_ecdh_sha2_nistp384.rb +37 -0
- data/vendor/net-ssh-2.5.2/test/transport/kex/test_ecdh_sha2_nistp521.rb +37 -0
- data/vendor/net-ssh-2.5.2/test/transport/test_algorithms.rb +330 -0
- data/vendor/net-ssh-2.5.2/test/transport/test_cipher_factory.rb +441 -0
- data/vendor/net-ssh-2.5.2/test/transport/test_hmac.rb +34 -0
- data/vendor/net-ssh-2.5.2/test/transport/test_identity_cipher.rb +40 -0
- data/vendor/net-ssh-2.5.2/test/transport/test_packet_stream.rb +1745 -0
- data/vendor/net-ssh-2.5.2/test/transport/test_server_version.rb +78 -0
- data/vendor/net-ssh-2.5.2/test/transport/test_session.rb +315 -0
- data/vendor/net-ssh-2.5.2/test/transport/test_state.rb +179 -0
- metadata +325 -78
@@ -0,0 +1,34 @@
|
|
1
|
+
require 'common'
|
2
|
+
require 'net/ssh/transport/hmac/sha1'
|
3
|
+
|
4
|
+
module Transport; module HMAC
|
5
|
+
|
6
|
+
class TestSHA1 < Test::Unit::TestCase
|
7
|
+
def test_expected_digest_class
|
8
|
+
assert_equal OpenSSL::Digest::SHA1, subject.digest_class
|
9
|
+
assert_equal OpenSSL::Digest::SHA1, subject.new.digest_class
|
10
|
+
end
|
11
|
+
|
12
|
+
def test_expected_key_length
|
13
|
+
assert_equal 20, subject.key_length
|
14
|
+
assert_equal 20, subject.new.key_length
|
15
|
+
end
|
16
|
+
|
17
|
+
def test_expected_mac_length
|
18
|
+
assert_equal 20, subject.mac_length
|
19
|
+
assert_equal 20, subject.new.mac_length
|
20
|
+
end
|
21
|
+
|
22
|
+
def test_expected_digest
|
23
|
+
hmac = subject.new("1234567890123456")
|
24
|
+
assert_equal "\000\004W\202\204+&\335\311\251P\266\250\214\276\206;\022U\365", hmac.digest("hello world")
|
25
|
+
end
|
26
|
+
|
27
|
+
private
|
28
|
+
|
29
|
+
def subject
|
30
|
+
Net::SSH::Transport::HMAC::SHA1
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
end; end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
require 'common'
|
2
|
+
require 'transport/hmac/test_sha1'
|
3
|
+
require 'net/ssh/transport/hmac/sha1_96'
|
4
|
+
|
5
|
+
module Transport; module HMAC
|
6
|
+
|
7
|
+
class TestSHA1_96 < TestSHA1
|
8
|
+
def test_expected_mac_length
|
9
|
+
assert_equal 12, subject.mac_length
|
10
|
+
assert_equal 12, subject.new.mac_length
|
11
|
+
end
|
12
|
+
|
13
|
+
def test_expected_digest
|
14
|
+
hmac = subject.new("1234567890123456")
|
15
|
+
assert_equal "\000\004W\202\204+&\335\311\251P\266", hmac.digest("hello world")
|
16
|
+
end
|
17
|
+
|
18
|
+
private
|
19
|
+
|
20
|
+
def subject
|
21
|
+
Net::SSH::Transport::HMAC::SHA1_96
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
end; end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
require 'common'
|
2
|
+
require 'net/ssh/transport/hmac/sha2_256'
|
3
|
+
|
4
|
+
module Transport; module HMAC
|
5
|
+
|
6
|
+
class TestSHA2_256 < Test::Unit::TestCase
|
7
|
+
def test_expected_digest_class
|
8
|
+
assert_equal OpenSSL::Digest::SHA256, subject.digest_class
|
9
|
+
assert_equal OpenSSL::Digest::SHA256, subject.new.digest_class
|
10
|
+
end
|
11
|
+
|
12
|
+
def test_expected_key_length
|
13
|
+
assert_equal 32, subject.key_length
|
14
|
+
assert_equal 32, subject.new.key_length
|
15
|
+
end
|
16
|
+
|
17
|
+
def test_expected_mac_length
|
18
|
+
assert_equal 32, subject.mac_length
|
19
|
+
assert_equal 32, subject.new.mac_length
|
20
|
+
end
|
21
|
+
|
22
|
+
def test_expected_digest
|
23
|
+
hmac = subject.new("1234567890123456")
|
24
|
+
assert_equal "\x16^>\x9FhO}\xB1>(\xBAF\xFBW\xB8\xF2\xFA\x824+\xC0\x94\x95\xC2\r\xE6\x88/\xEF\t\xF5%", hmac.digest("hello world")
|
25
|
+
|
26
|
+
end
|
27
|
+
|
28
|
+
private
|
29
|
+
|
30
|
+
def subject
|
31
|
+
Net::SSH::Transport::HMAC::SHA2_256
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
end; end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
require 'common'
|
2
|
+
require 'transport/hmac/test_sha2_256'
|
3
|
+
require 'net/ssh/transport/hmac/sha2_256_96'
|
4
|
+
|
5
|
+
module Transport; module HMAC
|
6
|
+
|
7
|
+
class TestSHA2_256_96 < TestSHA2_256
|
8
|
+
def test_expected_mac_length
|
9
|
+
assert_equal 12, subject.mac_length
|
10
|
+
assert_equal 12, subject.new.mac_length
|
11
|
+
end
|
12
|
+
|
13
|
+
def test_expected_digest
|
14
|
+
hmac = subject.new("1234567890123456")
|
15
|
+
assert_equal "\x16^>\x9FhO}\xB1>(\xBAF", hmac.digest("hello world")
|
16
|
+
end
|
17
|
+
|
18
|
+
private
|
19
|
+
|
20
|
+
def subject
|
21
|
+
Net::SSH::Transport::HMAC::SHA2_256_96
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
end; end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
require 'common'
|
2
|
+
require 'net/ssh/transport/hmac/sha2_512'
|
3
|
+
|
4
|
+
module Transport; module HMAC
|
5
|
+
|
6
|
+
class TestSHA2_512 < Test::Unit::TestCase
|
7
|
+
def test_expected_digest_class
|
8
|
+
assert_equal OpenSSL::Digest::SHA512, subject.digest_class
|
9
|
+
assert_equal OpenSSL::Digest::SHA512, subject.new.digest_class
|
10
|
+
end
|
11
|
+
|
12
|
+
def test_expected_key_length
|
13
|
+
assert_equal 64, subject.key_length
|
14
|
+
assert_equal 64, subject.new.key_length
|
15
|
+
end
|
16
|
+
|
17
|
+
def test_expected_mac_length
|
18
|
+
assert_equal 64, subject.mac_length
|
19
|
+
assert_equal 64, subject.new.mac_length
|
20
|
+
end
|
21
|
+
|
22
|
+
def test_expected_digest
|
23
|
+
hmac = subject.new("1234567890123456")
|
24
|
+
assert_equal "^\xB6\"\xED\x8B\xC4\xDE\xD4\xCF\xD0\r\x18\xA0<\xF4\xB5\x01Efz\xA80i\xFC\x18\xC1\x9A+\xDD\xFE<\xA2\xFDE1Ac\xF4\xADU\r\xFB^0\x90= \x837z\xCC\xD5p4a4\x83\xC6\x04m\xAA\xC1\xC0m", hmac.digest("hello world")
|
25
|
+
|
26
|
+
end
|
27
|
+
|
28
|
+
private
|
29
|
+
|
30
|
+
def subject
|
31
|
+
Net::SSH::Transport::HMAC::SHA2_512
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
end; end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
require 'common'
|
2
|
+
require 'transport/hmac/test_sha2_512'
|
3
|
+
require 'net/ssh/transport/hmac/sha2_512_96'
|
4
|
+
|
5
|
+
module Transport; module HMAC
|
6
|
+
|
7
|
+
class TestSHA2_512_96 < TestSHA2_512
|
8
|
+
def test_expected_mac_length
|
9
|
+
assert_equal 12, subject.mac_length
|
10
|
+
assert_equal 12, subject.new.mac_length
|
11
|
+
end
|
12
|
+
|
13
|
+
def test_expected_digest
|
14
|
+
hmac = subject.new("1234567890123456")
|
15
|
+
assert_equal "^\xB6\"\xED\x8B\xC4\xDE\xD4\xCF\xD0\r\x18", hmac.digest("hello world")
|
16
|
+
end
|
17
|
+
|
18
|
+
private
|
19
|
+
|
20
|
+
def subject
|
21
|
+
Net::SSH::Transport::HMAC::SHA2_512_96
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
end; end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
require 'common'
|
2
|
+
require 'net/ssh/transport/kex/diffie_hellman_group14_sha1'
|
3
|
+
require 'transport/kex/test_diffie_hellman_group1_sha1'
|
4
|
+
require 'ostruct'
|
5
|
+
|
6
|
+
module Transport; module Kex
|
7
|
+
|
8
|
+
class TestDiffieHellmanGroup14SHA1 < TestDiffieHellmanGroup1SHA1
|
9
|
+
def subject
|
10
|
+
Net::SSH::Transport::Kex::DiffieHellmanGroup14SHA1
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end; end
|
@@ -0,0 +1,146 @@
|
|
1
|
+
require 'common'
|
2
|
+
require 'net/ssh/transport/kex/diffie_hellman_group1_sha1'
|
3
|
+
require 'ostruct'
|
4
|
+
|
5
|
+
module Transport; module Kex
|
6
|
+
|
7
|
+
class TestDiffieHellmanGroup1SHA1 < Test::Unit::TestCase
|
8
|
+
include Net::SSH::Transport::Constants
|
9
|
+
|
10
|
+
def setup
|
11
|
+
@dh_options = @dh = @algorithms = @connection = @server_key =
|
12
|
+
@packet_data = @shared_secret = nil
|
13
|
+
end
|
14
|
+
|
15
|
+
def test_exchange_keys_should_return_expected_results_when_successful
|
16
|
+
result = exchange!
|
17
|
+
assert_equal session_id, result[:session_id]
|
18
|
+
assert_equal server_key.to_blob, result[:server_key].to_blob
|
19
|
+
assert_equal shared_secret, result[:shared_secret]
|
20
|
+
assert_equal OpenSSL::Digest::SHA1, result[:hashing_algorithm]
|
21
|
+
end
|
22
|
+
|
23
|
+
def test_exchange_keys_with_unverifiable_host_should_raise_exception
|
24
|
+
connection.verifier { false }
|
25
|
+
assert_raises(Net::SSH::Exception) { exchange! }
|
26
|
+
end
|
27
|
+
|
28
|
+
def test_exchange_keys_with_signature_key_type_mismatch_should_raise_exception
|
29
|
+
assert_raises(Net::SSH::Exception) { exchange! :key_type => "ssh-dss" }
|
30
|
+
end
|
31
|
+
|
32
|
+
def test_exchange_keys_with_host_key_type_mismatch_should_raise_exception
|
33
|
+
algorithms :host_key => "ssh-dss"
|
34
|
+
assert_raises(Net::SSH::Exception) { exchange! :key_type => "ssh-dss" }
|
35
|
+
end
|
36
|
+
|
37
|
+
def test_exchange_keys_when_server_signature_could_not_be_verified_should_raise_exception
|
38
|
+
@signature = "1234567890"
|
39
|
+
assert_raises(Net::SSH::Exception) { exchange! }
|
40
|
+
end
|
41
|
+
|
42
|
+
def test_exchange_keys_should_pass_expected_parameters_to_host_key_verifier
|
43
|
+
verified = false
|
44
|
+
connection.verifier do |data|
|
45
|
+
verified = true
|
46
|
+
assert_equal server_key.to_blob, data[:key].to_blob
|
47
|
+
|
48
|
+
blob = b(:key, data[:key]).to_s
|
49
|
+
fingerprint = OpenSSL::Digest::MD5.hexdigest(blob).scan(/../).join(":")
|
50
|
+
|
51
|
+
assert_equal blob, data[:key_blob]
|
52
|
+
assert_equal fingerprint, data[:fingerprint]
|
53
|
+
assert_equal connection, data[:session]
|
54
|
+
|
55
|
+
true
|
56
|
+
end
|
57
|
+
|
58
|
+
assert_nothing_raised { exchange! }
|
59
|
+
assert verified
|
60
|
+
end
|
61
|
+
|
62
|
+
private
|
63
|
+
|
64
|
+
def exchange!(options={})
|
65
|
+
connection.expect do |t, buffer|
|
66
|
+
assert_equal KEXDH_INIT, buffer.type
|
67
|
+
assert_equal dh.dh.pub_key, buffer.read_bignum
|
68
|
+
t.return(KEXDH_REPLY, :string, b(:key, server_key), :bignum, server_dh_pubkey, :string, b(:string, options[:key_type] || "ssh-rsa", :string, signature))
|
69
|
+
connection.expect do |t2, buffer2|
|
70
|
+
assert_equal NEWKEYS, buffer2.type
|
71
|
+
t2.return(NEWKEYS)
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
dh.exchange_keys
|
76
|
+
end
|
77
|
+
|
78
|
+
def dh_options(options={})
|
79
|
+
@dh_options = options
|
80
|
+
end
|
81
|
+
|
82
|
+
def dh
|
83
|
+
@dh ||= subject.new(algorithms, connection, packet_data.merge(:need_bytes => 20).merge(@dh_options || {}))
|
84
|
+
end
|
85
|
+
|
86
|
+
def algorithms(options={})
|
87
|
+
@algorithms ||= OpenStruct.new(:host_key => options[:host_key] || "ssh-rsa")
|
88
|
+
end
|
89
|
+
|
90
|
+
def connection
|
91
|
+
@connection ||= MockTransport.new
|
92
|
+
end
|
93
|
+
|
94
|
+
def subject
|
95
|
+
Net::SSH::Transport::Kex::DiffieHellmanGroup1SHA1
|
96
|
+
end
|
97
|
+
|
98
|
+
# 512 bits is the smallest possible key that will work with this, so
|
99
|
+
# we use it for speed reasons
|
100
|
+
def server_key(bits=512)
|
101
|
+
@server_key ||= OpenSSL::PKey::RSA.new(bits)
|
102
|
+
end
|
103
|
+
|
104
|
+
def packet_data
|
105
|
+
@packet_data ||= { :client_version_string => "client version string",
|
106
|
+
:server_version_string => "server version string",
|
107
|
+
:server_algorithm_packet => "server algorithm packet",
|
108
|
+
:client_algorithm_packet => "client algorithm packet" }
|
109
|
+
end
|
110
|
+
|
111
|
+
def server_dh_pubkey
|
112
|
+
@server_dh_pubkey ||= bn(1234567890)
|
113
|
+
end
|
114
|
+
|
115
|
+
def shared_secret
|
116
|
+
@shared_secret ||= OpenSSL::BN.new(dh.dh.compute_key(server_dh_pubkey), 2)
|
117
|
+
end
|
118
|
+
|
119
|
+
def session_id
|
120
|
+
@session_id ||= begin
|
121
|
+
buffer = Net::SSH::Buffer.from(:string, packet_data[:client_version_string],
|
122
|
+
:string, packet_data[:server_version_string],
|
123
|
+
:string, packet_data[:client_algorithm_packet],
|
124
|
+
:string, packet_data[:server_algorithm_packet],
|
125
|
+
:string, Net::SSH::Buffer.from(:key, server_key),
|
126
|
+
:bignum, dh.dh.pub_key,
|
127
|
+
:bignum, server_dh_pubkey,
|
128
|
+
:bignum, shared_secret)
|
129
|
+
OpenSSL::Digest::SHA1.digest(buffer.to_s)
|
130
|
+
end
|
131
|
+
end
|
132
|
+
|
133
|
+
def signature
|
134
|
+
@signature ||= server_key.ssh_do_sign(session_id)
|
135
|
+
end
|
136
|
+
|
137
|
+
def bn(number, base=10)
|
138
|
+
OpenSSL::BN.new(number.to_s, base)
|
139
|
+
end
|
140
|
+
|
141
|
+
def b(*args)
|
142
|
+
Net::SSH::Buffer.from(*args)
|
143
|
+
end
|
144
|
+
end
|
145
|
+
|
146
|
+
end; end
|
@@ -0,0 +1,92 @@
|
|
1
|
+
require 'common'
|
2
|
+
require 'transport/kex/test_diffie_hellman_group1_sha1'
|
3
|
+
require 'net/ssh/transport/kex/diffie_hellman_group_exchange_sha1'
|
4
|
+
|
5
|
+
module Transport; module Kex
|
6
|
+
|
7
|
+
class TestDiffieHellmanGroupExchangeSHA1 < TestDiffieHellmanGroup1SHA1
|
8
|
+
KEXDH_GEX_GROUP = 31
|
9
|
+
KEXDH_GEX_INIT = 32
|
10
|
+
KEXDH_GEX_REPLY = 33
|
11
|
+
KEXDH_GEX_REQUEST = 34
|
12
|
+
|
13
|
+
def test_exchange_with_fewer_than_minimum_bits_uses_minimum_bits
|
14
|
+
dh_options :need_bytes => 20
|
15
|
+
assert_equal 1024, need_bits
|
16
|
+
assert_nothing_raised { exchange! }
|
17
|
+
end
|
18
|
+
|
19
|
+
def test_exchange_with_fewer_than_maximum_bits_uses_need_bits
|
20
|
+
dh_options :need_bytes => 500
|
21
|
+
need_bits(8001)
|
22
|
+
assert_nothing_raised { exchange! }
|
23
|
+
end
|
24
|
+
|
25
|
+
def test_exchange_with_more_than_maximum_bits_uses_maximum_bits
|
26
|
+
dh_options :need_bytes => 2000
|
27
|
+
need_bits(8192)
|
28
|
+
assert_nothing_raised { exchange! }
|
29
|
+
end
|
30
|
+
|
31
|
+
def test_that_p_and_g_are_provided_by_the_server
|
32
|
+
assert_nothing_raised { exchange! :p => default_p+2, :g => 3 }
|
33
|
+
assert_equal default_p+2, dh.dh.p
|
34
|
+
assert_equal 3, dh.dh.g
|
35
|
+
end
|
36
|
+
|
37
|
+
private
|
38
|
+
|
39
|
+
def need_bits(bits=1024)
|
40
|
+
@need_bits ||= bits
|
41
|
+
end
|
42
|
+
|
43
|
+
def default_p
|
44
|
+
142326151570335518660743995281621698377057354949884468943021767573608899048361360422513557553514790045512299468953431585300812548859419857171094366358158903433167915517332113861059747425408670144201099811846875730766487278261498262568348338476437200556998366087779709990807518291581860338635288400119315130179
|
45
|
+
end
|
46
|
+
|
47
|
+
def exchange!(options={})
|
48
|
+
connection.expect do |t, buffer|
|
49
|
+
assert_equal KEXDH_GEX_REQUEST, buffer.type
|
50
|
+
assert_equal 1024, buffer.read_long
|
51
|
+
assert_equal need_bits, buffer.read_long
|
52
|
+
assert_equal 8192, buffer.read_long
|
53
|
+
t.return(KEXDH_GEX_GROUP, :bignum, bn(options[:p] || default_p), :bignum, bn(options[:g] || 2))
|
54
|
+
t.expect do |t2, buffer2|
|
55
|
+
assert_equal KEXDH_GEX_INIT, buffer2.type
|
56
|
+
assert_equal dh.dh.pub_key, buffer2.read_bignum
|
57
|
+
t2.return(KEXDH_GEX_REPLY, :string, b(:key, server_key), :bignum, server_dh_pubkey, :string, b(:string, options[:key_type] || "ssh-rsa", :string, signature))
|
58
|
+
t2.expect do |t3, buffer3|
|
59
|
+
assert_equal NEWKEYS, buffer3.type
|
60
|
+
t3.return(NEWKEYS)
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
dh.exchange_keys
|
66
|
+
end
|
67
|
+
|
68
|
+
def subject
|
69
|
+
Net::SSH::Transport::Kex::DiffieHellmanGroupExchangeSHA1
|
70
|
+
end
|
71
|
+
|
72
|
+
def session_id
|
73
|
+
@session_id ||= begin
|
74
|
+
buffer = Net::SSH::Buffer.from(:string, packet_data[:client_version_string],
|
75
|
+
:string, packet_data[:server_version_string],
|
76
|
+
:string, packet_data[:client_algorithm_packet],
|
77
|
+
:string, packet_data[:server_algorithm_packet],
|
78
|
+
:string, Net::SSH::Buffer.from(:key, server_key),
|
79
|
+
:long, 1024,
|
80
|
+
:long, need_bits, # need bits, figure this part out,
|
81
|
+
:long, 8192,
|
82
|
+
:bignum, dh.dh.p,
|
83
|
+
:bignum, dh.dh.g,
|
84
|
+
:bignum, dh.dh.pub_key,
|
85
|
+
:bignum, server_dh_pubkey,
|
86
|
+
:bignum, shared_secret)
|
87
|
+
OpenSSL::Digest::SHA1.digest(buffer.to_s)
|
88
|
+
end
|
89
|
+
end
|
90
|
+
end
|
91
|
+
|
92
|
+
end; end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
require 'common'
|
2
|
+
require 'net/ssh/transport/kex/diffie_hellman_group_exchange_sha1'
|
3
|
+
|
4
|
+
module Transport; module Kex
|
5
|
+
|
6
|
+
class TestDiffieHellmanGroupExchangeSHA256 < TestDiffieHellmanGroupExchangeSHA1
|
7
|
+
private
|
8
|
+
|
9
|
+
def subject
|
10
|
+
Net::SSH::Transport::Kex::DiffieHellmanGroupExchangeSHA256
|
11
|
+
end
|
12
|
+
|
13
|
+
def session_id
|
14
|
+
@session_id ||= begin
|
15
|
+
buffer = Net::SSH::Buffer.from(:string, packet_data[:client_version_string],
|
16
|
+
:string, packet_data[:server_version_string],
|
17
|
+
:string, packet_data[:client_algorithm_packet],
|
18
|
+
:string, packet_data[:server_algorithm_packet],
|
19
|
+
:string, Net::SSH::Buffer.from(:key, server_key),
|
20
|
+
:long, 1024,
|
21
|
+
:long, 1024,
|
22
|
+
:long, 8192,
|
23
|
+
:bignum, dh.dh.p,
|
24
|
+
:bignum, dh.dh.g,
|
25
|
+
:bignum, dh.dh.pub_key,
|
26
|
+
:bignum, server_dh_pubkey,
|
27
|
+
:bignum, shared_secret)
|
28
|
+
OpenSSL::Digest::SHA256.digest(buffer.to_s)
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
end; end
|