From bcb50a65aeaea6626e877a4d7180a6dc14ea203e Mon Sep 17 00:00:00 2001 From: "Dr. Maxim Orlovsky" Date: Tue, 21 Jul 2020 13:39:39 +0200 Subject: [PATCH] Fixing panic messages for decryption procedures --- lightning/src/ln/peer_channel_encryptor.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lightning/src/ln/peer_channel_encryptor.rs b/lightning/src/ln/peer_channel_encryptor.rs index 6965aac56..9f6797591 100644 --- a/lightning/src/ln/peer_channel_encryptor.rs +++ b/lightning/src/ln/peer_channel_encryptor.rs @@ -421,7 +421,7 @@ impl PeerChannelEncryptor { *rn += 1; Ok(byte_utils::slice_to_be16(&res)) }, - _ => panic!("Tried to encrypt a message prior to noise handshake completion"), + _ => panic!("Tried to decrypt a message prior to noise handshake completion"), } } @@ -429,7 +429,7 @@ impl PeerChannelEncryptor { /// panics if msg.len() > 65535 + 16 pub fn decrypt_message(&mut self, msg: &[u8]) -> Result, LightningError> { if msg.len() > LN_MAX_MSG_LEN + 16 { - panic!("Attempted to encrypt message longer than 65535 bytes!"); + panic!("Attempted to decrypt message longer than 65535 + 16 bytes!"); } match self.noise_state { @@ -441,7 +441,7 @@ impl PeerChannelEncryptor { Ok(res) }, - _ => panic!("Tried to encrypt a message prior to noise handshake completion"), + _ => panic!("Tried to decrypt a message prior to noise handshake completion"), } } -- 2.39.5