summaryrefslogtreecommitdiff
path: root/test/authentication
diff options
context:
space:
mode:
Diffstat (limited to 'test/authentication')
-rw-r--r--test/authentication/methods/common.rb2
-rw-r--r--test/authentication/methods/test_abstract.rb1
-rw-r--r--test/authentication/methods/test_hostbased.rb2
-rw-r--r--test/authentication/methods/test_keyboard_interactive.rb2
-rw-r--r--test/authentication/methods/test_none.rb2
-rw-r--r--test/authentication/methods/test_password.rb2
-rw-r--r--test/authentication/methods/test_publickey.rb2
-rw-r--r--test/authentication/test_agent.rb5
-rw-r--r--test/authentication/test_ed25519.rb2
-rw-r--r--test/authentication/test_key_manager.rb2
-rw-r--r--test/authentication/test_session.rb2
11 files changed, 5 insertions, 19 deletions
diff --git a/test/authentication/methods/common.rb b/test/authentication/methods/common.rb
index 8cf2ca2..5546e1c 100644
--- a/test/authentication/methods/common.rb
+++ b/test/authentication/methods/common.rb
@@ -1,6 +1,5 @@
module Authentication
module Methods
-
module Common
include Net::SSH::Authentication::Constants
@@ -31,6 +30,5 @@ module Authentication
end
end
-
end
end
diff --git a/test/authentication/methods/test_abstract.rb b/test/authentication/methods/test_abstract.rb
index a839699..4f930a9 100644
--- a/test/authentication/methods/test_abstract.rb
+++ b/test/authentication/methods/test_abstract.rb
@@ -4,7 +4,6 @@ require 'net/ssh/authentication/methods/abstract'
module Authentication
module Methods
-
class TestAbstract < NetSSHTest
include Common
diff --git a/test/authentication/methods/test_hostbased.rb b/test/authentication/methods/test_hostbased.rb
index 4fbd37a..5e4eb0f 100644
--- a/test/authentication/methods/test_hostbased.rb
+++ b/test/authentication/methods/test_hostbased.rb
@@ -4,7 +4,6 @@ require 'authentication/methods/common'
module Authentication
module Methods
-
class TestHostbased < NetSSHTest
include Common
@@ -57,6 +56,7 @@ module Authentication
def signature_parameters(key)
Proc.new do |given_key, data|
next false unless given_key.to_blob == key.to_blob
+
buffer = Net::SSH::Buffer.new(data)
buffer.read_string == "abcxyz123" && # session-id
buffer.read_byte == USERAUTH_REQUEST && # type
diff --git a/test/authentication/methods/test_keyboard_interactive.rb b/test/authentication/methods/test_keyboard_interactive.rb
index 9fad914..e18f02c 100644
--- a/test/authentication/methods/test_keyboard_interactive.rb
+++ b/test/authentication/methods/test_keyboard_interactive.rb
@@ -4,7 +4,6 @@ require_relative 'common'
module Authentication
module Methods
-
class TestKeyboardInteractive < NetSSHTest
include Common
@@ -128,6 +127,5 @@ module Authentication
subject(options)
end
end
-
end
end
diff --git a/test/authentication/methods/test_none.rb b/test/authentication/methods/test_none.rb
index 8e31c08..223b33c 100644
--- a/test/authentication/methods/test_none.rb
+++ b/test/authentication/methods/test_none.rb
@@ -4,7 +4,6 @@ require 'authentication/methods/common'
module Authentication
module Methods
-
class TestNone < NetSSHTest
include Common
@@ -38,6 +37,5 @@ module Authentication
@subject ||= Net::SSH::Authentication::Methods::None.new(session(options), options)
end
end
-
end
end
diff --git a/test/authentication/methods/test_password.rb b/test/authentication/methods/test_password.rb
index d119fae..a5ddf85 100644
--- a/test/authentication/methods/test_password.rb
+++ b/test/authentication/methods/test_password.rb
@@ -5,7 +5,6 @@ require 'authentication/methods/common'
module Authentication
module Methods
-
class TestPassword < NetSSHTest
include Common
@@ -93,6 +92,5 @@ module Authentication
@subject ||= Net::SSH::Authentication::Methods::Password.new(session(options), options)
end
end
-
end
end
diff --git a/test/authentication/methods/test_publickey.rb b/test/authentication/methods/test_publickey.rb
index 8f2cc73..4f5765d 100644
--- a/test/authentication/methods/test_publickey.rb
+++ b/test/authentication/methods/test_publickey.rb
@@ -4,7 +4,6 @@ require 'authentication/methods/common'
module Authentication
module Methods
-
class TestPublickey < NetSSHTest
include Common
@@ -110,6 +109,7 @@ module Authentication
def signature_parameters(key)
Proc.new do |given_key, data|
next false unless given_key.to_blob == key.to_blob
+
buffer = Net::SSH::Buffer.new(data)
buffer.read_string == "abcxyz123" && # session-id
buffer.read_byte == USERAUTH_REQUEST && # type
diff --git a/test/authentication/test_agent.rb b/test/authentication/test_agent.rb
index 9dea16e..3b4ef37 100644
--- a/test/authentication/test_agent.rb
+++ b/test/authentication/test_agent.rb
@@ -2,7 +2,6 @@ require_relative '../common'
require 'net/ssh/authentication/agent'
module Authentication
-
class TestAgent < NetSSHTest
SSH2_AGENT_REQUEST_VERSION = 1
SSH2_AGENT_REQUEST_IDENTITIES = 11
@@ -322,6 +321,7 @@ module Authentication
def test_add_ed25519_identity
return unless Net::SSH::Authentication::ED25519Loader::LOADED
+
ed25519 = Net::SSH::Authentication::ED25519::PrivKey.read(ED25519, nil)
socket.expect do |s,type,buffer|
assert_equal SSH2_AGENT_ADD_IDENTITY, type
@@ -339,6 +339,7 @@ module Authentication
def test_add_ed25519_cert_identity
return unless Net::SSH::Authentication::ED25519Loader::LOADED
+
cert = make_cert(Net::SSH::Authentication::ED25519::PrivKey.read(ED25519, nil))
socket.expect do |s,type,buffer|
assert_equal SSH2_AGENT_ADD_IDENTITY, type
@@ -433,6 +434,7 @@ module Authentication
def send(data, flags)
raise "got #{data.inspect} but no packet was expected" unless @expectation
+
buffer = Net::SSH::Buffer.new(data)
buffer.read_long # skip the length
type = buffer.read_byte
@@ -470,5 +472,4 @@ module Authentication
@agent_socket_factory ||= -> {"/foo/bar.sock"}
end
end
-
end
diff --git a/test/authentication/test_ed25519.rb b/test/authentication/test_ed25519.rb
index 7430541..279aa85 100644
--- a/test/authentication/test_ed25519.rb
+++ b/test/authentication/test_ed25519.rb
@@ -6,7 +6,6 @@ unless ENV['NET_SSH_NO_ED25519']
require 'base64'
module Authentication
-
class TestED25519 < NetSSHTest
def setup
raise "No ED25519 set NET_SSH_NO_ED25519 to ignore this test" unless Net::SSH::Authentication::ED25519Loader::LOADED
@@ -158,7 +157,6 @@ unless ENV['NET_SSH_NO_ED25519']
'SHA256:u6mXnY8P1b0FODGp8mckqOB33u8+jvkSCtJbD5Q9klg'
end
end
-
end
end
diff --git a/test/authentication/test_key_manager.rb b/test/authentication/test_key_manager.rb
index c40779f..79900a8 100644
--- a/test/authentication/test_key_manager.rb
+++ b/test/authentication/test_key_manager.rb
@@ -2,7 +2,6 @@ require_relative '../common'
require 'net/ssh/authentication/key_manager'
module Authentication
-
class TestKeyManager < NetSSHTest
def test_key_files_and_known_identities_are_empty_by_default
assert manager.key_files.empty?
@@ -381,5 +380,4 @@ module Authentication
@manager ||= Net::SSH::Authentication::KeyManager.new(nil, { password_prompt: prompt }.merge(options))
end
end
-
end
diff --git a/test/authentication/test_session.rb b/test/authentication/test_session.rb
index db37467..3e46def 100644
--- a/test/authentication/test_session.rb
+++ b/test/authentication/test_session.rb
@@ -2,7 +2,6 @@ require_relative '../common'
require 'net/ssh/authentication/session'
module Authentication
-
class TestSession < NetSSHTest
include Net::SSH::Transport::Constants
include Net::SSH::Authentication::Constants
@@ -292,5 +291,4 @@ module Authentication
EOF
end
end
-
end