fix: remove authentication tag bytes from attachment download
Signed-off-by: ElfFlu <228066338+ElfFlu@users.noreply.github.com>
This commit is contained in:
@@ -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)
|
.decrypt_in_place(nonce, b"", &mut buf)
|
||||||
.map_err(|_| create_error!(InternalError))?;
|
.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)
|
Ok(buf)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user