Feature notes: SSH implementation notes
inherits from Exception
(no public members)
inherits from eSSHTransportError
(no public members)
inherits from eSSHTransportError
constructor Create(aMsgNo: UInt32);
property MsgNo: UInt32 read fMsgNo;
inherits from eSSHTransportError
constructor Create(aErrorCode : UInt32; const aDescription: string; const aLanguageTag: string);
property ErrorCode: UInt32 read fErrorCode;
property Description: string read fDescription;
property LanguageTag: string read fLanguageTag;
inherits from eSSHDisconnect
(no public members)
inherits from eSSHDisconnect
(no public members)
inherits from eSSHDisconnect
The connection ended with no SSH_MSG_DISCONNECT read: the peer closed its end, or the connection was reset or aborted. ErrorCode is SSH_DISCONNECT_CONNECTION_LOST. The transport has closed its socket, as it does on reading a DISCONNECT.
(no public members)
function RawAccept(aSocket: tSocket): tSocket;
function RawConnect(aSocket: tSocket = 0): tSocket;
procedure RawClose(aSocket: tSocket);
function RawRecvLength(aSocket: tSocket): Integer;
function RawRecv(aSocket: tSocket; const aBuffer: tBytes; aOffset, aCount : Integer) : Integer;
function RawSend(aSocket: tSocket; const aBuffer: tBytes; aOffset, aCount : Integer) : Integer;
(no public members)
procedure ServerHelloString(const aStr: string);
procedure Debug(aAlwaysDisplay: Boolean; const aMessage : string; const aLanguageTag : string);
function ServiceRequest(const aServiceName: string; const aTransport : iSSHTransport): Boolean;
procedure Unimplemented(aMsgNo: UInt32);
inherits from iTransport
function GetVersionClient: string;
function GetVersionServer: string;
function GetKexOptions: iSSHOptionList;
function GetServerHostKeyOptions: iSSHOptionList;
function GetEncryptionC2SOptions: iSSHOptionList;
function GetEncryptionS2COptions: iSSHOptionList;
function GetMacC2SOptions: iSSHOptionList;
function GetMacS2COptions: iSSHOptionList;
function GetCompressionC2SOptions: iSSHOptionList;
function GetCompressionS2COptions: iSSHOptionList;
function GetSessionID: tBytes;
function GetUsername: string;
function GetRequestedService: string;
function GetRawEvents: iSSHTransportRawEvents;
function GetSSHEvents: iSSHTransportEvents;
procedure SetVersionClient(const Value: string);
procedure SetVersionServer(const Value: string);
procedure SetKexOptions(const Value: iSSHOptionList);
procedure SetServerHostKeyOptions(const Value: iSSHOptionList);
procedure SetEncryptionC2SOptions(const Value: iSSHOptionList);
procedure SetEncryptionS2COptions(const Value: iSSHOptionList);
procedure SetMacC2SOptions(const Value: iSSHOptionList);
procedure SetMacS2COptions(const Value: iSSHOptionList);
procedure SetCompressionC2SOptions(const Value: iSSHOptionList);
procedure SetCompressionS2COptions(const Value: iSSHOptionList);
procedure SetUsername(const Value: string);
procedure SetRawEvents(const Value: iSSHTransportRawEvents);
procedure SetSSHEvents(const Value: iSSHTransportEvents);
procedure InitKeys(const aKeys: iSSHSymmetricKeys);
function ReadMessage(const aAllowed: tByteSet; out aMsgCode: Byte; aInclTag: Boolean = False) : tBytes; overload;
function ReadMessage(const aAllowed: tByteSet): Byte; overload;
function PollMessage(const aAllowed: tByteSet; out aMsgCode: Byte; aInclTag: Boolean = False) : tBytes;
procedure ReadNewKeys;
procedure Disconnect(aErrorCode: UInt32);
procedure CreateLock;
procedure FreeLock;
procedure Lock;
procedure Unlock;
property VersionClient: string read GetVersionClient write SetVersionClient;
property VersionServer: string read GetVersionServer write SetVersionServer;
property KexOptions: iSSHOptionList read GetKexOptions write SetKexOptions;
property ServerHostKeyOptions: iSSHOptionList read GetServerHostKeyOptions write SetServerHostKeyOptions;
property EncryptionC2SOptions: iSSHOptionList read GetEncryptionC2SOptions write SetEncryptionC2SOptions;
property EncryptionS2COptions: iSSHOptionList read GetEncryptionS2COptions write SetEncryptionS2COptions;
property MacC2SOptions: iSSHOptionList read GetMacC2SOptions write SetMacC2SOptions;
property MacS2COptions: iSSHOptionList read GetMacS2COptions write SetMacS2COptions;
property CompressionC2SOptions: iSSHOptionList read GetCompressionC2SOptions write SetCompressionC2SOptions;
property CompressionS2COptions: iSSHOptionList read GetCompressionS2COptions write SetCompressionS2COptions;
property SessionID: tBytes read GetSessionID;
property Username: string read GetUsername write SetUsername;
property RequestedService: string read GetRequestedService;
property RawEvents: iSSHTransportRawEvents read GetRawEvents write SetRawEvents;
property SSHEvents: iSSHTransportEvents read GetSSHEvents write SetSSHEvents;
inherits from iSSHTransport
function RequestService(const aServiceName: string): Boolean;
inherits from iSSHTransport
function GetSocket: Cardinal;
property Socket: Cardinal read GetSocket;
A server transport's login, from the connection being taken on until the client has logged in (TstCustomSSHServer.LoginGraceTime). tSSHServerTransport implements it, and the server asks a transport for it with Supports: a transport that does not implement it is waited on during the login as during the rest of the connection.
procedure BeginLogin(aGraceTime: Cardinal);
procedure EndLogin;
function CancelLogin: Boolean;
A client transport's calls, which the calling thread makes without the transport's lock: those of TstCustomSSHClient.ConnectToHost, Login and RequestService. tSSHClientTransport implements it, and the client asks a transport for it with Supports.
Between BeginCall and EndCall the connection belongs to the thread that makes the call, so Close then does not close it but cancels the call, as CancelCall does. After EndCall, Close closes the connection again. A wait for the server's next message ends the connection after about 5 s without one, during a call as outside it.
procedure BeginCall;
function EndCall: Boolean;
function CancelCall: Boolean;
function GetLastActivity: Cardinal;
property LastActivity: Cardinal read GetLastActivity;
inherits from tObjectMapping
implements iTransport, iSSHTransport, iSSHLastActivity
destructor Destroy; override;
inherits from tSSHTransport
implements iSSHClientTransport, iSSHClientCall
constructor Create(const aRawEvents: iSSHTransportRawEvents; const aSocket : UInt32);
inherits from tSSHTransport
implements iSSHServerTransport, iSSHServerLogin
constructor Create;
inherits from iTransport
An SSH channel. Its Send (iTransport.Send) passes the bytes to the peer as far as the peer's window allows, and returns how many it passed: aCount, or fewer when the window shut and stayed shut for about a second, or 0 when it was shut already. SendAllOnChannel below sends all of them.
function GetState: tChannelState;
function GetRemoteWindowSize: Integer;
function GetRemotePacketSize(const aPrefSize: Integer): Integer;
property RemoteWindowSize: Integer read GetRemoteWindowSize;
property State: tChannelState read GetState;