fix: remove authentication tag bytes from attachment download

Signed-off-by: ElfFlu <228066338+ElfFlu@users.noreply.github.com>
This commit is contained in:
ElfFlu
2025-08-23 19:05:32 +02:00
parent 5335124306
commit 32e6600272

View File

@@ -80,6 +80,9 @@ pub async fn fetch_from_s3(bucket_id: &str, path: &str, nonce: &str) -> Result<V
.decrypt_in_place(nonce, b"", &mut buf)
.map_err(|_| create_error!(InternalError))?;
// Remove the authentication tag bytes that were added during encryption
buf.truncate(buf.len() - AUTHENTICATION_TAG_SIZE_BYTES);
Ok(buf)
}