diff options
author | Florian Wininger <florian@cyberwatch.fr> | 2021-07-01 22:15:37 +0200 |
---|---|---|
committer | Florian Wininger <florian@cyberwatch.fr> | 2021-07-01 22:15:37 +0200 |
commit | 093a84100e51365db9680d8ebd0755a4f1ebb455 (patch) | |
tree | 62eb306614d8cfaf530adcac180871fa05c5b35a | |
parent | f983dfcfe60442be8a835f2314f27e98cd6698c7 (diff) | |
download | net-ssh-093a84100e51365db9680d8ebd0755a4f1ebb455.tar.gz |
Add Space after colon
-rw-r--r-- | .rubocop_todo.yml | 8 | ||||
-rw-r--r-- | lib/net/ssh/authentication/ed25519.rb | 2 | ||||
-rw-r--r-- | test/integration/test_ed25519_pkeys.rb | 2 | ||||
-rw-r--r-- | test/verifiers/test_always.rb | 12 |
4 files changed, 8 insertions, 16 deletions
diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 39464ef..f716dcb 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -79,14 +79,6 @@ Layout/MultilineOperationIndentation: - 'test/authentication/methods/test_hostbased.rb' - 'test/authentication/methods/test_publickey.rb' -# Offense count: 16 -# Cop supports --auto-correct. -Layout/SpaceAfterColon: - Exclude: - - 'lib/net/ssh/authentication/ed25519.rb' - - 'test/integration/test_ed25519_pkeys.rb' - - 'test/verifiers/test_always.rb' - # Offense count: 290 # Cop supports --auto-correct. Layout/SpaceAfterComma: diff --git a/lib/net/ssh/authentication/ed25519.rb b/lib/net/ssh/authentication/ed25519.rb index 9416bbc..5e047ec 100644 --- a/lib/net/ssh/authentication/ed25519.rb +++ b/lib/net/ssh/authentication/ed25519.rb @@ -77,7 +77,7 @@ module Net key = '\x00' * (keylen + ivlen) end - cipher = CipherFactory.get(ciphername, key: key[0...keylen], iv:key[keylen...keylen + ivlen], decrypt: true) + cipher = CipherFactory.get(ciphername, key: key[0...keylen], iv: key[keylen...keylen + ivlen], decrypt: true) decoded = cipher.update(buffer.remainder_as_buffer.to_s) decoded << cipher.final diff --git a/test/integration/test_ed25519_pkeys.rb b/test/integration/test_ed25519_pkeys.rb index d42cbfd..7ac5823 100644 --- a/test/integration/test_ed25519_pkeys.rb +++ b/test/integration/test_ed25519_pkeys.rb @@ -52,7 +52,7 @@ unless ENV['NET_SSH_NO_ED25519'] # TODO: fix bug in net ssh which reads public key even if private key is there sh "mv #{dir}/id_rsa_ed25519.pub #{dir}/id_rsa_ed25519.pub.hidden" - ret = Net::SSH.start("localhost", "net_ssh_1", { keys: "#{dir}/id_rsa_ed25519", passphrase:'pwd' }) do |ssh| + ret = Net::SSH.start("localhost", "net_ssh_1", { keys: "#{dir}/id_rsa_ed25519", passphrase: 'pwd' }) do |ssh| ssh.exec! 'echo "hello from:$USER"' end assert_equal "hello from:net_ssh_1\n", ret diff --git a/test/verifiers/test_always.rb b/test/verifiers/test_always.rb index 64547ff..9d93d9a 100644 --- a/test/verifiers/test_always.rb +++ b/test/verifiers/test_always.rb @@ -10,31 +10,31 @@ class TestAlways < NetSSHTest 'foo' end assert_raises(Net::SSH::HostKeyUnknown) { - secure_verifier.verify(session:OpenStruct.new(host_keys:host_keys)) + secure_verifier.verify(session: OpenStruct.new(host_keys: host_keys)) } end def test_passess_if_sam secure_verifier = Net::SSH::Verifiers::Always.new - key = OpenStruct.new(ssh_type:'key_type',to_blob:'keyblob') + key = OpenStruct.new(ssh_type: 'key_type',to_blob: 'keyblob') host_keys = [key] def host_keys.host 'foo' end - secure_verifier.verify(session:OpenStruct.new(host_keys:host_keys), key:key) + secure_verifier.verify(session: OpenStruct.new(host_keys: host_keys), key: key) end def test_raises_mismatch_error_if_not_the_same secure_verifier = Net::SSH::Verifiers::Always.new - key_in_known_hosts = OpenStruct.new(ssh_type:'key_type',to_blob:'keyblob') - key_actual = OpenStruct.new(ssh_type:'key_type',to_blob:'not keyblob') + key_in_known_hosts = OpenStruct.new(ssh_type: 'key_type',to_blob: 'keyblob') + key_actual = OpenStruct.new(ssh_type: 'key_type',to_blob: 'not keyblob') host_keys = [key_in_known_hosts] def host_keys.host 'foo' end assert_raises(Net::SSH::HostKeyMismatch) { - secure_verifier.verify(session:OpenStruct.new(host_keys:host_keys), key:key_actual) + secure_verifier.verify(session: OpenStruct.new(host_keys: host_keys), key: key_actual) } end |