From f52ea64977dd7dd30fbc49ac651cb5f784b0818c Mon Sep 17 00:00:00 2001 From: Miklos Fazekas Date: Fri, 25 Oct 2019 19:30:38 +0200 Subject: Update docs --- CHANGES_txt.html | 88 +- DL.html | 2 +- DL/Fiddle.html | 2 +- LICENSE_txt.html | 4 +- Net.html | 2 +- Net/SSH.html | 66 +- Net/SSH/Authentication.html | 2 +- Net/SSH/Authentication/Agent.html | 40 +- Net/SSH/Authentication/Agent/Comment.html | 2 +- Net/SSH/Authentication/AgentError.html | 2 +- Net/SSH/Authentication/AgentNotAvailable.html | 2 +- Net/SSH/Authentication/Certificate.html | 24 +- Net/SSH/Authentication/Constants.html | 2 +- Net/SSH/Authentication/DisallowedMethod.html | 2 +- Net/SSH/Authentication/ED25519.html | 2 +- .../ED25519/OpenSSHPrivateKeyLoader.html | 235 +++++ .../OpenSSHPrivateKeyLoader/DecryptError.html | 203 +++++ Net/SSH/Authentication/ED25519/PrivKey.html | 114 +-- Net/SSH/Authentication/ED25519/PubKey.html | 53 +- .../Authentication/ED25519/SigningKeyFromFile.html | 19 +- Net/SSH/Authentication/ED25519Loader.html | 11 +- Net/SSH/Authentication/KeyManager.html | 43 +- Net/SSH/Authentication/KeyManagerError.html | 2 +- Net/SSH/Authentication/Methods.html | 2 +- Net/SSH/Authentication/Methods/Abstract.html | 14 +- Net/SSH/Authentication/Methods/Hostbased.html | 2 +- .../Methods/KeyboardInteractive.html | 4 +- Net/SSH/Authentication/Methods/None.html | 22 +- Net/SSH/Authentication/Methods/Password.html | 26 +- Net/SSH/Authentication/Methods/Publickey.html | 2 +- Net/SSH/Authentication/Pageant.html | 2 +- Net/SSH/Authentication/Pageant/Socket.html | 42 +- Net/SSH/Authentication/Pageant/Win.html | 8 +- Net/SSH/Authentication/Pageant/Win/LibC.html | 2 +- Net/SSH/Authentication/Pageant/Win/LibC/FFI.html | 2 +- .../Pageant/Win/LibC/FFI/Library.html | 2 +- Net/SSH/Authentication/Session.html | 23 +- Net/SSH/AuthenticationFailed.html | 2 +- Net/SSH/Buffer.html | 233 +++-- Net/SSH/BufferedIo.html | 18 +- Net/SSH/ChannelOpenFailed.html | 4 +- Net/SSH/ChannelRequestFailed.html | 2 +- Net/SSH/Config.html | 79 +- Net/SSH/Connection.html | 2 +- Net/SSH/Connection/Channel.html | 102 ++- Net/SSH/Connection/Constants.html | 2 +- Net/SSH/Connection/EventLoop.html | 32 +- Net/SSH/Connection/Keepalive.html | 22 +- Net/SSH/Connection/Session.html | 94 +- Net/SSH/Connection/Session/NilChannel.html | 6 +- .../Connection/Session/StringWithExitstatus.html | 4 +- Net/SSH/Connection/SingleSessionEventLoop.html | 10 +- Net/SSH/Connection/Term.html | 2 +- Net/SSH/ConnectionTimeout.html | 2 +- Net/SSH/Disconnect.html | 2 +- Net/SSH/Exception.html | 2 +- Net/SSH/ForwardedBufferedIo.html | 2 +- Net/SSH/HostKeyError.html | 16 +- Net/SSH/HostKeyMismatch.html | 2 +- Net/SSH/HostKeyUnknown.html | 2 +- Net/SSH/HostKeys.html | 24 +- Net/SSH/KeyFactory.html | 27 +- Net/SSH/KeyFactory/KeyType.html | 226 +++++ Net/SSH/KeyFactory/OpenSSHPrivateKeyType.html | 224 +++++ Net/SSH/KeyFactory/OpenSSLDSAKeyType.html | 189 ++++ Net/SSH/KeyFactory/OpenSSLECKeyType.html | 189 ++++ Net/SSH/KeyFactory/OpenSSLKeyTypeBase.html | 224 +++++ Net/SSH/KeyFactory/OpenSSLPKeyType.html | 224 +++++ Net/SSH/KeyFactory/OpenSSLRSAKeyType.html | 189 ++++ Net/SSH/KnownHosts.html | 110 ++- Net/SSH/Loggable.html | 12 +- Net/SSH/Packet.html | 12 +- Net/SSH/Prompt.html | 8 +- Net/SSH/Prompt/Prompter.html | 8 +- Net/SSH/Proxy.html | 2 +- Net/SSH/Proxy/Command.html | 74 +- Net/SSH/Proxy/ConnectError.html | 2 +- Net/SSH/Proxy/Error.html | 2 +- Net/SSH/Proxy/HTTP.html | 33 +- Net/SSH/Proxy/HTTPS.html | 6 +- Net/SSH/Proxy/HTTPS/SSLSocketCompatibility.html | 4 +- Net/SSH/Proxy/Jump.html | 12 +- Net/SSH/Proxy/SOCKS4.html | 6 +- Net/SSH/Proxy/SOCKS5.html | 4 +- Net/SSH/Proxy/UnauthorizedError.html | 2 +- Net/SSH/Service.html | 2 +- Net/SSH/Service/Forward.html | 36 +- Net/SSH/Test.html | 16 +- Net/SSH/Test/Channel.html | 32 +- Net/SSH/Test/Extensions.html | 2 +- Net/SSH/Test/Extensions/BufferedIo.html | 4 +- Net/SSH/Test/Extensions/Channel.html | 4 +- Net/SSH/Test/Extensions/IO.html | 6 +- Net/SSH/Test/Extensions/IO/ClassMethods.html | 16 +- Net/SSH/Test/Extensions/PacketStream.html | 14 +- Net/SSH/Test/Kex.html | 10 +- Net/SSH/Test/LocalPacket.html | 18 +- Net/SSH/Test/Packet.html | 68 +- Net/SSH/Test/RemotePacket.html | 8 +- Net/SSH/Test/Script.html | 16 +- Net/SSH/Test/Socket.html | 18 +- Net/SSH/Timeout.html | 2 +- Net/SSH/Transport.html | 2 +- Net/SSH/Transport/Algorithms.html | 75 +- Net/SSH/Transport/CTR.html | 62 +- Net/SSH/Transport/CipherFactory.html | 53 +- Net/SSH/Transport/Constants.html | 22 +- Net/SSH/Transport/HMAC.html | 6 +- Net/SSH/Transport/HMAC/Abstract.html | 98 ++- Net/SSH/Transport/HMAC/MD5.html | 2 +- Net/SSH/Transport/HMAC/MD5/OpenSSL.html | 2 +- Net/SSH/Transport/HMAC/MD5/OpenSSL/Digest.html | 2 +- Net/SSH/Transport/HMAC/MD5_96.html | 2 +- Net/SSH/Transport/HMAC/None.html | 2 +- Net/SSH/Transport/HMAC/RIPEMD160.html | 2 +- Net/SSH/Transport/HMAC/RIPEMD160/OpenSSL.html | 2 +- .../Transport/HMAC/RIPEMD160/OpenSSL/Digest.html | 2 +- Net/SSH/Transport/HMAC/SHA1.html | 2 +- Net/SSH/Transport/HMAC/SHA1/OpenSSL.html | 2 +- Net/SSH/Transport/HMAC/SHA1/OpenSSL/Digest.html | 2 +- Net/SSH/Transport/HMAC/SHA1_96.html | 2 +- Net/SSH/Transport/HMAC/SHA2_256.html | 2 +- Net/SSH/Transport/HMAC/SHA2_256/OpenSSL.html | 96 ++ .../Transport/HMAC/SHA2_256/OpenSSL/Digest.html | 96 ++ Net/SSH/Transport/HMAC/SHA2_256_96.html | 2 +- Net/SSH/Transport/HMAC/SHA2_256_Etm.html | 106 +++ Net/SSH/Transport/HMAC/SHA2_256_Etm/OpenSSL.html | 96 ++ .../HMAC/SHA2_256_Etm/OpenSSL/Digest.html | 96 ++ Net/SSH/Transport/HMAC/SHA2_512.html | 2 +- Net/SSH/Transport/HMAC/SHA2_512/OpenSSL.html | 96 ++ .../Transport/HMAC/SHA2_512/OpenSSL/Digest.html | 96 ++ Net/SSH/Transport/HMAC/SHA2_512_96.html | 2 +- Net/SSH/Transport/HMAC/SHA2_512_Etm.html | 106 +++ Net/SSH/Transport/HMAC/SHA2_512_Etm/OpenSSL.html | 96 ++ .../HMAC/SHA2_512_Etm/OpenSSL/Digest.html | 96 ++ Net/SSH/Transport/IdentityCipher.html | 20 +- Net/SSH/Transport/Kex.html | 2 +- Net/SSH/Transport/Kex/Abstract.html | 342 ++++++++ Net/SSH/Transport/Kex/Abstract5656.html | 158 ++++ Net/SSH/Transport/Kex/Curve25519Sha256.html | 158 ++++ Net/SSH/Transport/Kex/Curve25519Sha256Loader.html | 207 +++++ .../Transport/Kex/DiffieHellmanGroup14SHA1.html | 19 +- Net/SSH/Transport/Kex/DiffieHellmanGroup1SHA1.html | 212 +---- .../Kex/DiffieHellmanGroupExchangeSHA1.html | 22 +- .../Kex/DiffieHellmanGroupExchangeSHA256.html | 29 +- Net/SSH/Transport/Kex/EcdhSHA2NistP256.html | 95 +- Net/SSH/Transport/Kex/EcdhSHA2NistP384.html | 6 +- Net/SSH/Transport/Kex/EcdhSHA2NistP521.html | 6 +- Net/SSH/Transport/KeyExpander.html | 12 +- Net/SSH/Transport/OpenSSLAESCTR.html | 313 +++++++ Net/SSH/Transport/PacketStream.html | 105 ++- Net/SSH/Transport/ServerVersion.html | 4 +- Net/SSH/Transport/Session.html | 37 +- Net/SSH/Transport/Session/CompatibleVerifier.html | 235 +++++ Net/SSH/Transport/State.html | 46 +- Net/SSH/Verifiers.html | 2 +- Net/SSH/Verifiers/AcceptNew.html | 209 +++++ Net/SSH/Verifiers/AcceptNewOrLocalTunnel.html | 167 ++++ Net/SSH/Verifiers/Always.html | 213 +++++ Net/SSH/Verifiers/Never.html | 193 ++++ Net/SSH/Version.html | 12 +- OpenSSL.html | 2 +- OpenSSL/BN.html | 4 +- OpenSSL/PKey.html | 2 +- OpenSSL/PKey/DH.html | 14 +- OpenSSL/PKey/DSA.html | 40 +- OpenSSL/PKey/EC.html | 53 +- OpenSSL/PKey/EC/Point.html | 193 ++++ OpenSSL/PKey/PKey.html | 53 +- OpenSSL/PKey/RSA.html | 20 +- README_md.html | 429 +++++++++ String.html | 4 +- THANKS_txt.html | 4 +- created.rid | 169 ++-- index.html | 328 ++++--- js/navigation.js.gz | Bin 1021 -> 1021 bytes js/search_index.js | 2 +- js/search_index.js.gz | Bin 28799 -> 30262 bytes js/searcher.js.gz | Bin 1694 -> 1694 bytes table_of_contents.html | 966 +++++++++++++-------- 180 files changed, 8178 insertions(+), 2061 deletions(-) create mode 100644 Net/SSH/Authentication/ED25519/OpenSSHPrivateKeyLoader.html create mode 100644 Net/SSH/Authentication/ED25519/OpenSSHPrivateKeyLoader/DecryptError.html create mode 100644 Net/SSH/KeyFactory/KeyType.html create mode 100644 Net/SSH/KeyFactory/OpenSSHPrivateKeyType.html create mode 100644 Net/SSH/KeyFactory/OpenSSLDSAKeyType.html create mode 100644 Net/SSH/KeyFactory/OpenSSLECKeyType.html create mode 100644 Net/SSH/KeyFactory/OpenSSLKeyTypeBase.html create mode 100644 Net/SSH/KeyFactory/OpenSSLPKeyType.html create mode 100644 Net/SSH/KeyFactory/OpenSSLRSAKeyType.html create mode 100644 Net/SSH/Transport/HMAC/SHA2_256/OpenSSL.html create mode 100644 Net/SSH/Transport/HMAC/SHA2_256/OpenSSL/Digest.html create mode 100644 Net/SSH/Transport/HMAC/SHA2_256_Etm.html create mode 100644 Net/SSH/Transport/HMAC/SHA2_256_Etm/OpenSSL.html create mode 100644 Net/SSH/Transport/HMAC/SHA2_256_Etm/OpenSSL/Digest.html create mode 100644 Net/SSH/Transport/HMAC/SHA2_512/OpenSSL.html create mode 100644 Net/SSH/Transport/HMAC/SHA2_512/OpenSSL/Digest.html create mode 100644 Net/SSH/Transport/HMAC/SHA2_512_Etm.html create mode 100644 Net/SSH/Transport/HMAC/SHA2_512_Etm/OpenSSL.html create mode 100644 Net/SSH/Transport/HMAC/SHA2_512_Etm/OpenSSL/Digest.html create mode 100644 Net/SSH/Transport/Kex/Abstract.html create mode 100644 Net/SSH/Transport/Kex/Abstract5656.html create mode 100644 Net/SSH/Transport/Kex/Curve25519Sha256.html create mode 100644 Net/SSH/Transport/Kex/Curve25519Sha256Loader.html create mode 100644 Net/SSH/Transport/OpenSSLAESCTR.html create mode 100644 Net/SSH/Transport/Session/CompatibleVerifier.html create mode 100644 Net/SSH/Verifiers/AcceptNew.html create mode 100644 Net/SSH/Verifiers/AcceptNewOrLocalTunnel.html create mode 100644 Net/SSH/Verifiers/Always.html create mode 100644 Net/SSH/Verifiers/Never.html create mode 100644 OpenSSL/PKey/EC/Point.html create mode 100644 README_md.html diff --git a/CHANGES_txt.html b/CHANGES_txt.html index 43fc74d..9895a06 100644 --- a/CHANGES_txt.html +++ b/CHANGES_txt.html @@ -4,7 +4,7 @@ -CHANGES - net-ssh 4.2.0 +CHANGES - net-ssh 6.0.0.beta1 + + + + + + + + + + + + +
+

+ class Net::SSH::Authentication::ED25519::OpenSSHPrivateKeyLoader +

+ +
+ +
+ + + + +
+ + + + + +
+
+

Constants

+
+
+ +
CipherFactory + +
+ + +
MAGIC + +
+ + +
MBEGIN + +
+ + +
MEND + +
+ + +
+
+ + + + + +
+
+

Public Class Methods

+
+ + +
+ +
+ read(datafull, password) + + click to toggle source + +
+ + +
+ + + + + + +
+
# File lib/net/ssh/authentication/ed25519.rb, line 43
+def self.read(datafull, password)
+  raise ArgumentError.new("Expected #{MBEGIN} at start of private key") unless datafull.start_with?(MBEGIN)
+  raise ArgumentError.new("Expected #{MEND} at end of private key") unless datafull.end_with?(MEND)
+  datab64 = datafull[MBEGIN.size...-MEND.size]
+  data = Base64.decode64(datab64)
+  raise ArgumentError.new("Expected #{MAGIC} at start of decoded private key") unless data.start_with?(MAGIC)
+  buffer = Net::SSH::Buffer.new(data[MAGIC.size + 1..-1])
+
+  ciphername = buffer.read_string
+  raise ArgumentError.new("#{ciphername} in private key is not supported") unless
+    CipherFactory.supported?(ciphername)
+
+  kdfname = buffer.read_string
+  raise ArgumentError.new("Expected #{kdfname} to be or none or bcrypt") unless %w[none bcrypt].include?(kdfname)
+
+  kdfopts = Net::SSH::Buffer.new(buffer.read_string)
+  num_keys = buffer.read_long
+  raise ArgumentError.new("Only 1 key is supported in ssh keys #{num_keys} was in private key") unless num_keys == 1
+  _pubkey = buffer.read_string
+
+  len = buffer.read_long
+
+  keylen, blocksize, ivlen = CipherFactory.get_lengths(ciphername, iv_len: true)
+  raise ArgumentError.new("Private key len:#{len} is not a multiple of #{blocksize}") if
+    ((len < blocksize) || ((blocksize > 0) && (len % blocksize) != 0))
+
+  if kdfname == 'bcrypt'
+    salt = kdfopts.read_string
+    rounds = kdfopts.read_long
+
+    raise "BCryptPbkdf is not implemented for jruby" if RUBY_PLATFORM == "java"
+    key = BCryptPbkdf::key(password, salt, keylen + ivlen, rounds)
+  else
+    key = '\x00' * (keylen + ivlen)
+  end
+
+  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
+
+  decoded = Net::SSH::Buffer.new(decoded)
+  check1 = decoded.read_long
+  check2 = decoded.read_long
+
+  raise DecryptError.new("Decrypt failed on private key", encrypted_key: kdfname == 'bcrypt') if (check1 != check2)
+
+  type_name = decoded.read_string
+  case type_name
+  when "ssh-ed25519"
+    PrivKey.new(decoded)
+  else
+    decoded.read_private_keyblob(type_name)
+  end
+end
+
+ +
+ + + + +
+ + +
+ +
+
+ + + + diff --git a/Net/SSH/Authentication/ED25519/OpenSSHPrivateKeyLoader/DecryptError.html b/Net/SSH/Authentication/ED25519/OpenSSHPrivateKeyLoader/DecryptError.html new file mode 100644 index 0000000..d524b17 --- /dev/null +++ b/Net/SSH/Authentication/ED25519/OpenSSHPrivateKeyLoader/DecryptError.html @@ -0,0 +1,203 @@ + + + + + + +class Net::SSH::Authentication::ED25519::OpenSSHPrivateKeyLoader::DecryptError - net-ssh 6.0.0.beta1 + + + + + + + + + + + + + + +
+

+ class Net::SSH::Authentication::ED25519::OpenSSHPrivateKeyLoader::DecryptError +

+ +
+ +
+ + + + +
+ + + + + + + + + +
+
+

Public Class Methods

+
+ + +
+ +
+ new(message, encrypted_key: false) + + click to toggle source + +
+ + +
+ + + + +
+ Calls superclass method + +
+ + + +
+
# File lib/net/ssh/authentication/ed25519.rb, line 33
+def initialize(message, encrypted_key: false)
+  super(message)
+  @encrypted_key = encrypted_key
+end
+
+ +
+ + + + +
+ + +
+ +
+
+

Public Instance Methods

+
+ + +
+ +
+ encrypted_key?() + + click to toggle source + +
+ + +
+ + + + + + +
+
# File lib/net/ssh/authentication/ed25519.rb, line 38
+def encrypted_key?
+  return @encrypted_key
+end
+
+ +
+ + + + +
+ + +
+ +
+
+ + + + diff --git a/Net/SSH/Authentication/ED25519/PrivKey.html b/Net/SSH/Authentication/ED25519/PrivKey.html index 878719b..255f6f4 100644 --- a/Net/SSH/Authentication/ED25519/PrivKey.html +++ b/Net/SSH/Authentication/ED25519/PrivKey.html @@ -4,7 +4,7 @@ -class Net::SSH::Authentication::ED25519::PrivKey - net-ssh 4.2.0 +class Net::SSH::Authentication::ED25519::PrivKey - net-ssh 6.0.0.beta1 + + + + + + + + + + + + +
+

+ class Net::SSH::KeyFactory::KeyType +

+ +
+ +

rubocop:disable Style/Documentation, Lint/DuplicateMethods

+ +
+ + + + +
+ + + + + + + + + +
+
+

Public Class Methods

+
+ + +
+ +
+ encrypted_key?(data, error) + + click to toggle source + +
+ + +
+ + + + + + +
+
# File lib/net/ssh/key_factory.rb, line 118
+def self.encrypted_key?(data, error)
+  raise Exception, "TODO subclasses should implement is_encrypted_key"
+end
+
+ +
+ + + + +
+ + +
+ +
+ error_classes() + + click to toggle source + +
+ + +
+ + + + + + +
+
# File lib/net/ssh/key_factory.rb, line 114
+def self.error_classes
+  raise Exception, "TODO subclasses should implement read"
+end
+
+ +
+ + + + +
+ + +
+ +
+ read(key_data, passphrase) + + click to toggle source + +
+ + +
+ + + + + + +
+
# File lib/net/ssh/key_factory.rb, line 110
+def self.read(key_data, passphrase)
+  raise Exception, "TODO subclasses should implement read"
+end
+
+ +
+ + + + +
+ + +
+ +
+
+ + + + diff --git a/Net/SSH/KeyFactory/OpenSSHPrivateKeyType.html b/Net/SSH/KeyFactory/OpenSSHPrivateKeyType.html new file mode 100644 index 0000000..7d4af64 --- /dev/null +++ b/Net/SSH/KeyFactory/OpenSSHPrivateKeyType.html @@ -0,0 +1,224 @@ + + + + + + +class Net::SSH::KeyFactory::OpenSSHPrivateKeyType - net-ssh 6.0.0.beta1 + + + + + + + + + + + + + + +
+

+ class Net::SSH::KeyFactory::OpenSSHPrivateKeyType +

+ +
+ +
+ + + + +
+ + + + + + + + + +
+
+

Public Class Methods

+
+ + +
+ +
+ encrypted_key?(key_data, decode_error) + + click to toggle source + +
+ + +
+ + + + + + +
+
# File lib/net/ssh/key_factory.rb, line 132
+def self.encrypted_key?(key_data, decode_error)
+  decode_error.is_a?(Net::SSH::Authentication::ED25519::OpenSSHPrivateKeyLoader::DecryptError) && decode_error.encrypted_key?
+end
+
+ +
+ + + + +
+ + +
+ +
+ error_classes() + + click to toggle source + +
+ + +
+ + + + + + +
+
# File lib/net/ssh/key_factory.rb, line 128
+def self.error_classes
+  [Net::SSH::Authentication::ED25519::OpenSSHPrivateKeyLoader::DecryptError]
+end
+
+ +
+ + + + +
+ + +
+ +
+ read(key_data, passphrase) + + click to toggle source + +
+ + +
+ + + + + + +
+
# File lib/net/ssh/key_factory.rb, line 124
+def self.read(key_data, passphrase)
+  Net::SSH::Authentication::ED25519::OpenSSHPrivateKeyLoader.read(key_data, passphrase)
+end
+
+ +
+ + + + +
+ + +
+ +
+
+ + + + diff --git a/Net/SSH/KeyFactory/OpenSSLDSAKeyType.html b/Net/SSH/KeyFactory/OpenSSLDSAKeyType.html new file mode 100644 index 0000000..9dc260b --- /dev/null +++ b/Net/SSH/KeyFactory/OpenSSLDSAKeyType.html @@ -0,0 +1,189 @@ + + + + + + +class Net::SSH::KeyFactory::OpenSSLDSAKeyType - net-ssh 6.0.0.beta1 + + + + + + + + + + + + + + +
+

+ class Net::SSH::KeyFactory::OpenSSLDSAKeyType +

+ +
+ +
+ + + + +
+ + + + + + + + + +
+
+

Public Class Methods

+
+ + +
+ +
+ error_classes() + + click to toggle source + +
+ + +
+ + + + + + +
+
# File lib/net/ssh/key_factory.rb, line 170
+def self.error_classes
+  [OpenSSL::PKey::DSAError]
+end
+
+ +
+ + + + +
+ + +
+ +
+ open_ssl_class() + + click to toggle source + +
+ + +
+ + + + + + +
+
# File lib/net/ssh/key_factory.rb, line 166
+def self.open_ssl_class
+  OpenSSL::PKey::DSA
+end
+
+ +
+ + + + +
+ + +
+ +
+
+ + + + diff --git a/Net/SSH/KeyFactory/OpenSSLECKeyType.html b/Net/SSH/KeyFactory/OpenSSLECKeyType.html new file mode 100644 index 0000000..a0fd2e3 --- /dev/null +++ b/Net/SSH/KeyFactory/OpenSSLECKeyType.html @@ -0,0 +1,189 @@ + + + + + + +class Net::SSH::KeyFactory::OpenSSLECKeyType - net-ssh 6.0.0.beta1 + + + + + + + + + + + + + + +
+

+ class Net::SSH::KeyFactory::OpenSSLECKeyType +

+ +
+ +
+ + + + +
+ + + + + + + + + +
+
+

Public Class Methods

+
+ + +
+ +
+ error_classes() + + click to toggle source + +
+ + +
+ + + + + + +
+
# File lib/net/ssh/key_factory.rb, line 190
+def self.error_classes
+  [OpenSSL::PKey::ECError]
+end
+
+ +
+ + + + +
+ + +
+ +
+ open_ssl_class() + + click to toggle source + +
+ + +
+ + + + + + +
+
# File lib/net/ssh/key_factory.rb, line 186
+def self.open_ssl_class
+  OpenSSL::PKey::EC
+end
+
+ +
+ + + + +
+ + +
+ +
+
+ + + + diff --git a/Net/SSH/KeyFactory/OpenSSLKeyTypeBase.html b/Net/SSH/KeyFactory/OpenSSLKeyTypeBase.html new file mode 100644 index 0000000..8214799 --- /dev/null +++ b/Net/SSH/KeyFactory/OpenSSLKeyTypeBase.html @@ -0,0 +1,224 @@ + + + + + + +class Net::SSH::KeyFactory::OpenSSLKeyTypeBase - net-ssh 6.0.0.beta1 + + + + + + + + + + + + + + +
+

+ class Net::SSH::KeyFactory::OpenSSLKeyTypeBase +

+ +
+ +
+ + + + +
+ + + + + + + + + +
+
+

Public Class Methods

+
+ + +
+ +
+ encrypted_key?(key_data, error) + + click to toggle source + +
+ + +
+ + + + + + +
+
# File lib/net/ssh/key_factory.rb, line 146
+def self.encrypted_key?(key_data, error)
+  key_data.match(/ENCRYPTED/)
+end
+
+ +
+ + + + +
+ + +
+ +
+ open_ssl_class() + + click to toggle source + +
+ + +
+ + + + + + +
+
# File lib/net/ssh/key_factory.rb, line 138
+def self.open_ssl_class
+  raise Exception, "TODO: subclasses should implement"
+end
+
+ +
+ + + + +
+ + +
+ +
+ read(key_data, passphrase) + + click to toggle source + +
+ + +
+ + + + + + +
+
# File lib/net/ssh/key_factory.rb, line 142
+def self.read(key_data, passphrase)
+  open_ssl_class.new(key_data, passphrase)
+end
+
+ +
+ + + + +
+ + +
+ +
+
+ + + + diff --git a/Net/SSH/KeyFactory/OpenSSLPKeyType.html b/Net/SSH/KeyFactory/OpenSSLPKeyType.html new file mode 100644 index 0000000..7c8d2ea --- /dev/null +++ b/Net/SSH/KeyFactory/OpenSSLPKeyType.html @@ -0,0 +1,224 @@ + + + + + + +class Net::SSH::KeyFactory::OpenSSLPKeyType - net-ssh 6.0.0.beta1 + + + + + + + + + + + + + + +
+

+ class Net::SSH::KeyFactory::OpenSSLPKeyType +

+ +
+ +
+ + + + +
+ + + + + + + + + +
+
+

Public Class Methods

+
+ + +
+ +
+ error_classes() + + click to toggle source + +
+ + +
+ + + + + + +
+
# File lib/net/ssh/key_factory.rb, line 160
+def self.error_classes
+  [ArgumentError, OpenSSL::PKey::PKeyError]
+end
+
+ +
+ + + + +
+ + +
+ +
+ open_ssl_class() + + click to toggle source + +
+ + +
+ + + + + + +
+
# File lib/net/ssh/key_factory.rb, line 156
+def self.open_ssl_class
+  OpenSSL::PKey
+end
+
+ +
+ + + + +
+ + +
+ +
+ read(key_data, passphrase) + + click to toggle source + +
+ + +
+ + + + + + +
+
# File lib/net/ssh/key_factory.rb, line 152
+def self.read(key_data, passphrase)
+  open_ssl_class.read(key_data, passphrase)
+end
+
+ +
+ + + + +
+ + +
+ +
+
+ + + + diff --git a/Net/SSH/KeyFactory/OpenSSLRSAKeyType.html b/Net/SSH/KeyFactory/OpenSSLRSAKeyType.html new file mode 100644 index 0000000..fe86bd4 --- /dev/null +++ b/Net/SSH/KeyFactory/OpenSSLRSAKeyType.html @@ -0,0 +1,189 @@ + + + + + + +class Net::SSH::KeyFactory::OpenSSLRSAKeyType - net-ssh 6.0.0.beta1 + + + + + + + + + + + + + + +
+

+ class Net::SSH::KeyFactory::OpenSSLRSAKeyType +

+ +
+ +
+ + + + +
+ + + + + + + + + +
+
+

Public Class Methods

+
+ + +
+ +
+ error_classes() + + click to toggle source + +
+ + +
+ + + + + + +
+
# File lib/net/ssh/key_factory.rb, line 180
+def self.error_classes
+  [OpenSSL::PKey::RSAError]
+end
+
+ +
+ + + + +
+ + +
+ +
+ open_ssl_class() + + click to toggle source + +
+ + +
+ + + + + + +
+
# File lib/net/ssh/key_factory.rb, line 176
+def self.open_ssl_class
+  OpenSSL::PKey::RSA
+end
+
+ +
+ + + + +
+ + +
+ +
+
+ + + + diff --git a/Net/SSH/KnownHosts.html b/Net/SSH/KnownHosts.html index b09c102..cb7d82d 100644 --- a/Net/SSH/KnownHosts.html +++ b/Net/SSH/KnownHosts.html @@ -4,7 +4,7 @@ -class Net::SSH::KnownHosts - net-ssh 4.2.0 +class Net::SSH::KnownHosts - net-ssh 6.0.0.beta1 + + + + + + + + + + + + +
+

+ module Net::SSH::Transport::HMAC::SHA2_256::OpenSSL +

+ +
+ +
+ + + + +
+ + + + + + + + + +
+
+ + + + diff --git a/Net/SSH/Transport/HMAC/SHA2_256/OpenSSL/Digest.html b/Net/SSH/Transport/HMAC/SHA2_256/OpenSSL/Digest.html new file mode 100644 index 0000000..1406781 --- /dev/null +++ b/Net/SSH/Transport/HMAC/SHA2_256/OpenSSL/Digest.html @@ -0,0 +1,96 @@ + + + + + + +module Net::SSH::Transport::HMAC::SHA2_256::OpenSSL::Digest - net-ssh 6.0.0.beta1 + + + + + + + + + + + + + + +
+

+ module Net::SSH::Transport::HMAC::SHA2_256::OpenSSL::Digest +

+ +
+ +
+ + + + +
+ + + + + + + + + +
+
+ + + + diff --git a/Net/SSH/Transport/HMAC/SHA2_256_96.html b/Net/SSH/Transport/HMAC/SHA2_256_96.html index bc5a32b..65da258 100644 --- a/Net/SSH/Transport/HMAC/SHA2_256_96.html +++ b/Net/SSH/Transport/HMAC/SHA2_256_96.html @@ -4,7 +4,7 @@ -class Net::SSH::Transport::HMAC::SHA2_256_96 - net-ssh 4.2.0 +class Net::SSH::Transport::HMAC::SHA2_256_96 - net-ssh 6.0.0.beta1 + + + + + + + + + + + + +
+

+ class Net::SSH::Transport::HMAC::SHA2_256_Etm +

+ +
+ +

The SHA-256 Encrypt-Then-Mac HMAC algorithm. +This has a mac and key length of 32, and uses the SHA-256 digest algorithm.

+ +
+ + + + +
+ + + + + + + + + +
+
+ + + + diff --git a/Net/SSH/Transport/HMAC/SHA2_256_Etm/OpenSSL.html b/Net/SSH/Transport/HMAC/SHA2_256_Etm/OpenSSL.html new file mode 100644 index 0000000..d0b230a --- /dev/null +++ b/Net/SSH/Transport/HMAC/SHA2_256_Etm/OpenSSL.html @@ -0,0 +1,96 @@ + + + + + + +module Net::SSH::Transport::HMAC::SHA2_256_Etm::OpenSSL - net-ssh 6.0.0.beta1 + + + + + + + + + + + + + + +
+

+ module Net::SSH::Transport::HMAC::SHA2_256_Etm::OpenSSL +

+ +
+ +
+ + + + +
+ + + + + + + + + +
+
+ + + + diff --git a/Net/SSH/Transport/HMAC/SHA2_256_Etm/OpenSSL/Digest.html b/Net/SSH/Transport/HMAC/SHA2_256_Etm/OpenSSL/Digest.html new file mode 100644 index 0000000..da55e38 --- /dev/null +++ b/Net/SSH/Transport/HMAC/SHA2_256_Etm/OpenSSL/Digest.html @@ -0,0 +1,96 @@ + + + + + + +module Net::SSH::Transport::HMAC::SHA2_256_Etm::OpenSSL::Digest - net-ssh 6.0.0.beta1 + + + + + + + + + + + + + + +
+

+ module Net::SSH::Transport::HMAC::SHA2_256_Etm::OpenSSL::Digest +

+ +
+ +
+ + + + +
+ + + + + + + + + +
+
+ + + + diff --git a/Net/SSH/Transport/HMAC/SHA2_512.html b/Net/SSH/Transport/HMAC/SHA2_512.html index b3f42f9..cd15bfe 100644 --- a/Net/SSH/Transport/HMAC/SHA2_512.html +++ b/Net/SSH/Transport/HMAC/SHA2_512.html @@ -4,7 +4,7 @@ -class Net::SSH::Transport::HMAC::SHA2_512 - net-ssh 4.2.0 +class Net::SSH::Transport::HMAC::SHA2_512 - net-ssh 6.0.0.beta1 + + + + + + + + + + + + +
+

+ module Net::SSH::Transport::HMAC::SHA2_512::OpenSSL +

+ +
+ +
+ + + + +
+ + + + + + + + + +
+
+ + + + diff --git a/Net/SSH/Transport/HMAC/SHA2_512/OpenSSL/Digest.html b/Net/SSH/Transport/HMAC/SHA2_512/OpenSSL/Digest.html new file mode 100644 index 0000000..ff2679c --- /dev/null +++ b/Net/SSH/Transport/HMAC/SHA2_512/OpenSSL/Digest.html @@ -0,0 +1,96 @@ + + + + + + +module Net::SSH::Transport::HMAC::SHA2_512::OpenSSL::Digest - net-ssh 6.0.0.beta1 + + + + + + + + + + + + + + +
+

+ module Net::SSH::Transport::HMAC::SHA2_512::OpenSSL::Digest +

+ +
+ +
+ + + + +
+ + + + + + + + + +
+
+ + + + diff --git a/Net/SSH/Transport/HMAC/SHA2_512_96.html b/Net/SSH/Transport/HMAC/SHA2_512_96.html index 9214b87..464f152 100644 --- a/Net/SSH/Transport/HMAC/SHA2_512_96.html +++ b/Net/SSH/Transport/HMAC/SHA2_512_96.html @@ -4,7 +4,7 @@ -class Net::SSH::Transport::HMAC::SHA2_512_96 - net-ssh 4.2.0 +class Net::SSH::Transport::HMAC::SHA2_512_96 - net-ssh 6.0.0.beta1 + + + + + + + + + + + + +
+

+ class Net::SSH::Transport::HMAC::SHA2_512_Etm +

+ +
+ +

The SHA-512 Encrypt-Then-Mac HMAC algorithm. +This has a mac and key length of 64, and uses the SHA-512 digest algorithm.

+ +
+ + + + +
+ + + + + + + + + +
+
+ + + + diff --git a/Net/SSH/Transport/HMAC/SHA2_512_Etm/OpenSSL.html b/Net/SSH/Transport/HMAC/SHA2_512_Etm/OpenSSL.html new file mode 100644 index 0000000..f08608b --- /dev/null +++ b/Net/SSH/Transport/HMAC/SHA2_512_Etm/OpenSSL.html @@ -0,0 +1,96 @@ + + + + + + +module Net::SSH::Transport::HMAC::SHA2_512_Etm::OpenSSL - net-ssh 6.0.0.beta1 + + + + + + + + + + + + + + +
+

+ module Net::SSH::Transport::HMAC::SHA2_512_Etm::OpenSSL +

+ +
+ +
+ + + + +
+ + + + + + + + + +
+
+ + + + diff --git a/Net/SSH/Transport/HMAC/SHA2_512_Etm/OpenSSL/Digest.html b/Net/SSH/Transport/HMAC/SHA2_512_Etm/OpenSSL/Digest.html new file mode 100644 index 0000000..2723af5 --- /dev/null +++ b/Net/SSH/Transport/HMAC/SHA2_512_Etm/OpenSSL/Digest.html @@ -0,0 +1,96 @@ + + + + + + +module Net::SSH::Transport::HMAC::SHA2_512_Etm::OpenSSL::Digest - net-ssh 6.0.0.beta1 + + + + + + + + + + + + + + +
+

+ module Net::SSH::Transport::HMAC::SHA2_512_Etm::OpenSSL::Digest +

+ +
+ +
+ + + + +
+ + + + + + + + + +
+
+ + + + diff --git a/Net/SSH/Transport/IdentityCipher.html b/Net/SSH/Transport/IdentityCipher.html index 33fccf5..9006110 100644 --- a/Net/SSH/Transport/IdentityCipher.html +++ b/Net/SSH/Transport/IdentityCipher.html @@ -4,7 +4,7 @@ -class Net::SSH::Transport::IdentityCipher - net-ssh 4.2.0 +class Net::SSH::Transport::IdentityCipher - net-ssh 6.0.0.beta1 + + + + + + + + + + + + +
+

+ class Net::SSH::Transport::Kex::Abstract +

+ +
+ +

Abstract class that implement Diffie-Hellman +Key Exchange See tools.ietf.org/html/rfc4253#page-21

+ +
+ + + + +
+ + + + + + + +
+
+

Attributes

+
+ + +
+
+ algorithms[R] +
+ +
+ + + +
+
+ +
+
+ connection[R] +
+ +
+ + + +
+
+ +
+
+ data[R] +
+ +
+ + + +
+
+ +
+
+ dh[R] +
+ +
+ + + +
+
+ +
+ + + +
+
+

Public Class Methods

+
+ + +
+ +
+ new(algorithms, connection, data) + + click to toggle source + +
+ + +
+ +

Create a new instance of the Diffie-Hellman Key Exchange algorithm. The +Diffie-Hellman (DH) key exchange provides a shared secret that cannot be +determined by either party alone. The key exchange is combined with a +signature with the host key to provide host authentication.

+ + + + +
+
# File lib/net/ssh/transport/kex/abstract.rb, line 27
+def initialize(algorithms, connection, data)
+  @algorithms = algorithms
+  @connection = connection
+
+  @data = data.dup
+  @dh = generate_key
+  @logger = @data.delete(:logger)
+end
+
+ +
+ + + + +
+ + +
+ +
+
+

Public Instance Methods

+
+ + +
+ +
+ digester() + + click to toggle source + +
+ + +
+ + + + + + +
+
# File lib/net/ssh/transport/kex/abstract.rb, line 61
+def digester
+  raise NotImplementedError, 'abstract class: digester not implemented'
+end
+
+ +
+ + + + +
+ + +
+ +
+ exchange_keys() + + click to toggle source + +
+ + +
+ +

Perform the key-exchange for the given session, with the given data. This +method will return a hash consisting of the following keys:

+
  • +

    :session_id

    +
  • +

    :server_key

    +
  • +

    :shared_secret

    +
  • +

    :hashing_algorithm

    +
+ +

The caller is expected to be able to understand how to use these +deliverables.

+ + + + +
+
# File lib/net/ssh/transport/kex/abstract.rb, line 47
+def exchange_keys
+  result = send_kexinit
+  verify_server_key(result[:server_key])
+  session_id = verify_signature(result)
+  confirm_newkeys
+
+  {
+    session_id: session_id,
+    server_key: result[:server_key],
+    shared_secret: result[:shared_secret],
+    hashing_algorithm: digester
+  }
+end
+
+ +
+ + + + +
+ + +
+ +
+
+ + + + diff --git a/Net/SSH/Transport/Kex/Abstract5656.html b/Net/SSH/Transport/Kex/Abstract5656.html new file mode 100644 index 0000000..7dc8d23 --- /dev/null +++ b/Net/SSH/Transport/Kex/Abstract5656.html @@ -0,0 +1,158 @@ + + + + + + +class Net::SSH::Transport::Kex::Abstract5656 - net-ssh 6.0.0.beta1 + + + + + + + + + + + + + + +
+

+ class Net::SSH::Transport::Kex::Abstract5656 +

+ +
+ +

Implement key-exchange algorithm from Elliptic Curve Algorithm Integration +in the Secure Shell Transport Layer (RFC +5656)

+ +
+ + + + +
+ + + + + + + + + +
+
+

Public Instance Methods

+
+ + +
+ +
+ curve_name() + + click to toggle source + +
+ + +
+ + + + + + +
+
# File lib/net/ssh/transport/kex/abstract5656.rb, line 12
+def curve_name
+  raise NotImplementedError, 'abstract class: curve_name not implemented'
+end
+
+ +
+ + + + +
+ + +
+ +
+
+ + + + diff --git a/Net/SSH/Transport/Kex/Curve25519Sha256.html b/Net/SSH/Transport/Kex/Curve25519Sha256.html new file mode 100644 index 0000000..b228aa8 --- /dev/null +++ b/Net/SSH/Transport/Kex/Curve25519Sha256.html @@ -0,0 +1,158 @@ + + + + + + +class Net::SSH::Transport::Kex::Curve25519Sha256 - net-ssh 6.0.0.beta1 + + + + + + + + + + + + + + +
+

+ class Net::SSH::Transport::Kex::Curve25519Sha256 +

+ +
+ +

A key-exchange service implementing the “curve25519-sha256@libssh.org” +key-exchange algorithm. (defined in tools.ietf.org/html/draft-ietf-curdle-ssh-curves-06)

+ +
+ + + + +
+ + + + + + + + + +
+
+

Public Instance Methods

+
+ + +
+ +
+ digester() + + click to toggle source + +
+ + +
+ + + + + + +
+
# File lib/net/ssh/transport/kex/curve25519_sha256.rb, line 14
+def digester
+  OpenSSL::Digest::SHA256
+end
+
+ +
+ + + + +
+ + +
+ +
+
+ + + + diff --git a/Net/SSH/Transport/Kex/Curve25519Sha256Loader.html b/Net/SSH/Transport/Kex/Curve25519Sha256Loader.html new file mode 100644 index 0000000..57bc01f --- /dev/null +++ b/Net/SSH/Transport/Kex/Curve25519Sha256Loader.html @@ -0,0 +1,207 @@ + + + + + + +module Net::SSH::Transport::Kex::Curve25519Sha256Loader - net-ssh 6.0.0.beta1 + + + + + + + + + + + + + + +
+

+ module Net::SSH::Transport::Kex::Curve25519Sha256Loader +

+ +
+ +

Loads Curve25519Sha256 support which +requires optinal dependencies

+ +
+ + + + +
+ + + + + +
+
+

Constants

+
+
+ +
ERROR + +
+ + +
LOADED + +
+ + +
+
+ + + + + +
+
+

Public Class Methods

+
+ + +
+ +
+ dependenciesRequiredForX25519() + + click to toggle source + +
+ + +
+ + + + + + +
+
# File lib/net/ssh/transport/kex/curve25519_sha256_loader.rb, line 22
+def self.dependenciesRequiredForX25519
+  result = "net-ssh requires the following gems for x25519 support:\n"
+  result << " * x25519\n"
+end
+
+ +
+ + + + +
+ + +
+ +
+ raiseUnlessLoaded(message) + + click to toggle source + +
+ + +
+ + + + + + +
+
# File lib/net/ssh/transport/kex/curve25519_sha256_loader.rb, line 16
+def self.raiseUnlessLoaded(message)
+  description = ERROR.is_a?(LoadError) ? dependenciesRequiredForX25519 : ''
+  description << "#{ERROR.class} : \"#{ERROR.message}\"\n" if ERROR
+  raise NotImplementedError, "#{message}\n#{description}" unless LOADED
+end
+
+ +
+ + + + +
+ + +
+ +
+
+ + + + diff --git a/Net/SSH/Transport/Kex/DiffieHellmanGroup14SHA1.html b/Net/SSH/Transport/Kex/DiffieHellmanGroup14SHA1.html index 02053ae..7c021b4 100644 --- a/Net/SSH/Transport/Kex/DiffieHellmanGroup14SHA1.html +++ b/Net/SSH/Transport/Kex/DiffieHellmanGroup14SHA1.html @@ -4,7 +4,7 @@ -class Net::SSH::Transport::Kex::DiffieHellmanGroup14SHA1 - net-ssh 4.2.0 +class Net::SSH::Transport::Kex::DiffieHellmanGroup14SHA1 - net-ssh 6.0.0.beta1 + + + + + + + + + + + + +
+

+ class Net::SSH::Transport::OpenSSLAESCTR +

+ +
+ +
+ + + + +
+ + + + + + + + + +
+
+

Public Class Methods

+
+ + +
+ +
+ block_size() + + click to toggle source + +
+ + +
+ + + + + + +
+
# File lib/net/ssh/transport/ctr.rb, line 16
+def self.block_size
+  16
+end
+
+ +
+ + + + +
+ + +
+ +
+ new(original) + + click to toggle source + +
+ + +
+ + + + +
+ Calls superclass method + +
+ + + +
+
# File lib/net/ssh/transport/ctr.rb, line 7
+def initialize(original)
+  super
+  @was_reset = false
+end
+
+ +
+ + + + +
+ + +
+ +
+
+

Public Instance Methods

+
+ + +
+ +
+ block_size() + + click to toggle source + +
+ + +
+ + + + + + +
+
# File lib/net/ssh/transport/ctr.rb, line 12
+def block_size
+  16
+end
+
+ +
+ + + + +
+ + +
+ +
+ iv=(iv_s) + + click to toggle source + +
+ + +
+ + + + +
+ Calls superclass method + +
+ + + +
+
# File lib/net/ssh/transport/ctr.rb, line 24
+def iv=(iv_s)
+  super unless @was_reset
+end
+
+ +
+ + + + +
+ + +
+ +
+ reset() + + click to toggle source + +
+ + +
+ + + + + + +
+
# File lib/net/ssh/transport/ctr.rb, line 20
+def reset
+  @was_reset = true
+end
+
+ +
+ + + + +
+ + +
+ +
+
+ + + + diff --git a/Net/SSH/Transport/PacketStream.html b/Net/SSH/Transport/PacketStream.html index af99475..929883b 100644 --- a/Net/SSH/Transport/PacketStream.html +++ b/Net/SSH/Transport/PacketStream.html @@ -4,7 +4,7 @@ -module Net::SSH::Transport::PacketStream - net-ssh 4.2.0 +module Net::SSH::Transport::PacketStream - net-ssh 6.0.0.beta1 + + + + + + + + + + + + +
+

+ class Net::SSH::Transport::Session::CompatibleVerifier +

+ +
+ +

Compatibility verifier which allows users to keep using custom verifier +code without adding new :verify_signature method.

+ +
+ + + + +
+ + + + + + + + + +
+
+

Public Class Methods

+
+ + +
+ +
+ new(verifier) + + click to toggle source + +
+ + +
+ + + + + + +
+
# File lib/net/ssh/transport/session.rb, line 281
+def initialize(verifier)
+  @verifier = verifier
+end
+
+ +
+ + + + +
+ + +
+ +
+
+

Public Instance Methods

+
+ + +
+ +
+ verify(arguments) + + click to toggle source + +
+ + +
+ + + + + + +
+
# File lib/net/ssh/transport/session.rb, line 285
+def verify(arguments)
+  @verifier.verify(arguments)
+end
+
+ +
+ + + + +
+ + +
+ +
+ verify_signature() { || ... } + + click to toggle source + +
+ + +
+ + + + + + +
+
# File lib/net/ssh/transport/session.rb, line 289
+def verify_signature(&block)
+  yield
+end
+
+ +
+ + + + +
+ + +
+ +
+
+ + + + diff --git a/Net/SSH/Transport/State.html b/Net/SSH/Transport/State.html index 49544f3..5e1cfbc 100644 --- a/Net/SSH/Transport/State.html +++ b/Net/SSH/Transport/State.html @@ -4,7 +4,7 @@ -class Net::SSH::Transport::State - net-ssh 4.2.0 +class Net::SSH::Transport::State - net-ssh 6.0.0.beta1 + + + + + + + + + + + + +
+

+ class Net::SSH::Verifiers::AcceptNew +

+ +
+ +

Does a strict host verification, looking the server up in the known host +files to see if a key has already been seen for this server. If this server +does not appear in any host file, this will silently add the server. If the +server does appear at least once, but the key given does not match any +known for the server, an exception will be raised (HostKeyMismatch). +Otherwise, this returns true.

+ +
+ + + + +
+ + + + + + + + + +
+
+

Public Instance Methods

+
+ + +
+ +
+ verify(arguments) + + click to toggle source + +
+ + +
+ + + + +
+ Calls superclass method + +
+ + + +
+
# File lib/net/ssh/verifiers/accept_new.rb, line 16
+def verify(arguments)
+  begin
+    super
+  rescue HostKeyUnknown => err
+    err.remember_host!
+    return true
+  end
+end
+
+ +
+ + + + +
+ + +
+ +
+ verify_signature() { || ... } + + click to toggle source + +
+ + +
+ + + + + + +
+
# File lib/net/ssh/verifiers/accept_new.rb, line 25
+def verify_signature(&block)
+  yield
+rescue HostKeyUnknown => err
+  err.remember_host!
+  return true
+end
+
+ +
+ + + + +
+ + +
+ +
+
+ + + + diff --git a/Net/SSH/Verifiers/AcceptNewOrLocalTunnel.html b/Net/SSH/Verifiers/AcceptNewOrLocalTunnel.html new file mode 100644 index 0000000..69d1dfd --- /dev/null +++ b/Net/SSH/Verifiers/AcceptNewOrLocalTunnel.html @@ -0,0 +1,167 @@ + + + + + + +class Net::SSH::Verifiers::AcceptNewOrLocalTunnel - net-ssh 6.0.0.beta1 + + + + + + + + + + + + + + +
+

+ class Net::SSH::Verifiers::AcceptNewOrLocalTunnel +

+ +
+ +

Basically the same as the AcceptNew verifier, +but does not try to actually verify a connection if the server is the +localhost and the port is a nonstandard port number. Those two conditions +will typically mean the connection is being tunnelled through a forwarded +port, so the known-hosts file will not be helpful (in general).

+ +
+ + + + +
+ + + + + + + + + +
+
+

Public Instance Methods

+
+ + +
+ +
+ verify(arguments) + + click to toggle source + +
+ + +
+ +

Tries to determine if the connection is being tunnelled, and if so, returns +true. Otherwise, performs the standard strict verification.

+ + +
+ Calls superclass method + Net::SSH::Verifiers::AcceptNew#verify +
+ + + +
+
# File lib/net/ssh/verifiers/accept_new_or_local_tunnel.rb, line 15
+def verify(arguments)
+  return true if tunnelled?(arguments)
+  super
+end
+
+ +
+ + + + +
+ + +
+ +
+
+ + + + diff --git a/Net/SSH/Verifiers/Always.html b/Net/SSH/Verifiers/Always.html new file mode 100644 index 0000000..312c8a9 --- /dev/null +++ b/Net/SSH/Verifiers/Always.html @@ -0,0 +1,213 @@ + + + + + + +class Net::SSH::Verifiers::Always - net-ssh 6.0.0.beta1 + + + + + + + + + + + + + + +
+

+ class Net::SSH::Verifiers::Always +

+ +
+ +

Does a strict host verification, looking the server up in the known host +files to see if a key has already been seen for this server. If this server +does not appear in any host file, an exception will be raised +(HostKeyUnknown). This is in contrast to the “Strict” class, which will +silently add the key to your known_hosts file. If the server does appear at +least once, but the key given does not match any known for the server, an +exception will be raised (HostKeyMismatch). Otherwise, this returns true.

+ +
+ + + + +
+ + + + + + + + + +
+
+

Public Instance Methods

+
+ + +
+ +
+ verify(arguments) + + click to toggle source + +
+ + +
+ + + + + + +
+
# File lib/net/ssh/verifiers/always.rb, line 17
+def verify(arguments)
+  host_keys = arguments[:session].host_keys
+
+  # We've never seen this host before, so raise an exception.
+  process_cache_miss(host_keys, arguments, HostKeyUnknown, "is unknown") if host_keys.empty?
+
+  # If we found any matches, check to see that the key type and
+  # blob also match.
+  found = host_keys.any? do |key|
+    key.ssh_type == arguments[:key].ssh_type &&
+    key.to_blob  == arguments[:key].to_blob
+  end
+
+  # If a match was found, return true. Otherwise, raise an exception
+  # indicating that the key was not recognized.
+  process_cache_miss(host_keys, arguments, HostKeyMismatch, "does not match") unless found
+
+  found
+end
+
+ +
+ + + + +
+ + +
+ +
+ verify_signature() { || ... } + + click to toggle source + +
+ + +
+ + + + + + +
+
# File lib/net/ssh/verifiers/always.rb, line 37
+def verify_signature(&block)
+  yield
+end
+
+ +
+ + + + +
+ + +
+ +
+
+ + + + diff --git a/Net/SSH/Verifiers/Never.html b/Net/SSH/Verifiers/Never.html new file mode 100644 index 0000000..962bb5f --- /dev/null +++ b/Net/SSH/Verifiers/Never.html @@ -0,0 +1,193 @@ + + + + + + +class Net::SSH::Verifiers::Never - net-ssh 6.0.0.beta1 + + + + + + + + + + + + + + +
+

+ class Net::SSH::Verifiers::Never +

+ +
+ +

This host key verifier simply allows every key it sees, without any +verification. This is simple, but very insecure because it exposes you to +MiTM attacks.

+ +
+ + + + +
+ + + + + + + + + +
+
+

Public Instance Methods

+
+ + +
+ +
+ verify(arguments) + + click to toggle source + +
+ + +
+ +

Returns true.

+ + + + +
+
# File lib/net/ssh/verifiers/never.rb, line 10
+def verify(arguments)
+  true
+end
+
+ +
+ + + + +
+ + +
+ +
+ verify_signature(&block) + + click to toggle source + +
+ + +
+ + + + + + +
+
# File lib/net/ssh/verifiers/never.rb, line 14
+def verify_signature(&block)
+  true
+end
+
+ +
+ + + + +
+ + +
+ +
+
+ + + + diff --git a/Net/SSH/Version.html b/Net/SSH/Version.html index ed3111a..c329ef2 100644 --- a/Net/SSH/Version.html +++ b/Net/SSH/Version.html @@ -4,7 +4,7 @@ -class Net::SSH::Version - net-ssh 4.2.0 +class Net::SSH::Version - net-ssh 6.0.0.beta1 + + + + + + + + + + + + +
+

+ class OpenSSL::PKey::EC::Point +

+ +
+ +
+ + + + +
+ + + + + + + + + +
+
+

Public Instance Methods

+
+ + +
+ +
+ ssh_type() + + click to toggle source + +
+ + +
+ +

Returns the description of this key type used by the SSH2 protocol, like +“ecdsa-sha2-nistp256”

+ + + + +
+
# File lib/net/ssh/transport/openssl.rb, line 235
+def ssh_type
+  "ecdsa-sha2-#{CurveNameAliasInv[group.curve_name]}"
+end
+
+ +
+ + + + +
+ + +
+ +
+ to_blob() + + click to toggle source + +
+ + +
+ +

Converts the key to a blob, according to the SSH2 protocol.

+ + + + +
+
# File lib/net/ssh/transport/openssl.rb, line 240
+def to_blob
+  @blob ||= Net::SSH::Buffer.from(:string, ssh_type,
+                                  :string, CurveNameAliasInv[group.curve_name],
+                                  :mstring, to_bn.to_s(2)).to_s
+  @blob
+end
+
+ +
+ + + + +
+ + +
+ +
+
+ + + + diff --git a/OpenSSL/PKey/PKey.html b/OpenSSL/PKey/PKey.html index e839a34..12ad858 100644 --- a/OpenSSL/PKey/PKey.html +++ b/OpenSSL/PKey/PKey.html @@ -4,7 +4,7 @@ -class OpenSSL::PKey::PKey - net-ssh 4.2.0 +class OpenSSL::PKey::PKey - net-ssh 6.0.0.beta1 + + + + + + + + + + + + +
+ +

+]

+ +

Net::SSH 6.x

+ + +

As of v2.6.4, all gem releases are signed. See INSTALL.

+ +

DESCRIPTION:

+ +

Net::SSH is a pure-Ruby implementation of the +SSH2 client protocol. It allows you to write programs that invoke and +interact with processes on remote servers, via SSH2.

+ +

FEATURES:

+ + +

Supported Algorithms

+ +

Net::SSH 6.0 disables by default the usage of +weak algorithms. We strongly recommend that you install a servers's +version that supports the latest algorithms.

+ +

It is possible to return to the previous behavior by adding the option : +append_all_supported_algorithms: true

+ +

Unsecure algoritms will be definively remove in Net::SSH 7.*.

+ +

Host Keys

+ +

| Name | Support | Details | |———————-|———————–|———-| | ssh-rsa | OK | | | +ssh-ed25519 | OK | Require the gem ed25519 | | +ecdsa-sha2-nistp521 | OK | using +weak elliptic curves | | ecdsa-sha2-nistp384 | OK | using weak elliptic curves | | +ecdsa-sha2-nistp256 | OK | using +weak elliptic curves | | ssh-dss | Deprecated in 6.0 | unsecure, will +be removed in 7.0 |

+ +

Key Exchange

+ +

| Name | Support | Details | |————————————–|———————–|———-| | +curve25519-sha256 | OK | Require the gem x25519 | | +ecdh-sha2-nistp521 | OK | using weak +elliptic curves | | ecdh-sha2-nistp384 | OK | using weak elliptic curves | | +ecdh-sha2-nistp256 | OK | using weak +elliptic curves | | diffie-hellman-group1-sha1 | Deprecated in 6.0 | +unsecure, will be removed in 7.0 | | diffie-hellman-group14-sha1 | OK | | | +diffie-hellman-group-exchange-sha1 | Deprecated in 6.0 | unsecure, will be +removed in 7.0 | | diffie-hellman-group-exchange-sha256 | OK | |

+ +

Encryption algorithms (ciphers)

+ +

| Name | Support | Details | |————————————–|———————–|———-| | aes256-ctr / +aes192-ctr / aes128-ctr | OK | using +weak elliptic curves | | aes256-cbc / aes192-cbc / aes128-cbc | +Deprecated in 6.0 | unsecure, will be removed in 7.0 | | +rijndael-cbc@lysator.liu.se | Deprecated in 6.0 | unsecure, will be removed +in 7.0 | | blowfish-ctr blowfish-cbc | Deprecated in 6.0 | unsecure, will +be removed in 7.0 | | cast128-ctr cast128-cbc | Deprecated in 6.0 | +unsecure, will be removed in 7.0 | | 3des-ctr 3des-cbc | Deprecated in 6.0 +| unsecure, will be removed in 7.0 | | idea-cbc | Deprecated in 6.0 | +unsecure, will be removed in 7.0 | | none | Deprecated in 6.0 | unsecure, +will be removed in 7.0 |

+ +

Message Authentication Code algorithms

+ +

| Name | Support | Details | |———————-|———————–|———-| | hmac-sha2-512-etm | +OK | | | hmac-sha2-256-etm | OK | | | hmac-sha2-512 | OK | | | +hmac-sha2-256 | OK | | | hmac-sha2-512-96 | Deprecated in 6.0 | removed +from the specification, will be removed in 7.0 | | hmac-sha2-256-96 | +Deprecated in 6.0 | removed from the specification, will be removed in 7.0 +| | hmac-sha1 | OK | for backward compatibility | | hmac-sha1-96 | +Deprecated in 6.0 | unsecure, will be removed in 7.0 | | hmac-ripemd160 | +Deprecated in 6.0 | unsecure, will be removed in 7.0 | | hmac-md5 | +Deprecated in 6.0 | unsecure, will be removed in 7.0 | | hmac-md5-96 | +Deprecated in 6.0 | unsecure, will be removed in 7.0 | | none | Deprecated +in 6.0 | unsecure, will be removed in 7.0 |

+ +

SYNOPSIS:

+ +

In a nutshell:

+ +
require 'net/ssh'
+
+Net::SSH.start('host', 'user', password: "password") do |ssh|
+# capture all stderr and stdout output from a remote process
+output = ssh.exec!("hostname")
+puts output
+
+# capture only stdout matching a particular pattern
+stdout = ""
+ssh.exec!("ls -l /home/jamis") do |channel, stream, data|
+  stdout << data if stream == :stdout
+end
+puts stdout
+
+# run multiple processes in parallel to completion
+ssh.exec "sed ..."
+ssh.exec "awk ..."
+ssh.exec "rm -rf ..."
+ssh.loop
+
+# open a new channel and configure a minimal set of callbacks, then run
+# the event loop until the channel finishes (closes)
+channel = ssh.open_channel do |ch|
+  ch.exec "/usr/local/bin/ruby /path/to/file.rb" do |ch, success|
+    raise "could not execute command" unless success
+
+    # "on_data" is called when the process writes something to stdout
+    ch.on_data do |c, data|
+      $stdout.print data
+    end
+
+    # "on_extended_data" is called when the process writes something to stderr
+    ch.on_extended_data do |c, type, data|
+      $stderr.print data
+    end
+
+    ch.on_close { puts "done!" }
+  end
+end
+
+channel.wait
+
+# forward connections on local port 1234 to port 80 of www.capify.org
+ssh.forward.local(1234, "www.capify.org", 80)
+ssh.loop { true }
+end
+
+ +

See Net::SSH for more documentation, and links +to further information.

+ +

REQUIREMENTS:

+ +

The only requirement you might be missing is the OpenSSL bindings for Ruby with a version greather +than 1.0.1. These are built by default on most platforms, but +you can verify that they're built and installed on your system by +running the following command line:

+ +
ruby -ropenssl -e 'puts OpenSSL::OPENSSL_VERSION'
+ +

If that spits out something like OpenSSL 1.0.1 14 Mar 2012, +then you're set. If you get an error, then you'll need to see about +rebuilding ruby with OpenSSL support, or (if +your platform supports it) installing the OpenSSL bindings separately.

+ +

INSTALL:

+ +
gem install net-ssh # might need sudo privileges
+
+ +

NOTE: If you are running on jruby on windows you need to install +jruby-pageant manually (gemspec doesn't allow for platform +specific dependencies).

+ +

However, in order to be sure the code you're installing hasn't been +tampered with, it's recommended that you verify the signature. To do this, +you need to add my public key as a trusted certificate (you only need to do +this once):

+ +
# Add the public key as a trusted certificate
+# (You only need to do this once)
+curl -O https://raw.githubusercontent.com/net-ssh/net-ssh/master/net-ssh-public_cert.pem
+gem cert --add net-ssh-public_cert.pem
+ +

Then, when install the gem, do so with high security:

+ +
gem install net-ssh -P HighSecurity
+ +

If you don't add the public key, you'll see an error like +“Couldn't verify data signature”. If you're still having trouble +let me know and I'll give you a hand.

+ +

For ed25519 public key auth support your bundle file should contain +ed25519, bcrypt_pbkdf dependencies.

+ +
gem install ed25519
+gem install bcrypt_pbkdf
+
+ +

For curve25519-sha256 kex exchange support your bundle file should contain +x25519 dependency.

+ +

RUBY SUPPORT

+ + +

RUNNING TESTS

+ +

If you want to run the tests or use any of the Rake tasks, you'll need +Mocha and other dependencies listed in Gemfile

+ +

Run the test suite from the net-ssh directory with the following command:

+ +
bundle exec rake test
+
+ +

Run a single test file like this:

+ +
ruby -Ilib -Itest test/transport/test_server_version.rb
+ +

To run integration tests see test/integration/README.txt

+ +

BUILDING GEM

+ +
rake build
+
+ +

GEM SIGNING (for maintainers)

+ +

If you have the net-ssh private signing key, you will be able to create +signed release builds. Make sure the private key path matches the +signing_key path set in net-ssh.gemspec and tell +rake to sign the gem by setting the NET_SSH_BUILDGEM_SIGNED +flag:

+ +
NET_SSH_BUILDGEM_SIGNED=true rake build
+ +

For time to time, the public certificate associated to the private key +needs to be renewed. You can do this with the following command:

+ +
gem cert --build netssh@solutious.com --private-key path/2/net-ssh-private_key.pem
+mv gem-public_cert.pem net-ssh-public_cert.pem
+gem cert --add net-ssh-public_cert.pem
+ +

CREDITS

+ +

Contributors

+ +

This project exists thanks to all the people who contribute.

+ +

+ +

Backers

+ +

Thank you to all our backers! 🙏 Become a backer

+ +

+ +

Sponsors

+ +

Support this project by becoming a sponsor. Your logo will show up here +with a link to your website. Become a sponsor

+ +

+ +

LICENSE:

+ +

(The MIT License)

+ +

Copyright © 2008 Jamis Buck

+ +

Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to permit +persons to whom the Software is furnished to do so, subject to the +following conditions:

+ +

The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software.

+ +

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +USE OR OTHER DEALINGS IN THE SOFTWARE.

+
+ + + + + diff --git a/String.html b/String.html index 0da239d..30d5a72 100644 --- a/String.html +++ b/String.html @@ -4,7 +4,7 @@ -class String - net-ssh 4.2.0 +class String - net-ssh 6.0.0.beta1