Implementation of the base SSH packet protocol.
list of weak references to the object (if defined)
Checks if the handshake has timed out.
Returns: handshake time out status, as a
Trueif a new set of keys needs to be negotiated. This will be triggered during a packet read or write, so it should be checked after every read or write, or at least after every few.
Read as close to N bytes as possible, blocking as long as necessary.
Parameters: n (int) – number of bytes to read Returns: the data read, as a
Raises: EOFError – if the socket was closed before all the bytes could be read
Only one thread should ever be in this function (no other locking is done).
- SSHException – if the packet is mangled
- NeedRekeyException – if the transport should rekey
Read a line from the socket. We assume no data is pending after the line, so it’s okay to attempt large reads.
Write a block of data using the current cipher, as an SSH block.
set_inbound_cipher(block_engine, block_size, mac_engine, mac_size, mac_key)¶
Switch inbound data cipher.
Turn on/off the callback keepalive. If
intervalseconds pass with no data read from or written to the socket, the callback will be executed and the timer will be reset.
Set the Python log object to use for logging.
set_outbound_cipher(block_engine, block_size, mac_engine, mac_size, mac_key, sdctr=False)¶
Switch outbound data cipher.