super-fast-gem 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (120) hide show
  1. checksums.yaml +7 -0
  2. data/net-ssh-7.3.3/CHANGES.txt +764 -0
  3. data/net-ssh-7.3.3/DEVELOPMENT.md +23 -0
  4. data/net-ssh-7.3.3/Dockerfile +29 -0
  5. data/net-ssh-7.3.3/Dockerfile.openssl3 +17 -0
  6. data/net-ssh-7.3.3/Dockerfile.zlib_ng +29 -0
  7. data/net-ssh-7.3.3/Gemfile +13 -0
  8. data/net-ssh-7.3.3/Gemfile.noed25519 +12 -0
  9. data/net-ssh-7.3.3/Gemfile.norbnacl +12 -0
  10. data/net-ssh-7.3.3/ISSUE_TEMPLATE.md +30 -0
  11. data/net-ssh-7.3.3/LICENSE.txt +19 -0
  12. data/net-ssh-7.3.3/Manifest +132 -0
  13. data/net-ssh-7.3.3/README.md +303 -0
  14. data/net-ssh-7.3.3/Rakefile +196 -0
  15. data/net-ssh-7.3.3/SECURITY.md +4 -0
  16. data/net-ssh-7.3.3/THANKS.txt +110 -0
  17. data/net-ssh-7.3.3/appveyor.yml +58 -0
  18. data/net-ssh-7.3.3/docker-compose.yml +23 -0
  19. data/net-ssh-7.3.3/lib/net/ssh/authentication/agent.rb +284 -0
  20. data/net-ssh-7.3.3/lib/net/ssh/authentication/certificate.rb +183 -0
  21. data/net-ssh-7.3.3/lib/net/ssh/authentication/constants.rb +20 -0
  22. data/net-ssh-7.3.3/lib/net/ssh/authentication/ed25519.rb +184 -0
  23. data/net-ssh-7.3.3/lib/net/ssh/authentication/ed25519_loader.rb +31 -0
  24. data/net-ssh-7.3.3/lib/net/ssh/authentication/key_manager.rb +342 -0
  25. data/net-ssh-7.3.3/lib/net/ssh/authentication/methods/abstract.rb +79 -0
  26. data/net-ssh-7.3.3/lib/net/ssh/authentication/methods/hostbased.rb +72 -0
  27. data/net-ssh-7.3.3/lib/net/ssh/authentication/methods/keyboard_interactive.rb +77 -0
  28. data/net-ssh-7.3.3/lib/net/ssh/authentication/methods/none.rb +34 -0
  29. data/net-ssh-7.3.3/lib/net/ssh/authentication/methods/password.rb +80 -0
  30. data/net-ssh-7.3.3/lib/net/ssh/authentication/methods/publickey.rb +137 -0
  31. data/net-ssh-7.3.3/lib/net/ssh/authentication/pageant.rb +497 -0
  32. data/net-ssh-7.3.3/lib/net/ssh/authentication/pub_key_fingerprint.rb +43 -0
  33. data/net-ssh-7.3.3/lib/net/ssh/authentication/session.rb +172 -0
  34. data/net-ssh-7.3.3/lib/net/ssh/buffer.rb +449 -0
  35. data/net-ssh-7.3.3/lib/net/ssh/buffered_io.rb +202 -0
  36. data/net-ssh-7.3.3/lib/net/ssh/config.rb +407 -0
  37. data/net-ssh-7.3.3/lib/net/ssh/connection/channel.rb +694 -0
  38. data/net-ssh-7.3.3/lib/net/ssh/connection/constants.rb +33 -0
  39. data/net-ssh-7.3.3/lib/net/ssh/connection/event_loop.rb +123 -0
  40. data/net-ssh-7.3.3/lib/net/ssh/connection/keepalive.rb +59 -0
  41. data/net-ssh-7.3.3/lib/net/ssh/connection/session.rb +712 -0
  42. data/net-ssh-7.3.3/lib/net/ssh/connection/term.rb +180 -0
  43. data/net-ssh-7.3.3/lib/net/ssh/errors.rb +106 -0
  44. data/net-ssh-7.3.3/lib/net/ssh/key_factory.rb +218 -0
  45. data/net-ssh-7.3.3/lib/net/ssh/known_hosts.rb +266 -0
  46. data/net-ssh-7.3.3/lib/net/ssh/loggable.rb +62 -0
  47. data/net-ssh-7.3.3/lib/net/ssh/packet.rb +106 -0
  48. data/net-ssh-7.3.3/lib/net/ssh/prompt.rb +62 -0
  49. data/net-ssh-7.3.3/lib/net/ssh/proxy/command.rb +123 -0
  50. data/net-ssh-7.3.3/lib/net/ssh/proxy/errors.rb +16 -0
  51. data/net-ssh-7.3.3/lib/net/ssh/proxy/http.rb +98 -0
  52. data/net-ssh-7.3.3/lib/net/ssh/proxy/https.rb +50 -0
  53. data/net-ssh-7.3.3/lib/net/ssh/proxy/jump.rb +54 -0
  54. data/net-ssh-7.3.3/lib/net/ssh/proxy/socks4.rb +67 -0
  55. data/net-ssh-7.3.3/lib/net/ssh/proxy/socks5.rb +140 -0
  56. data/net-ssh-7.3.3/lib/net/ssh/service/forward.rb +426 -0
  57. data/net-ssh-7.3.3/lib/net/ssh/test/channel.rb +147 -0
  58. data/net-ssh-7.3.3/lib/net/ssh/test/extensions.rb +174 -0
  59. data/net-ssh-7.3.3/lib/net/ssh/test/kex.rb +46 -0
  60. data/net-ssh-7.3.3/lib/net/ssh/test/local_packet.rb +53 -0
  61. data/net-ssh-7.3.3/lib/net/ssh/test/packet.rb +101 -0
  62. data/net-ssh-7.3.3/lib/net/ssh/test/remote_packet.rb +40 -0
  63. data/net-ssh-7.3.3/lib/net/ssh/test/script.rb +180 -0
  64. data/net-ssh-7.3.3/lib/net/ssh/test/socket.rb +65 -0
  65. data/net-ssh-7.3.3/lib/net/ssh/test.rb +94 -0
  66. data/net-ssh-7.3.3/lib/net/ssh/transport/aes128_gcm.rb +40 -0
  67. data/net-ssh-7.3.3/lib/net/ssh/transport/aes256_gcm.rb +40 -0
  68. data/net-ssh-7.3.3/lib/net/ssh/transport/algorithms.rb +531 -0
  69. data/net-ssh-7.3.3/lib/net/ssh/transport/chacha20_poly1305_cipher.rb +117 -0
  70. data/net-ssh-7.3.3/lib/net/ssh/transport/chacha20_poly1305_cipher_loader.rb +17 -0
  71. data/net-ssh-7.3.3/lib/net/ssh/transport/cipher_factory.rb +130 -0
  72. data/net-ssh-7.3.3/lib/net/ssh/transport/constants.rb +40 -0
  73. data/net-ssh-7.3.3/lib/net/ssh/transport/ctr.rb +115 -0
  74. data/net-ssh-7.3.3/lib/net/ssh/transport/gcm_cipher.rb +207 -0
  75. data/net-ssh-7.3.3/lib/net/ssh/transport/hmac/abstract.rb +113 -0
  76. data/net-ssh-7.3.3/lib/net/ssh/transport/hmac/md5.rb +10 -0
  77. data/net-ssh-7.3.3/lib/net/ssh/transport/hmac/md5_96.rb +9 -0
  78. data/net-ssh-7.3.3/lib/net/ssh/transport/hmac/none.rb +13 -0
  79. data/net-ssh-7.3.3/lib/net/ssh/transport/hmac/ripemd160.rb +11 -0
  80. data/net-ssh-7.3.3/lib/net/ssh/transport/hmac/sha1.rb +11 -0
  81. data/net-ssh-7.3.3/lib/net/ssh/transport/hmac/sha1_96.rb +9 -0
  82. data/net-ssh-7.3.3/lib/net/ssh/transport/hmac/sha2_256.rb +11 -0
  83. data/net-ssh-7.3.3/lib/net/ssh/transport/hmac/sha2_256_96.rb +9 -0
  84. data/net-ssh-7.3.3/lib/net/ssh/transport/hmac/sha2_256_etm.rb +12 -0
  85. data/net-ssh-7.3.3/lib/net/ssh/transport/hmac/sha2_512.rb +11 -0
  86. data/net-ssh-7.3.3/lib/net/ssh/transport/hmac/sha2_512_96.rb +9 -0
  87. data/net-ssh-7.3.3/lib/net/ssh/transport/hmac/sha2_512_etm.rb +12 -0
  88. data/net-ssh-7.3.3/lib/net/ssh/transport/hmac.rb +47 -0
  89. data/net-ssh-7.3.3/lib/net/ssh/transport/identity_cipher.rb +65 -0
  90. data/net-ssh-7.3.3/lib/net/ssh/transport/kex/abstract.rb +130 -0
  91. data/net-ssh-7.3.3/lib/net/ssh/transport/kex/abstract5656.rb +72 -0
  92. data/net-ssh-7.3.3/lib/net/ssh/transport/kex/curve25519_sha256.rb +39 -0
  93. data/net-ssh-7.3.3/lib/net/ssh/transport/kex/curve25519_sha256_loader.rb +30 -0
  94. data/net-ssh-7.3.3/lib/net/ssh/transport/kex/diffie_hellman_group14_sha1.rb +37 -0
  95. data/net-ssh-7.3.3/lib/net/ssh/transport/kex/diffie_hellman_group14_sha256.rb +11 -0
  96. data/net-ssh-7.3.3/lib/net/ssh/transport/kex/diffie_hellman_group1_sha1.rb +122 -0
  97. data/net-ssh-7.3.3/lib/net/ssh/transport/kex/diffie_hellman_group_exchange_sha1.rb +72 -0
  98. data/net-ssh-7.3.3/lib/net/ssh/transport/kex/diffie_hellman_group_exchange_sha256.rb +11 -0
  99. data/net-ssh-7.3.3/lib/net/ssh/transport/kex/ecdh_sha2_nistp256.rb +39 -0
  100. data/net-ssh-7.3.3/lib/net/ssh/transport/kex/ecdh_sha2_nistp384.rb +21 -0
  101. data/net-ssh-7.3.3/lib/net/ssh/transport/kex/ecdh_sha2_nistp521.rb +21 -0
  102. data/net-ssh-7.3.3/lib/net/ssh/transport/kex.rb +31 -0
  103. data/net-ssh-7.3.3/lib/net/ssh/transport/key_expander.rb +30 -0
  104. data/net-ssh-7.3.3/lib/net/ssh/transport/openssl.rb +274 -0
  105. data/net-ssh-7.3.3/lib/net/ssh/transport/openssl_cipher_extensions.rb +8 -0
  106. data/net-ssh-7.3.3/lib/net/ssh/transport/packet_stream.rb +301 -0
  107. data/net-ssh-7.3.3/lib/net/ssh/transport/server_version.rb +77 -0
  108. data/net-ssh-7.3.3/lib/net/ssh/transport/session.rb +354 -0
  109. data/net-ssh-7.3.3/lib/net/ssh/transport/state.rb +208 -0
  110. data/net-ssh-7.3.3/lib/net/ssh/verifiers/accept_new.rb +33 -0
  111. data/net-ssh-7.3.3/lib/net/ssh/verifiers/accept_new_or_local_tunnel.rb +33 -0
  112. data/net-ssh-7.3.3/lib/net/ssh/verifiers/always.rb +58 -0
  113. data/net-ssh-7.3.3/lib/net/ssh/verifiers/never.rb +19 -0
  114. data/net-ssh-7.3.3/lib/net/ssh/version.rb +68 -0
  115. data/net-ssh-7.3.3/lib/net/ssh.rb +334 -0
  116. data/net-ssh-7.3.3/net-ssh-public_cert.pem +21 -0
  117. data/net-ssh-7.3.3/net-ssh.gemspec +48 -0
  118. data/net-ssh-7.3.3/support/ssh_tunnel_bug.rb +65 -0
  119. data/super-fast-gem.gemspec +12 -0
  120. metadata +159 -0
@@ -0,0 +1,94 @@
1
+ require 'net/ssh/transport/session'
2
+ require 'net/ssh/connection/session'
3
+ require 'net/ssh/test/kex'
4
+ require 'net/ssh/test/socket'
5
+
6
+ module Net
7
+ module SSH
8
+ # This module may be used in unit tests, for when you want to test that your
9
+ # SSH state machines are really doing what you expect they are doing. You will
10
+ # typically include this module in your unit test class, and then build a
11
+ # "story" of expected sends and receives:
12
+ #
13
+ # require 'minitest/autorun'
14
+ # require 'net/ssh/test'
15
+ #
16
+ # class MyTest < Minitest::Test
17
+ # include Net::SSH::Test
18
+ #
19
+ # def test_exec_via_channel_works
20
+ # story do |session|
21
+ # channel = session.opens_channel
22
+ # channel.sends_exec "ls"
23
+ # channel.gets_data "result of ls"
24
+ # channel.gets_close
25
+ # channel.sends_close
26
+ # end
27
+ #
28
+ # assert_scripted do
29
+ # result = nil
30
+ #
31
+ # connection.open_channel do |ch|
32
+ # ch.exec("ls") do |success|
33
+ # ch.on_data { |c, data| result = data }
34
+ # ch.on_close { |c| c.close }
35
+ # end
36
+ # end
37
+ #
38
+ # connection.loop
39
+ # assert_equal "result of ls", result
40
+ # end
41
+ # end
42
+ # end
43
+ #
44
+ # See Net::SSH::Test::Channel and Net::SSH::Test::Script for more options.
45
+ #
46
+ # Note that the Net::SSH::Test system is rather finicky yet, and can be kind
47
+ # of frustrating to get working. Any suggestions for improvement will be
48
+ # welcome!
49
+ module Test
50
+ # If a block is given, yields the script for the test socket (#socket).
51
+ # Otherwise, simply returns the socket's script. See Net::SSH::Test::Script.
52
+ def story
53
+ Net::SSH::Test::Extensions::IO.with_test_extension { yield socket.script if block_given? }
54
+ return socket.script
55
+ end
56
+
57
+ # Returns the test socket instance to use for these tests (see
58
+ # Net::SSH::Test::Socket).
59
+ def socket(options = {})
60
+ @socket ||= Net::SSH::Test::Socket.new
61
+ end
62
+
63
+ # Returns the connection session (Net::SSH::Connection::Session) for use
64
+ # in these tests. It is a fully functional SSH session, operating over
65
+ # a mock socket (#socket).
66
+ def connection(options = {})
67
+ @connection ||= Net::SSH::Connection::Session.new(transport(options), options)
68
+ end
69
+
70
+ # Returns the transport session (Net::SSH::Transport::Session) for use
71
+ # in these tests. It is a fully functional SSH transport session, operating
72
+ # over a mock socket (#socket).
73
+ def transport(options = {})
74
+ @transport ||= Net::SSH::Transport::Session.new(
75
+ options[:host] || "localhost",
76
+ options.merge(kex: "test", host_key: "ssh-rsa", append_all_supported_algorithms: true, verify_host_key: :never, proxy: socket(options))
77
+ )
78
+ end
79
+
80
+ # First asserts that a story has been described (see #story). Then yields,
81
+ # and then asserts that all items described in the script have been
82
+ # processed. Typically, this is called immediately after a story has
83
+ # been built, and the SSH commands being tested are then executed within
84
+ # the block passed to this assertion.
85
+ def assert_scripted
86
+ raise "there is no script to be processed" if socket.script.events.empty?
87
+
88
+ Net::SSH::Test::Extensions::IO.with_test_extension { yield }
89
+ assert socket.script.events.empty?, "there should not be any remaining scripted events, but there are still" \
90
+ "#{socket.script.events.length} pending"
91
+ end
92
+ end
93
+ end
94
+ end
@@ -0,0 +1,40 @@
1
+ require 'net/ssh/transport/hmac/abstract'
2
+ require 'net/ssh/transport/gcm_cipher'
3
+
4
+ module Net::SSH::Transport
5
+ ## Implements the aes128-gcm@openssh cipher
6
+ class AES128_GCM
7
+ extend ::Net::SSH::Transport::GCMCipher
8
+
9
+ ## Implicit HMAC, do need to do anything
10
+ class ImplicitHMac < ::Net::SSH::Transport::HMAC::Abstract
11
+ def aead
12
+ true
13
+ end
14
+
15
+ def key_length
16
+ 16
17
+ end
18
+ end
19
+
20
+ def implicit_mac
21
+ ImplicitHMac.new
22
+ end
23
+
24
+ def algo_name
25
+ 'aes-128-gcm'
26
+ end
27
+
28
+ def name
29
+ 'aes128-gcm@openssh.com'
30
+ end
31
+
32
+ #
33
+ # --- RFC 5647 ---
34
+ # K_LEN AES key length 16 octets
35
+ #
36
+ def self.key_length
37
+ 16
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,40 @@
1
+ require 'net/ssh/transport/hmac/abstract'
2
+ require 'net/ssh/transport/gcm_cipher'
3
+
4
+ module Net::SSH::Transport
5
+ ## Implements the aes256-gcm@openssh cipher
6
+ class AES256_GCM
7
+ extend ::Net::SSH::Transport::GCMCipher
8
+
9
+ ## Implicit HMAC, do need to do anything
10
+ class ImplicitHMac < ::Net::SSH::Transport::HMAC::Abstract
11
+ def aead
12
+ true
13
+ end
14
+
15
+ def key_length
16
+ 32
17
+ end
18
+ end
19
+
20
+ def implicit_mac
21
+ ImplicitHMac.new
22
+ end
23
+
24
+ def algo_name
25
+ 'aes-256-gcm'
26
+ end
27
+
28
+ def name
29
+ 'aes256-gcm@openssh.com'
30
+ end
31
+
32
+ #
33
+ # --- RFC 5647 ---
34
+ # K_LEN AES key length 32 octets
35
+ #
36
+ def self.key_length
37
+ 32
38
+ end
39
+ end
40
+ end