From: Dr. Maxim Orlovsky Date: Tue, 21 Jul 2020 11:39:39 +0000 (+0200) Subject: Fixing panic messages for decryption procedures X-Git-Tag: v0.0.12~49^2~4 X-Git-Url: http://git.bitcoin.ninja/?a=commitdiff_plain;h=bcb50a65aeaea6626e877a4d7180a6dc14ea203e;p=rust-lightning Fixing panic messages for decryption procedures --- 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"), } }