fn send_client_authentication<T,U>(&mut self, mut buf: T) -> Result<(usize, ConnectionState), OssuaryError>
    where T: std::ops::DerefMut<Target = U>,
          U: std::io::Write {
        let sig = self.sign_remote_challenge();
        // Get session encryption key, which must be known by now.
        let server_public = self.local_auth.public_key.unwrap_or_default();
        let session = self.local_key.session.as_ref().map(|s| s.as_bytes()).unwrap_or(&[0u8; KEY_LEN]);
        let pkt = ClientAuthenticationPacket::new(&self.local_key.nonce,
                                                  session,
                                                  server_public.as_bytes(),
                                                  &sig)?;
        let w = write_packet(self, buf.deref_mut(), struct_as_slice(&pkt),
                             PacketType::ClientAuthentication)?;
        increment_nonce(&mut self.local_key.nonce);
        let state = ConnectionState::Encrypted;
        Ok((w, state))
    }
/// Ready to send a client authentication packet
Ready to send a client authentication packet
Ready to send a client authentication packet
fn send_client_authentication<T,U>(&mut self, mut buf: T) -> Result<(usize, ConnectionState), OssuaryError>
    where T: std::ops::DerefMut<Target = U>,
          U: std::io::Write {
        let sig = self.sign_remote_challenge();
        // Get session encryption key, which must be known by now.
        let server_public = self.local_auth.public_key.unwrap_or_default();
        let session = self.local_key.session.as_ref().map(|s| s.as_bytes()).unwrap_or(&[0u8; KEY_LEN]);
        let pkt = ClientAuthenticationPacket::new(&self.local_key.nonce,
                                                  session,
                                                  server_public.as_bytes(),
                                                  &sig)?;
        let w = write_packet(self, buf.deref_mut(), struct_as_slice(&pkt),
                             PacketType::ClientAuthentication)?;
        increment_nonce(&mut self.local_key.nonce);
        let state = ConnectionState::Encrypted;
        Ok((w, state))
    }
fn send_client_authentication < T , U > ( & mut self , mut buf : T ) -> Result < ( usize , ConnectionState ) , OssuaryError > where T : std :: ops :: DerefMut < Target = U > , U : std :: io :: Write { let sig = self . sign_remote_challenge ( ) ; // Get session encryption key, which must be known by now. let server_public = self . local_auth . public_key . unwrap_or_default ( ) ; let session = self . local_key . session . as_ref ( ) . map ( | s | s . as_bytes ( ) ) . unwrap_or ( & [ 0u8 ; KEY_LEN ] ) ; let pkt = ClientAuthenticationPacket :: new ( & self . local_key . nonce , session , server_public . as_bytes ( ) , & sig ) ? ; let w = write_packet ( self , buf . deref_mut ( ) , struct_as_slice ( & pkt ) , PacketType :: ClientAuthentication ) ? ; increment_nonce ( & mut self . local_key . nonce ) ; let state = ConnectionState :: Encrypted ; Ok ( ( w , state ) ) }
Ready to send a client authentication packet
Ready to send a client authentication packet
&mut self
buf
T
&mut self
buf
T