Skip to content

Commit c813933

Browse files
committed
doc: add note about PNI signature sidecars
1 parent a880828 commit c813933

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

src/cipher.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,18 @@ where
9090
/// Opens ("decrypts") an envelope.
9191
///
9292
/// Envelopes may be empty, in which case this method returns `Ok(None)`
93+
///
94+
/// # PNI signature side-cars
95+
///
96+
/// A side-car is verified during decryption and, when valid, its
97+
/// PNI is exposed as `Metadata::pni_verified`. A side-car on a message with
98+
/// no `content` is discarded, with a `tracing::warn!`; upstream Signal
99+
/// clients only ever attach a side-car alongside `content`, so this path is
100+
/// unreachable in practice, and wiring it through would change this method's
101+
/// return type.
102+
///
103+
/// **NOTE**: must process `Metadata::pni_verified` to confirm the sender's
104+
/// PNI, not the raw side-car message.
93105
#[tracing::instrument(skip(envelope, csprng), fields(envelope = debug_envelope(&envelope)))]
94106
pub async fn open_envelope<R: Rng + CryptoRng>(
95107
&mut self,

0 commit comments

Comments
 (0)