Enum makiko::ClientEvent

source ·
#[non_exhaustive]
pub enum ClientEvent { ServerPubkey(Pubkey, AcceptPubkey), DebugMsg(DebugMsg), AuthBanner(AuthBanner), Tunnel(AcceptTunnel), Channel(AcceptChannel), }
Expand description

An event returned from ClientReceiver.

These are “global” events that are related to the SSH connection, not to a particular session/channel. You can safely ignore all events except ServerPubkey, which you must handle in order to accept or reject the server’s public key (if you don’t handle this event, the key will be rejected and we will abort the connection).

This enum is marked as #[non_exhaustive], so that we can add new variants without breaking backwards compatibility. It should always be safe to ignore any events that you don’t intend to handle.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

ServerPubkey(Pubkey, AcceptPubkey)

Server presented its public key and you should verify it.

This event is produced as part of the SSH key exchange. You will always receive this event during the initial handshake, but you may also receive it again later on, when the connection is “rekeyed”.

The SSH protocol does not provide any mechanism to verify the identity of the server, so it is up to you. Please read RFC 4251, section 4.1 for more details and suggestions on how to deal with this problem.

The Pubkey is the public key that the server provided as part of the key exchange. We have already verified that the server owns the private key. You should use the AcceptPubkey object to either .accept() or .reject() the key.

§

DebugMsg(DebugMsg)

Server sent us a debugging message.

This is the “debug message” (SSH_MSG_DEBUG) described in RFC 4253, section 11.3. You can simply ignore this event.

§

AuthBanner(AuthBanner)

Server sent a text that the user should see before authentication.

This is the “banner message” (SSH_MSG_USERAUTH_BANNER) described in RFC 4252, section 5.2. Citing from the RFC, this message “may be relevant for getting legal protection”. You can probably ignore this event.

§

Tunnel(AcceptTunnel)

Server attempts to open a tunnel.

You normally recieve this event when you have requested remote forwarding using Client::bind_tunnel() and somebody tries to connect to the address that you specified. You can use the AcceptTunnel object to inspect the connection attempt and accept or reject the tunnel.

§

Channel(AcceptChannel)

Server attempts to open a channel (low level API).

This is the SSH_MSG_CHANNEL_OPEN message described in RFC 4255, section 5.1. You can use the AcceptChannel object to get details about the message and accept or reject the channel.

Note that by default, some of these messages are translated to higher-level events (such as Tunnel). See ClientReceiver::specialize_channels() for a way to disable this behavior.

Trait Implementations§

source§

impl Debug for ClientEvent

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V