Sha256: 9f82d1564e37be50cae9278b2c5fc29cb50b8efd9ea223b20b86ca97e326f8da

Contents?: true

Size: 1.22 KB

Versions: 8

Compression:

Stored size: 1.22 KB

Contents

module Net
  module SSH
    module Transport
      # A cipher that does nothing but pass the data through, unchanged. This
      # keeps things in the code nice and clean when a cipher has not yet been
      # determined (i.e., during key exchange).
      class IdentityCipher
        class << self
          # A default block size of 8 is required by the SSH2 protocol.
          def block_size
            8
          end

          # Returns an arbitrary integer.
          def iv_len
            4
          end

          # Does nothing. Returns self.
          def encrypt
            self
          end

          # Does nothing. Returns self.
          def decrypt
            self
          end

          # Passes its single argument through unchanged.
          def update(text)
            text
          end

          # Returns the empty string.
          def final
            ""
          end

          # The name of this cipher, which is "identity".
          def name
            "identity"
          end

          # Does nothing. Returns nil.
          def iv=(v)
            nil
          end

          # Does nothing. Returns self.
          def reset
            self
          end
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 3 rubygems

Version Path
net-ssh-7.1.0 lib/net/ssh/transport/identity_cipher.rb
net-ssh-7.1.0.beta2 lib/net/ssh/transport/identity_cipher.rb
net-ssh-7.1.0.beta1 lib/net/ssh/transport/identity_cipher.rb
net-ssh-clone-7.0.1 lib/net/ssh/transport/identity_cipher.rb
net-ssh-7.0.1 lib/net/ssh/transport/identity_cipher.rb
net-ssh-7.0.0 lib/net/ssh/transport/identity_cipher.rb
net-ssh-7.0.0.beta1 lib/net/ssh/transport/identity_cipher.rb
eximius-net-ssh-6.3.1 lib/net/ssh/transport/identity_cipher.rb