Classes and Modules
Module Net::SSH::Transport::Compress
Module Net::SSH::Transport::Constants
Module Net::SSH::Transport::DisconnectReasons
Module Net::SSH::Transport::Kex
Module Net::SSH::Transport::OSSL
Class Net::SSH::Transport::AlgorithmNegotiator
Class Net::SSH::Transport::CipherNotFound
Class Net::SSH::Transport::DigestTypeNotFound
Class Net::SSH::Transport::Disconnect
Class Net::SSH::Transport::Exception
Class Net::SSH::Transport::HMACAlgorithmNotFound
Class Net::SSH::Transport::IdentityCipher
Class Net::SSH::Transport::IncomingPacketStream
Class Net::SSH::Transport::KeyTypeNotFound
Class Net::SSH::Transport::OutgoingPacketStream
Class Net::SSH::Transport::PacketStream
Class Net::SSH::Transport::Session
Class Net::SSH::Transport::VersionNegotiator
Public Instance methods
register_services( container )

Register the services that together implement the SSH transport layer.

     # File lib/net/ssh/transport/services.rb, line 22
 22:       def register_services( container )
 23:         container.namespace_define :transport do |b|
 24:           b.kex_names { Hash.new }
 25:           b.compression_algorithms { Hash.new }
 26:           b.decompression_algorithms { Hash.new }
 27: 
 28:           b.cipher_factories { Hash.new }
 29:           b.hmac_factories { Hash.new }
 30:           b.key_factories { Hash.new }
 31:           b.buffer_factories { Hash.new }
 32:           b.bn_factories { Hash.new }
 33:           b.digest_factories { Hash.new }
 34: 
 35:           b.ciphers( :model => :prototype ) { |c,|
 36:             c.cipher_factories.fetch( c.crypto_backend ) }
 37: 
 38:           b.hmacs( :model => :prototype ) { |c,|
 39:             c.hmac_factories.fetch( c.crypto_backend ) }
 40: 
 41:           b.keys( :model => :prototype ) { |c,|
 42:             c.key_factories.fetch( c.crypto_backend ) }
 43: 
 44:           b.buffers( :model => :prototype ) { |c,|
 45:             c.buffer_factories.fetch( c.crypto_backend ) }
 46: 
 47:           b.bns( :model => :prototype ) { |c,|
 48:             c.bn_factories.fetch( c.crypto_backend ) }
 49: 
 50:           b.digesters( :model => :prototype ) { |c,|
 51:             c.digest_factories.fetch( c.crypto_backend ) }
 52: 
 53:           b.identity_cipher do
 54:             require 'net/ssh/transport/identity-cipher'
 55:             IdentityCipher.new
 56:           end
 57: 
 58:           b.outgoing_packet_stream :model => :prototype_deferred do |c,|
 59:             require 'net/ssh/transport/packet-stream'
 60:             OutgoingPacketStream.new(
 61:               c.ciphers, c.hmacs, c.compression_algorithms )
 62:           end
 63: 
 64:           b.incoming_packet_stream :model => :prototype_deferred do |c,point|
 65:             require 'net/ssh/transport/packet-stream'
 66:             stream = IncomingPacketStream.new(
 67:               c.ciphers, c.hmacs, c.decompression_algorithms )
 68:             stream.buffers = c.buffers
 69:             stream.log = c.log_for( point )
 70:             stream
 71:           end
 72: 
 73:           b.algorithms do
 74:             Hash[
 75:               :host_key => [ "ssh-dss", "ssh-rsa" ],
 76:               :kex => [ "diffie-hellman-group-exchange-sha1",
 77:                         "diffie-hellman-group1-sha1" ],
 78:               :encryption => [ "3des-cbc",
 79:                                "aes128-cbc", 
 80:                                "blowfish-cbc",
 81:                                "aes256-cbc",
 82:                                "aes192-cbc",
 83:                                "idea-cbc",
 84:                                "none" ],
 85:               :hmac => [ "hmac-md5",
 86:                          "hmac-sha1",
 87:                          "hmac-md5-96",
 88:                          "hmac-sha1-96",
 89:                          "none" ],
 90:               :compression => [ "none", "zlib" ],
 91:               :languages => []
 92:             ]
 93:           end
 94: 
 95:           b.default_ssh_port { 22 }
 96: 
 97:           b.socket_factory do
 98:             require 'socket'
 99:             TCPSocket
100:           end
101: 
102:           b.version_negotiator do |c,point|
103:             require 'net/ssh/transport/version-negotiator'
104:             VersionNegotiator.new( c.log_for( point ) )
105:           end
106: 
107:           b.algorithm_negotiator do |c,point|
108:             require 'net/ssh/transport/algorithm-negotiator'
109:             AlgorithmNegotiator.new(
110:               c.log_for( point ),
111:               c.algorithms,
112:               c.buffers )
113:           end
114: 
115:           b.session do |c,point|
116:             require 'net/ssh/transport/session'
117: 
118:             args = [ c[:transport_host] ]
119:             args << c[:transport_options] if c.knows_key?(:transport_options)
120: 
121:             Session.new( *args ) do |s|
122:               s.logger               = c[:log_for, point]
123:               s.default_port         = c[:default_ssh_port]
124:               s.version_negotiator   = c[:version_negotiator]
125:               s.algorithm_negotiator = c[:algorithm_negotiator]
126:               s.socket_factory       = c[:socket_factory]
127:               s.packet_sender        = c[:outgoing_packet_stream]
128:               s.packet_receiver      = c[:incoming_packet_stream]
129:               s.ciphers              = c[:ciphers]
130:               s.hmacs                = c[:hmacs]
131:               s.kexs                 = c[:kex_names]
132:               s.compressors          = c[:compression_algorithms]
133:               s.decompressors        = c[:decompression_algorithms]
134:             end
135:           end
136: 
137:           b.require 'net/ssh/transport/ossl/services', "#{self}::OSSL"
138:           b.require 'net/ssh/transport/compress/services', "#{self}::Compress"
139:           b.require 'net/ssh/transport/kex/services', "#{self}::Kex"
140:         end
141:       end

[Validate]