pub struct EncryptedFileMeta {
pub megolm_session_id: String,
pub wrapped_key_b64: String,
pub nonce_b64: String,
pub content_hash: String,
pub content_mac_b64: Option<String>,
}Expand description
Metadata for an encrypted file transfer, carried in FileOffer. The
ChaCha20-Poly1305 file key is Megolm-wrapped (wrapped_key_b64); the
content_hash is bound as AEAD associated data.
Fields§
§megolm_session_id: String§wrapped_key_b64: String§nonce_b64: String§content_hash: StringSHA-256 of the plaintext, hex-encoded. Bound as AEAD associated data so the (key, nonce, ciphertext) triple can’t be replayed against different content, and verified after decryption.
huddle 2.2 (audit FILES-2): EMPTY when content_mac_b64 is set — the
plaintext hash is exactly the relay-visible confirmation oracle we’re
removing, so a v2 sender carries the keyed MAC instead and leaves this
blank. A legacy receiver (which requires this field) won’t be a
recipient: the sender only goes private when every member is capable.
content_mac_b64: Option<String>huddle 2.2 (audit FILES-2): base64 of HMAC-SHA256(HKDF(file_key, "huddle-file-mac-v2"), plaintext) — a keyed content commitment used
as AEAD associated data in place of content_hash. Only room members
(who hold the Megolm-wrapped file key) can compute it, so the relay no
longer learns SHA256(plaintext). #[serde(default, skip_serializing_if = "Option::is_none")] keeps pre-2.2 FileOffers byte-identical; when
None the legacy content_hash path applies.
Trait Implementations§
Source§impl Clone for EncryptedFileMeta
impl Clone for EncryptedFileMeta
Source§fn clone(&self) -> EncryptedFileMeta
fn clone(&self) -> EncryptedFileMeta
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for EncryptedFileMeta
impl Debug for EncryptedFileMeta
Source§impl<'de> Deserialize<'de> for EncryptedFileMeta
impl<'de> Deserialize<'de> for EncryptedFileMeta
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for EncryptedFileMeta
Source§impl PartialEq for EncryptedFileMeta
impl PartialEq for EncryptedFileMeta
Source§fn eq(&self, other: &EncryptedFileMeta) -> bool
fn eq(&self, other: &EncryptedFileMeta) -> bool
self and other values to be equal, and is used by ==.