Skip to content

Commit

Permalink
Cleaner ServiceCipher::encrypt tracing
Browse files Browse the repository at this point in the history
  • Loading branch information
rubdos committed Jan 9, 2024
1 parent 036de0d commit 30bd647
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions libsignal-service/src/cipher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<OutgoingPushMessage, ServiceError> {
let session_record = self
Expand All @@ -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()?;

Expand Down

0 comments on commit 30bd647

Please sign in to comment.