class Object

Constants

SSH2_AGENT_LOCK
SSH2_AGENT_UNLOCK

Public Instance Methods

lock(password) click to toggle source

lock the ssh agent with password

# File lib/vagrant/patches/net-ssh.rb, line 130
def lock(password)
  type, = send_and_wait(SSH2_AGENT_LOCK, :string, password)
  raise AgentError, "could not lock agent" if type != SSH_AGENT_SUCCESS
end
matching?(key_ssh_type, host_key_alg) click to toggle source
# File lib/vagrant/patches/net-ssh.rb, line 174
def matching?(key_ssh_type, host_key_alg)
  return true if key_ssh_type == host_key_alg
  return true if key_ssh_type == 'ssh-rsa' && ['rsa-sha2-512', 'rsa-sha2-256'].include?(host_key_alg)
end
signature_algorithm() click to toggle source
# File lib/vagrant/patches/net-ssh.rb, line 228
def signature_algorithm
  "rsa-sha2-256"
end
ssh_do_sign(data) click to toggle source
# File lib/vagrant/patches/net-ssh.rb, line 232
def ssh_do_sign(data)
  if deprecated_rsa_sha1
    sign(OpenSSL::Digest::SHA256.new, data)
  else
    sign(OpenSSL::Digest::SHA1.new, data)
  end
end
ssh_do_verify(sig, data, options = {}) click to toggle source
# File lib/vagrant/patches/net-ssh.rb, line 145
def ssh_do_verify(sig, data, options = {})
  key.ssh_do_verify(sig, data, options)
end
ssh_type() click to toggle source
# File lib/vagrant/patches/net-ssh.rb, line 224
def ssh_type
  deprecated_rsa_sha1 ? signature_algorithm : "ssh-rsa"
end
unlock(password) click to toggle source

unlock the ssh agent with password

# File lib/vagrant/patches/net-ssh.rb, line 136
def unlock(password)
  type, = send_and_wait(SSH2_AGENT_UNLOCK, :string, password)
  raise AgentError, "could not unlock agent" if type != SSH_AGENT_SUCCESS
end