summaryrefslogtreecommitdiff
path: root/lib/net/ssh/test/kex.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/net/ssh/test/kex.rb')
-rw-r--r--lib/net/ssh/test/kex.rb12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/net/ssh/test/kex.rb b/lib/net/ssh/test/kex.rb
index e8a0392..9e6f5be 100644
--- a/lib/net/ssh/test/kex.rb
+++ b/lib/net/ssh/test/kex.rb
@@ -5,8 +5,8 @@ require 'net/ssh/transport/algorithms'
require 'net/ssh/transport/constants'
require 'net/ssh/transport/kex'
-module Net
- module SSH
+module Net
+ module SSH
module Test
# An implementation of a key-exchange strategy specifically for unit tests.
# (This strategy would never really work against a real SSH server--it makes
@@ -16,22 +16,22 @@ module Net
# "test" algorithm.
class Kex
include Net::SSH::Transport::Constants
-
+
# Creates a new instance of the testing key-exchange algorithm with the
# given arguments.
def initialize(algorithms, connection, data)
@connection = connection
end
-
+
# Exchange keys with the server. This returns a hash of constant values,
# and does not actually exchange keys.
def exchange_keys
result = Net::SSH::Buffer.from(:byte, NEWKEYS)
@connection.send_message(result)
-
+
buffer = @connection.next_message
raise Net::SSH::Exception, "expected NEWKEYS" unless buffer.type == NEWKEYS
-
+
{ session_id: "abc-xyz",
server_key: OpenSSL::PKey::RSA.new(512),
shared_secret: OpenSSL::BN.new("1234567890", 10),