pub enum HandshakeAuthMode {
    Mutual {
        anti_replay_timestamps: RwLock<AntiReplayTimestamps>,
        trusted_peers: Arc<RwLock<PeerSet>>,
    },
    MaybeMutual(Arc<RwLock<PeerSet>>),
}
Expand description

Noise handshake authentication mode.

Variants

Mutual

Fields

anti_replay_timestamps: RwLock<AntiReplayTimestamps>
trusted_peers: Arc<RwLock<PeerSet>>

In Mutual mode, both sides will authenticate each other with their trusted_peers set. We also include replay attack mitigation in this mode.

For example, in the Aptos validator network, validator peers will only allow connections from other validator peers. They will use this mode to check that inbound connections authenticate to a network public key actually contained in the current validator set.

MaybeMutual(Arc<RwLock<PeerSet>>)

In MaybeMutual mode, the dialer authenticates the server and the server will allow all inbound connections from any peer but will mark connections as Trusted if the incoming connection is apart of its trusted peers set.

Implementations

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

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

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

Should always be Self

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more