summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Dreesbach <carsten.dreesbach@opower.com>2012-12-23 07:41:30 -0500
committerCarsten Dreesbach <carsten.dreesbach@opower.com>2012-12-23 07:41:30 -0500
commitc94261fbcb86f9e030c41caf5bc39d033d250f43 (patch)
tree332eefbf12069d4988b705ab76f0f846743c2fa8
parent55dc9b226a2c1ac752a24594b73e309cc94c3b9c (diff)
downloadnet-ssh-c94261fbcb86f9e030c41caf5bc39d033d250f43.tar.gz
Removing warnings
-rw-r--r--lib/net/ssh/authentication/methods/keyboard_interactive.rb2
-rw-r--r--lib/net/ssh/authentication/session.rb4
-rw-r--r--lib/net/ssh/buffer.rb2
-rw-r--r--lib/net/ssh/key_factory.rb2
-rw-r--r--lib/net/ssh/transport/algorithms.rb2
-rw-r--r--lib/net/ssh/transport/key_expander.rb2
-rw-r--r--lib/net/ssh/transport/openssl.rb2
-rw-r--r--lib/net/ssh/transport/packet_stream.rb1
-rw-r--r--lib/net/ssh/transport/server_version.rb2
9 files changed, 9 insertions, 10 deletions
diff --git a/lib/net/ssh/authentication/methods/keyboard_interactive.rb b/lib/net/ssh/authentication/methods/keyboard_interactive.rb
index bf17e4d..5bf82de 100644
--- a/lib/net/ssh/authentication/methods/keyboard_interactive.rb
+++ b/lib/net/ssh/authentication/methods/keyboard_interactive.rb
@@ -42,7 +42,7 @@ module Net
puts(instruction) unless instruction.empty?
end
- lang_tag = message.read_string
+ _ = message.read_string # lang_tag
responses =[]
message.read_long.times do
diff --git a/lib/net/ssh/authentication/session.rb b/lib/net/ssh/authentication/session.rb
index d4fe19b..96c63c5 100644
--- a/lib/net/ssh/authentication/session.rb
+++ b/lib/net/ssh/authentication/session.rb
@@ -54,7 +54,7 @@ module Net; module SSH; module Authentication
debug { "beginning authentication of `#{username}'" }
transport.send_message(transport.service_request("ssh-userauth"))
- message = expect_message(SERVICE_ACCEPT)
+ expect_message(SERVICE_ACCEPT)
key_manager = KeyManager.new(logger, options)
keys.each { |key| key_manager.add(key) } unless keys.empty?
@@ -70,7 +70,7 @@ module Net; module SSH; module Authentication
debug { "trying #{name}" }
begin
method = Methods.const_get(name.split(/\W+/).map { |p| p.capitalize }.join).new(self, :key_manager => key_manager)
- rescue NameError => ne
+ rescue NameError
debug{"Mechanism #{name} was requested, but isn't a known type. Ignoring it."}
next
end
diff --git a/lib/net/ssh/buffer.rb b/lib/net/ssh/buffer.rb
index 83b73f3..d3fb788 100644
--- a/lib/net/ssh/buffer.rb
+++ b/lib/net/ssh/buffer.rb
@@ -261,7 +261,7 @@ module Net; module SSH
else
begin
key = OpenSSL::PKey::EC.read_keyblob($1, self)
- rescue OpenSSL::PKey::ECError => e
+ rescue OpenSSL::PKey::ECError
raise NotImplementedError, "unsupported key type `#{type}'"
end
end
diff --git a/lib/net/ssh/key_factory.rb b/lib/net/ssh/key_factory.rb
index b4b696c..34dc37c 100644
--- a/lib/net/ssh/key_factory.rb
+++ b/lib/net/ssh/key_factory.rb
@@ -105,7 +105,7 @@ module Net; module SSH
# the file describes an RSA or DSA key, and will load it
# appropriately. The new public key is returned.
def load_data_public_key(data, filename="")
- type, blob = data.split(/ /)
+ _, blob = data.split(/ /)
raise Net::SSH::Exception, "public key at #{filename} is not valid" if blob.nil?
diff --git a/lib/net/ssh/transport/algorithms.rb b/lib/net/ssh/transport/algorithms.rb
index de084ff..d34e1ea 100644
--- a/lib/net/ssh/transport/algorithms.rb
+++ b/lib/net/ssh/transport/algorithms.rb
@@ -263,7 +263,7 @@ module Net; module SSH; module Transport
# TODO: if first_kex_packet_follows, we need to try to skip the
# actual kexinit stuff and try to guess what the server is doing...
# need to read more about this scenario.
- first_kex_packet_follows = packet.read_bool
+ # first_kex_packet_follows = packet.read_bool
return data
end
diff --git a/lib/net/ssh/transport/key_expander.rb b/lib/net/ssh/transport/key_expander.rb
index 86e608d..a513d85 100644
--- a/lib/net/ssh/transport/key_expander.rb
+++ b/lib/net/ssh/transport/key_expander.rb
@@ -22,5 +22,5 @@ module Net; module SSH; module Transport
return k
end
-end
+ end
end; end; end
diff --git a/lib/net/ssh/transport/openssl.rb b/lib/net/ssh/transport/openssl.rb
index 3364b98..dc2fdb0 100644
--- a/lib/net/ssh/transport/openssl.rb
+++ b/lib/net/ssh/transport/openssl.rb
@@ -153,7 +153,7 @@ module OpenSSL
key.public_key = point
return key
- rescue OpenSSL::PKey::ECError => e
+ rescue OpenSSL::PKey::ECError
raise NotImplementedError, "unsupported key type `#{type}'"
end
diff --git a/lib/net/ssh/transport/packet_stream.rb b/lib/net/ssh/transport/packet_stream.rb
index 807db5c..7d5fcab 100644
--- a/lib/net/ssh/transport/packet_stream.rb
+++ b/lib/net/ssh/transport/packet_stream.rb
@@ -219,7 +219,6 @@ module Net; module SSH; module Transport
padding_length = @packet.read_byte
payload = @packet.read(@packet_length - padding_length - 1)
- padding = @packet.read(padding_length) if padding_length > 0
my_computed_hmac = server.hmac.digest([server.sequence_number, @packet.content].pack("NA*"))
raise Net::SSH::Exception, "corrupted mac detected" if real_hmac != my_computed_hmac
diff --git a/lib/net/ssh/transport/server_version.rb b/lib/net/ssh/transport/server_version.rb
index 9cdd36c..ca4a072 100644
--- a/lib/net/ssh/transport/server_version.rb
+++ b/lib/net/ssh/transport/server_version.rb
@@ -46,7 +46,7 @@ module Net; module SSH; module Transport
begin
b = socket.readpartial(1)
raise Net::SSH::Disconnect, "connection closed by remote host" if b.nil?
- rescue EOFError => e
+ rescue EOFError
raise Net::SSH::Disconnect, "connection closed by remote host"
end
@version << b