Permalink
Browse files

Removing warnings

  • Loading branch information...
1 parent 55dc9b2 commit c94261fbcb86f9e030c41caf5bc39d033d250f43 @HerbCSO HerbCSO committed Dec 23, 2012
@@ -42,7 +42,7 @@ def authenticate(next_service, username, password=nil)
puts(instruction) unless instruction.empty?
end
- lang_tag = message.read_string
+ _ = message.read_string # lang_tag
responses =[]
message.read_long.times do
@@ -54,7 +54,7 @@ def authenticate(next_service, username, password=nil)
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 @@ def authenticate(next_service, username, password=nil)
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
View
@@ -261,7 +261,7 @@ def read_keyblob(type)
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
@@ -105,7 +105,7 @@ def load_public_key(filename)
# 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?
@@ -263,7 +263,7 @@ def parse_server_algorithm_packet(packet)
# 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
@@ -22,5 +22,5 @@ def self.expand_key(bytes, start, options={})
return k
end
-end
+ end
end; end; end
@@ -153,7 +153,7 @@ def self.read_keyblob(curve_name_in_type, buffer)
key.public_key = point
return key
- rescue OpenSSL::PKey::ECError => e
+ rescue OpenSSL::PKey::ECError
raise NotImplementedError, "unsupported key type `#{type}'"
end
@@ -219,7 +219,6 @@ def poll_next_packet
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
@@ -46,7 +46,7 @@ def negotiate!(socket)
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

0 comments on commit c94261f

Please sign in to comment.