Class t.c.s.t.SSHClientTransport(SSHTransportBase):

Part of twisted.conch.ssh.transport View Source View In Hierarchy

Known subclasses: twisted.conch.client.direct.SSHClientTransport, twisted.conch.scripts.tkconch.SSHClientTransport

SSHClientTransport implements the client side of the SSH protocol.
Instance VariablesisClientsince we are always the client, this is always True.
_gotNewKeysif we receive a MSG_NEWKEYS message before we are ready to transition to the new keys, this is set to True so we can transition when the keys are ready locally.
xour Diffie-Hellman private key.
eour Diffie-Hellman public key.
gthe Diffie-Hellman group generator.
pthe Diffie-Hellman group prime
instancethe SSHService object we are requesting.
Method connectionMade Called when the connection is started with the server. Just sets
Method ssh_KEXINIT Called when we receive a MSG_KEXINIT message. For a description
Method ssh_KEX_DH_GEX_GROUP This handles two different message which share an integer value.
Method ssh_KEX_DH_GEX_REPLY

Called when we receieve a MSG_KEX_DH_GEX_REPLY message. Payload:


Method ssh_NEWKEYS Called when we receieve a MSG_NEWKEYS message. No payload.
Method ssh_SERVICE_ACCEPT

Called when we receieve a MSG_SERVICE_ACCEPT message. Payload:


Method requestService Request that a service be run over this transport.
Method verifyHostKey Returns a Deferred that gets a callback if it is a valid key, or
Method connectionSecure Called when the encryption has been set up. Generally,
Method _continueKEXDH_REPLY The host key has been verified, so we generate the keys.
Method _continueGEX_REPLY The host key has been verified, so we generate the keys.
Method _keySetup See SSHTransportBase._keySetup().

Inherited from SSHTransportBase:

Method connectionLost Called when the connection is shut down.
Method sendKexInit Undocumented
Method sendPacket Sends a packet. If it's been set up, compress the data, encrypt it,
Method getPacket Try to return a decrypted, authenticated, and decompressed packet
Method dataReceived First, check for the version string (SSH-2.0-*). After that has been
Method dispatchMessage Send a received message to the appropriate method.
Method ssh_DISCONNECT

Called when we receive a MSG_DISCONNECT message. Payload:


Method ssh_IGNORE Called when we receieve a MSG_IGNORE message. No payload.
Method ssh_UNIMPLEMENTED

Called when we receieve a MSG_UNIMPLEMENTED message. Payload:


Method ssh_DEBUG

Called when we receieve a MSG_DEBUG message. Payload:


Method setService Set our service to service and start it running. If we were
Method sendDebug Send a debug message to the other side.
Method sendIgnore Send a message that will be ignored by the other side. This is
Method sendUnimplemented Send a message to the other side that the last packet was not
Method sendDisconnect Send a disconnect message to the other side and then disconnect.
Method isEncrypted Return True if the connection is encrypted in the given direction.
Method isVerified Return True if the connecction is verified/authenticated in the
Method loseConnection Lose the connection to the other side, sending a
Method receiveError Called when we receive a disconnect error message from the other
Method receiveUnimplemented Called when we receive an unimplemented packet message from the other
Method receiveDebug Called when we receive a debug message from the other side.
Method _getKey Get one of the keys for authentication/encryption.

Inherited from BaseProtocol (via SSHTransportBase, Protocol):

Method makeConnection Make a connection to a transport and a server.
def connectionMade(self): (source)
Called when the connection is started with the server. Just sets up a private instance variable.
def ssh_KEXINIT(self, packet): (source)
Called when we receive a MSG_KEXINIT message. For a description of the packet, see SSHTransportBase.ssh_KEXINIT(). Additionally, this method sends the first key exchange packet. If the agreed-upon exchange is diffie-hellman-group1-sha1, generate a public key and send it in a MSG_KEXDH_INIT message. If the exchange is diffie-hellman-group-exchange-sha1, ask for a 2048 bit group with a MSG_KEX_DH_GEX_REQUEST_OLD message.
def ssh_KEX_DH_GEX_GROUP(self, packet): (source)
This handles two different message which share an integer value. If the key exchange is diffie-hellman-group1-sha1, this is MSG_KEXDH_REPLY. Payload:

   string serverHostKey
   integer f (server Diffie-Hellman public key)
   string signature

We verify the host key by calling verifyHostKey, then continue in _continueKEXDH_REPLY.

If the key exchange is diffie-hellman-group-exchange-sha1, this is MSG_KEX_DH_GEX_GROUP. Payload:

   string g (group generator)
   string p (group prime)

We generate a Diffie-Hellman public key and send it in a MSG_KEX_DH_GEX_INIT message.

def _continueKEXDH_REPLY(self, ignored, pubKey, f, signature): (source)
The host key has been verified, so we generate the keys.
ParameterspubKeythe public key blob for the server's public key. (type: str )
fthe server's Diffie-Hellman public key. (type: long )
signaturethe server's signature, verifying that it has the correct private key. (type: str )
def ssh_KEX_DH_GEX_REPLY(self, packet): (source)
Called when we receieve a MSG_KEX_DH_GEX_REPLY message. Payload:

   string server host key
   integer f (server DH public key)

We verify the host key by calling verifyHostKey, then continue in _continueGEX_REPLY.

def _continueGEX_REPLY(self, ignored, pubKey, f, signature): (source)
The host key has been verified, so we generate the keys.
ParameterspubKeythe public key blob for the server's public key. (type: str )
fthe server's Diffie-Hellman public key. (type: long )
signaturethe server's signature, verifying that it has the correct private key. (type: str )
def _keySetup(self, sharedSecret, exchangeHash): (source)
See SSHTransportBase._keySetup().
def ssh_NEWKEYS(self, packet): (source)
Called when we receieve a MSG_NEWKEYS message. No payload. If we've finished setting up our own keys, start using them. Otherwise, remeber that we've receieved this message.
def ssh_SERVICE_ACCEPT(self, packet): (source)
Called when we receieve a MSG_SERVICE_ACCEPT message. Payload:

   string service name

Start the service we requested.

def requestService(self, instance): (source)
Request that a service be run over this transport.
Parametersinstance (type: subclass of twisted.conch.ssh.service.SSHService )
def verifyHostKey(self, hostKey, fingerprint): (source)
Returns a Deferred that gets a callback if it is a valid key, or an errback if not.
ParametershostKey (type: str )
fingerprint (type: str )
Returns (type: twisted.internet.defer.Deferred )
def connectionSecure(self): (source)
Called when the encryption has been set up. Generally, requestService() is called to run another service over the transport.
API Documentation for Twisted, generated by pydoctor at 2009-11-24 22:07:21.