Skip to content
This repository
Browse code

Merge pull request #71 from HerbCSO/fix-warnings

Removing warnings
  • Loading branch information...
commit 68d2aafd155c6767d026cc033655aca0bf58ac5c 2 parents 55dc9b2 + c94261f
Delano Mandelbaum delano authored
2  lib/net/ssh/authentication/methods/keyboard_interactive.rb
@@ -42,7 +42,7 @@ def authenticate(next_service, username, password=nil)
42 42 puts(instruction) unless instruction.empty?
43 43 end
44 44
45   - lang_tag = message.read_string
  45 + _ = message.read_string # lang_tag
46 46 responses =[]
47 47
48 48 message.read_long.times do
4 lib/net/ssh/authentication/session.rb
@@ -54,7 +54,7 @@ def authenticate(next_service, username, password=nil)
54 54 debug { "beginning authentication of `#{username}'" }
55 55
56 56 transport.send_message(transport.service_request("ssh-userauth"))
57   - message = expect_message(SERVICE_ACCEPT)
  57 + expect_message(SERVICE_ACCEPT)
58 58
59 59 key_manager = KeyManager.new(logger, options)
60 60 keys.each { |key| key_manager.add(key) } unless keys.empty?
@@ -70,7 +70,7 @@ def authenticate(next_service, username, password=nil)
70 70 debug { "trying #{name}" }
71 71 begin
72 72 method = Methods.const_get(name.split(/\W+/).map { |p| p.capitalize }.join).new(self, :key_manager => key_manager)
73   - rescue NameError => ne
  73 + rescue NameError
74 74 debug{"Mechanism #{name} was requested, but isn't a known type. Ignoring it."}
75 75 next
76 76 end
2  lib/net/ssh/buffer.rb
@@ -261,7 +261,7 @@ def read_keyblob(type)
261 261 else
262 262 begin
263 263 key = OpenSSL::PKey::EC.read_keyblob($1, self)
264   - rescue OpenSSL::PKey::ECError => e
  264 + rescue OpenSSL::PKey::ECError
265 265 raise NotImplementedError, "unsupported key type `#{type}'"
266 266 end
267 267 end
2  lib/net/ssh/key_factory.rb
@@ -105,7 +105,7 @@ def load_public_key(filename)
105 105 # the file describes an RSA or DSA key, and will load it
106 106 # appropriately. The new public key is returned.
107 107 def load_data_public_key(data, filename="")
108   - type, blob = data.split(/ /)
  108 + _, blob = data.split(/ /)
109 109
110 110 raise Net::SSH::Exception, "public key at #{filename} is not valid" if blob.nil?
111 111
2  lib/net/ssh/transport/algorithms.rb
@@ -263,7 +263,7 @@ def parse_server_algorithm_packet(packet)
263 263 # TODO: if first_kex_packet_follows, we need to try to skip the
264 264 # actual kexinit stuff and try to guess what the server is doing...
265 265 # need to read more about this scenario.
266   - first_kex_packet_follows = packet.read_bool
  266 + # first_kex_packet_follows = packet.read_bool
267 267
268 268 return data
269 269 end
2  lib/net/ssh/transport/key_expander.rb
@@ -22,5 +22,5 @@ def self.expand_key(bytes, start, options={})
22 22
23 23 return k
24 24 end
25   -end
  25 + end
26 26 end; end; end
2  lib/net/ssh/transport/openssl.rb
@@ -153,7 +153,7 @@ def self.read_keyblob(curve_name_in_type, buffer)
153 153 key.public_key = point
154 154
155 155 return key
156   - rescue OpenSSL::PKey::ECError => e
  156 + rescue OpenSSL::PKey::ECError
157 157 raise NotImplementedError, "unsupported key type `#{type}'"
158 158 end
159 159
1  lib/net/ssh/transport/packet_stream.rb
@@ -219,7 +219,6 @@ def poll_next_packet
219 219 padding_length = @packet.read_byte
220 220
221 221 payload = @packet.read(@packet_length - padding_length - 1)
222   - padding = @packet.read(padding_length) if padding_length > 0
223 222
224 223 my_computed_hmac = server.hmac.digest([server.sequence_number, @packet.content].pack("NA*"))
225 224 raise Net::SSH::Exception, "corrupted mac detected" if real_hmac != my_computed_hmac
2  lib/net/ssh/transport/server_version.rb
@@ -46,7 +46,7 @@ def negotiate!(socket)
46 46 begin
47 47 b = socket.readpartial(1)
48 48 raise Net::SSH::Disconnect, "connection closed by remote host" if b.nil?
49   - rescue EOFError => e
  49 + rescue EOFError
50 50 raise Net::SSH::Disconnect, "connection closed by remote host"
51 51 end
52 52 @version << b

0 comments on commit 68d2aaf

Please sign in to comment.
Something went wrong with that request. Please try again.