diff options
author | Miklós Fazekas <mfazekas@szemafor.com> | 2021-08-07 07:34:26 +0200 |
---|---|---|
committer | Miklós Fazekas <mfazekas@szemafor.com> | 2021-08-07 08:02:46 +0200 |
commit | acd186e080749e36badf63c99758da47477f2aae (patch) | |
tree | e2bfea141650d19f8a4792be0dec4e130e410bb5 /lib/net/ssh/transport | |
parent | ba3a689713a4635c16eb9a35c5c62be34be60e8b (diff) | |
download | net-ssh-acd186e080749e36badf63c99758da47477f2aae.tar.gz |
Support frozen_string_literalsmfazekas/frozen-literal
Diffstat (limited to 'lib/net/ssh/transport')
-rw-r--r-- | lib/net/ssh/transport/ctr.rb | 8 | ||||
-rw-r--r-- | lib/net/ssh/transport/server_version.rb | 4 | ||||
-rw-r--r-- | lib/net/ssh/transport/state.rb | 2 |
3 files changed, 7 insertions, 7 deletions
diff --git a/lib/net/ssh/transport/ctr.rb b/lib/net/ssh/transport/ctr.rb index d952a86..9c67aff 100644 --- a/lib/net/ssh/transport/ctr.rb +++ b/lib/net/ssh/transport/ctr.rb @@ -32,7 +32,7 @@ module Net::SSH::Transport module CTR def self.extended(orig) orig.instance_eval { - @remaining = "" + @remaining = String.new @counter = nil @counter_len = orig.block_size orig.encrypt @@ -67,13 +67,13 @@ module Net::SSH::Transport end def reset - @remaining = "" + @remaining = String.new end def update(data) @remaining += data - encrypted = "" + encrypted = String.new offset = 0 while (@remaining.bytesize - offset) >= block_size @@ -89,7 +89,7 @@ module Net::SSH::Transport def final s = @remaining.empty? ? '' : xor!(@remaining, _update(@counter)) - @remaining = "" + @remaining = String.new s end diff --git a/lib/net/ssh/transport/server_version.rb b/lib/net/ssh/transport/server_version.rb index 82de8b0..50ffb15 100644 --- a/lib/net/ssh/transport/server_version.rb +++ b/lib/net/ssh/transport/server_version.rb @@ -27,7 +27,7 @@ module Net # Instantiates a new ServerVersion and immediately (and synchronously) # negotiates the SSH protocol in effect, using the given socket. def initialize(socket, logger, timeout = nil) - @header = "" + @header = String.new @version = nil @logger = logger negotiate!(socket, timeout) @@ -48,7 +48,7 @@ module Net raise Net::SSH::ConnectionTimeout, "timeout during server version negotiating" if timeout && !IO.select([socket], nil, nil, timeout) loop do - @version = "" + @version = String.new loop do begin b = socket.readpartial(1) diff --git a/lib/net/ssh/transport/state.rb b/lib/net/ssh/transport/state.rb index 8f5fd8f..b472191 100644 --- a/lib/net/ssh/transport/state.rb +++ b/lib/net/ssh/transport/state.rb @@ -64,7 +64,7 @@ module Net @hmac = HMAC.get("none") @compression = nil @compressor = @decompressor = nil - @next_iv = "" + @next_iv = String.new end # A convenience method for quickly setting multiple values in a single |