From 30bd647eb0090fd683125376339f15950af244e7 Mon Sep 17 00:00:00 2001 From: Ruben De Smet Date: Tue, 9 Jan 2024 17:10:42 +0100 Subject: [PATCH] Cleaner ServiceCipher::encrypt tracing --- libsignal-service/src/cipher.rs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/libsignal-service/src/cipher.rs b/libsignal-service/src/cipher.rs index 0922253de..6af9f11db 100644 --- a/libsignal-service/src/cipher.rs +++ b/libsignal-service/src/cipher.rs @@ -319,11 +319,18 @@ where Ok(plaintext) } - #[tracing::instrument] + #[tracing::instrument( + skip(address, unidentified_access, content), + fields( + address = %address, + with_unidentified_access = unidentified_access.is_some(), + content_length = content.len(), + ) + )] pub(crate) async fn encrypt( &mut self, address: &ProtocolAddress, - unindentified_access: Option<&SenderCertificate>, + unidentified_access: Option<&SenderCertificate>, content: &[u8], ) -> Result { let session_record = self @@ -337,7 +344,7 @@ where let padded_content = add_padding(session_record.session_version()?, content)?; - if let Some(unindentified_access) = unindentified_access { + if let Some(unindentified_access) = unidentified_access { let destination_registration_id = session_record.remote_registration_id()?;