pub enum Handshake {
Show 16 variants
N,
K,
X,
Npsk0,
Kpsk0,
Xpsk1,
NN,
KK,
XX,
IK,
IX,
NK,
NX,
XK1,
KK1,
NNpsk2,
}Expand description
The handshake patterns we support for now
Variants§
N
One-way, no static key for initiator
K
One-way, static key for initiator known to responder
X
One-way, static key for initiator is transmitted to responder
Npsk0
One-way, no static key for initiator, pre-shared key (i.e. passphrase, biometric, etc)
Kpsk0
One-way, static key for initiator known to responder, pre-shared key (i.e. passphrase, biometric, etc)
Xpsk1
One-way, static key for initiator is transmitted to responder, pre-shared key (i.e. passphrase, biometric, etc)
NN
No static keys for either the initiator or responder
KK
Both sides know each other’s static public keys
XX
Both sides transmit their keys
IK
Initiator transmits their static public key immediately
IX
Initiator transmits their ephemeral and static public key immediately
NK
No static key for the initiator, reponder key known
NX
No static key for the initiator, responder transmits key
XK1
Initiator transmits key and knows responders key, deferred
KK1
Initiator and responder know each other’s keys, deferred
NNpsk2
Initiator and responder know a pre-shared key
Implementations§
Source§impl Handshake
impl Handshake
Sourcepub fn get_pattern(&self, role: &ChannelRole) -> &[HandshakeOp]
pub fn get_pattern(&self, role: &ChannelRole) -> &[HandshakeOp]
Return the appropriate HandshakeState
Sourcepub fn needs_local_static_key(&self, role: &ChannelRole) -> bool
pub fn needs_local_static_key(&self, role: &ChannelRole) -> bool
True if handshake pattern requires local static key
Sourcepub fn needs_remote_static_key(&self, role: &ChannelRole) -> bool
pub fn needs_remote_static_key(&self, role: &ChannelRole) -> bool
True if handshake pattern requires remote static public key before the handshake
Sourcepub fn mix_local_static_key(&self, role: &ChannelRole) -> bool
pub fn mix_local_static_key(&self, role: &ChannelRole) -> bool
True if the handshake pattern and my role requires me to mix my static pub key
Sourcepub fn mix_remote_static_key(&self, role: &ChannelRole) -> bool
pub fn mix_remote_static_key(&self, role: &ChannelRole) -> bool
True if the handshake pattern and my role requires me to mix the remote static pub key
True if the handshake pattern requires a pre-shared key before the handshake
Sourcepub fn local_dh_is_deferred(&self, role: &ChannelRole) -> bool
pub fn local_dh_is_deferred(&self, role: &ChannelRole) -> bool
True if handshake pattern defers the local DH operation
Sourcepub fn remote_dh_is_deferred(&self, role: &ChannelRole) -> bool
pub fn remote_dh_is_deferred(&self, role: &ChannelRole) -> bool
True if handshake pattern defers the remote DH operation