diff --git a/src/cloud.rs b/src/cloud.rs index 35aa29a..053eede 100644 --- a/src/cloud.rs +++ b/src/cloud.rs @@ -353,7 +353,7 @@ impl GenericCloud GenericCloud { + self.pending_inits.insert(src, init); + Ok(res) + } + Err(err) => { + warn!("Error in init message from peer {}: {}", addr_nice(src), err); + return Ok(()) + } } - msg_result } else if let Some(peer) = self.peers.get_mut(&src) { peer.crypto.handle_message(data) } else { - error!("Received non-init message from unknown peer {}", addr_nice(src)); + info!("Ignoring non-init message from unknown peer {}", addr_nice(src)); return Ok(()) }; match msg_result { @@ -737,10 +743,12 @@ impl GenericCloud(key: &mut CryptoKey, nonce: Nonce, data_and_tag: &'a mut [u8]) -> Result<(), Error> { + fn decrypt_with_key(key: &mut CryptoKey, nonce: Nonce, data_and_tag: &mut [u8]) -> Result<(), Error> { if nonce < key.min_nonce { return Err(Error::Crypto("Old nonce rejected")) }