SSHTransport class abstract
SSH Transport Layer Protocol implementation providing KEX, ciphers, and MAC. https://tools.ietf.org/html/rfc4253
- Mixed-in types
- Implementers
Constructors
-
SSHTransport(bool server, {Identity identity, Uri hostport, bool compress, List<
Forward> forwardLocal, List<Forward> forwardRemote, VoidCallback disconnected, ResponseCallback response, StringCallback print, StringCallback debugPrint, StringCallback tracePrint, SocketInterface socket, Random random, SecureRandom secureRandom})
Properties
-
channels
↔ HashMap<
int, Channel> -
getter/setter pair
- cipherIdC2s ↔ int
-
getter/setter pair
- cipherIdS2c ↔ int
-
getter/setter pair
- client → bool
-
Whether we've initiated the connection.
no setter
- compress ↔ bool
-
Whether compression is supported.
getter/setter pair
- compressIdC2s ↔ int
-
getter/setter pair
- compressIdS2c ↔ int
-
getter/setter pair
- debugPrint ↔ StringCallback
-
Parameter invoked with debug logging.
getter/setter pair
- decrypt ↔ BlockCipher
-
getter/setter pair
- decryptBlockSize ↔ int
-
getter/setter pair
- decryptBuf ↔ Uint8List
-
getter/setter pair
- dh ↔ DiffieHellman
-
getter/setter pairinherited
- disconnected ↔ VoidCallback
-
Parameter invoked on connection close.
getter/setter pair
- ecdh ↔ EllipticCurveDiffieHellman
-
getter/setter pairinherited
- encrypt ↔ BlockCipher
-
getter/setter pair
- encryptBlockSize ↔ int
-
getter/setter pair
- exH ↔ Uint8List
-
getter/setter pair
-
forwardingRemote
↔ HashMap<
int, Forward> -
getter/setter pair
-
forwardLocal
↔ List<
Forward> -
Parameter describing local ports to forward over SSH tunnel.
getter/setter pair
-
forwardRemote
↔ List<
Forward> -
Parameter describing remote ports to forward over SSH tunnel.
getter/setter pair
- guessedC ↔ bool
-
getter/setter pair
- guessedRightC ↔ bool
-
getter/setter pair
- guessedRightS ↔ bool
-
getter/setter pair
- guessedS ↔ bool
-
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- hostkeyType ↔ int
-
getter/setter pair
- hostport ↔ Uri
-
Remote endpoint of SSH connection. Parameter on client-side.
getter/setter pair
- identity ↔ Identity
-
Parameter for public key authentication
getter/setter pair
- initialWindowSize ↔ int
-
getter/setter pair
- integrityC2s ↔ Uint8List
-
getter/setter pair
- integrityS2c ↔ Uint8List
-
getter/setter pair
- K ↔ BigInt
-
getter/setter pairinherited
- kexHash ↔ Digest
-
getter/setter pairinherited
- kexInitC ↔ Uint8List
-
getter/setter pair
- kexInitS ↔ Uint8List
-
getter/setter pair
- kexMethod ↔ int
-
getter/setter pair
- macAlgoC2s ↔ HMac
-
getter/setter pair
- macAlgoS2c ↔ HMac
-
getter/setter pair
- macHashLenC ↔ int
-
getter/setter pair
- macHashLenS ↔ int
-
getter/setter pair
- macIdC2s ↔ int
-
getter/setter pair
- macIdS2c ↔ int
-
getter/setter pair
- macPrefixC2s ↔ int
-
getter/setter pair
- macPrefixS2c ↔ int
-
getter/setter pair
- maxPacketSize ↔ int
-
getter/setter pair
- nextChannelId ↔ int
-
getter/setter pair
- packetId ↔ int
-
getter/setter pair
- packetLen ↔ int
-
getter/setter pair
- packetMacLen ↔ int
-
getter/setter pair
- packetS ↔ SerializableInput
-
getter/setter pair
- padding ↔ int
-
getter/setter pair
- print ↔ StringCallback
-
Parameter invoked with ERROR and INFO loggging.
getter/setter pair
- random ↔ Random
-
Source of randomness, e.g Random.secure().
getter/setter pair
- readBuffer ↔ QueueBuffer
-
getter/setter pair
- remoteForward ↔ RemoteForwardCallback
-
Paramter invoked upon connection to forwarded remote port.
getter/setter pair
- response ↔ ResponseCallback
-
Parameter invoked with session channel data (and optionally UI prompts).
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- secureRandom ↔ SecureRandom
-
Pointycastle's random interface.
getter/setter pair
- sequenceNumberC2s ↔ int
-
getter/setter pair
- sequenceNumberS2c ↔ int
-
getter/setter pair
- server ↔ bool
-
getter/setter pair
- serverVersion ↔ num
-
getter/setter pair
- sessionChannel ↔ Channel
-
getter/setter pair
- sessionId ↔ Uint8List
-
getter/setter pair
- socket ↔ SocketInterface
-
getter/setter pair
- state ↔ int
-
getter/setter pair
- tracePrint ↔ StringCallback
-
Parameter invoked with trace logging.
getter/setter pair
- verC ↔ String
-
getter/setter pair
- verS ↔ String
-
getter/setter pair
- x25519dh ↔ X25519DiffieHellman
-
getter/setter pairinherited
- zreader ↔ dynamic
-
getter/setter pair
- zwriter ↔ dynamic
-
getter/setter pair
Methods
-
acceptChannel(
MSG_CHANNEL_OPEN msg) → Channel - Accepts MSG_CHANNEL_OPEN request to open a new Channel.
-
closeChannel(
Channel channel) → void -
Send EOF and close for
channel
. -
disconnect(
String reason) → void -
If anything goes wrong, disconnect with
reason
. -
getSecureRandom(
) → SecureRandom - PointyCastle random number generator interface.
-
handleChannelClose(
Channel chan, [String description]) → void -
handleChannelData(
Channel chan, Uint8List data) → void -
handleChannelOpenConfirmation(
Channel chan) → void -
handleConnected(
) → void - When the connection has been established, both sides MUST send an identification string. https://tools.ietf.org/html/rfc4253#section-4.2
-
handleInitialState(
) → void - Consumes the initial Protocol Version Exchange. https://tools.ietf.org/html/rfc4253#section-4.2
-
handleMSG_CHANNEL_CLOSE(
MSG_CHANNEL_CLOSE msg) → void - Upon receiving this message, a party MUST send back an SSH_MSG_CHANNEL_CLOSE unless it has already sent this message for the channel.
-
handleMSG_CHANNEL_DATA(
MSG_CHANNEL_DATA msg) → void - Data transfer is done with messages of the type SSH_MSG_CHANNEL_DATA.
-
handleMSG_CHANNEL_EOF(
MSG_CHANNEL_EOF msg) → void - No explicit response is sent to this message. However, the application may send EOF to whatever is at the other end of the channel.
-
handleMSG_CHANNEL_OPEN_CONFIRMATION(
MSG_CHANNEL_OPEN_CONFIRMATION msg) → void - If the remote side can open the channel, it responds with SSH_MSG_CHANNEL_OPEN_CONFIRMATION.
-
handleMSG_CHANNEL_OPEN_FAILURE(
MSG_CHANNEL_OPEN_FAILURE msg) → void - If the remote side can't open the channel, it responds with SSH_MSG_CHANNEL_OPEN_FAILURE.
-
handleMSG_CHANNEL_WINDOW_ADJUST(
MSG_CHANNEL_WINDOW_ADJUST msg) → void - After receiving this message, the recipient MAY send the given number of bytes more than it was previously allowed to send; the window size is incremented.
-
handleMSG_DEBUG(
MSG_DEBUG msg) → void - All implementations MUST understand MSG_DEBUG, but they are allowed to ignore it.
-
handleMSG_DISCONNECT(
MSG_DISCONNECT msg) → void - The recipient MUST NOT accept any data after receiving MSG_DISCONNECT.
-
handleMSG_GLOBAL_REQUEST(
MSG_GLOBAL_REQUEST msg) → void - https://tools.ietf.org/html/rfc4254#section-4
-
handleMSG_IGNORE(
MSG_IGNORE msg) → void - MSG_IGNORE can be used as an additional protection measure against advanced traffic analysis techniques.
-
handleMSG_KEXINIT(
MSG_KEXINIT msg, Uint8List packet) → void - https://tools.ietf.org/html/rfc4253#section-7.1
-
handleMSG_NEWKEYS(
) → void - When MSG_NEWKEYS is received, the new keys and algorithms MUST be used for receiving.
-
handlePacket(
Uint8List packet) → void -
handleRead(
Uint8List dataChunk) → void -
Callback supplied to
socket.listen
. -
initCipher(
int cipherId, Uint8List IV, Uint8List key, bool dir) → BlockCipher - Initializes the block cipher used for encrypted transport.
-
initializeDiffieHellman(
int kexMethod, Random random) → void -
inherited
-
initializeDiffieHellmanGroup(
BigInt p, BigInt g, Random random) → void -
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onConnected(
) → void -
Callback supplied to
socket.connect
. -
openTcpChannel(
String sourceHost, int sourcePort, String destHost, int destPort, ChannelCallback cb, {VoidCallback connected, StringCallback error}) → Channel -
Request remote opens a new TCP channel to
destHost
:destPort
. -
readCipher(
Uint8List m) → Uint8List - Decrypt data using the negotiated block cipher.
-
sendChannelData(
Uint8List b) → void -
sendDiffileHellmanInit(
) → void -
sendKeyExchangeInit(
bool guess) → void - Key exchange begins by each side sending SSH_MSG_KEXINIT.
-
sendNewKeys(
) → void -
sendToChannel(
Channel channel, Uint8List data) → void -
Sends
data
tochannel
. -
toString(
) → String -
A string representation of this object.
inherited
-
updateExchangeHash(
Uint8List kS) → void -
Computes a new exchange hash exH given the server key
kS
. -
writeCipher(
SSHMessage msg) → void - Encrypt Binary Packet data using the negotiated block cipher and MAC.
-
writeClearOrEncrypted(
SSHMessage msg) → void - Send a Binary Packet (e.g. KEX_INIT) that is initially sent in the clear, but encryped when keys are being renegotiated.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited