Function network_clique::protocols::handshake::execute_v0_handshake_incoming
source · pub async fn execute_v0_handshake_incoming<SK: SecretKey, S: Splittable>(
stream: S,
secret_key: SK
) -> Result<(S::Sender, S::Receiver, SK::PublicKey), HandshakeError<SK::PublicKey>>
Expand description
Performs the handshake with a peer that called us. The goal is to obtain the public key of the peer, and split the communication stream into two halves. The peer needs to prove their identity by signing a randomly generated challenge, but apart from that, the returned communication channels will NOT be secured in any way. We assume that if the channel is compromised after the handshake, the peer will establish another connection, which will replace the current one.