Skip to content

Commit

Permalink
check sign_payload instead of skip_signature before computing checksum (
Browse files Browse the repository at this point in the history
#6698)

* check sign_payload instead of skip_signature before computing checksum

* Update object_store/src/aws/client.rs

Co-authored-by: Raphael Taylor-Davies <[email protected]>

* fix format

---------

Co-authored-by: Raphael Taylor-Davies <[email protected]>
  • Loading branch information
mherrerarendon and tustvold authored Nov 8, 2024
1 parent a2a80ca commit 0e9abcd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion object_store/src/aws/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,9 @@ impl<'a> Request<'a> {
}

pub(crate) fn with_payload(mut self, payload: PutPayload) -> Self {
if !self.config.skip_signature || self.config.checksum.is_some() {
if (!self.config.skip_signature && self.config.sign_payload)
|| self.config.checksum.is_some()
{
let mut sha256 = Context::new(&digest::SHA256);
payload.iter().for_each(|x| sha256.update(x));
let payload_sha256 = sha256.finish();
Expand Down

0 comments on commit 0e9abcd

Please sign in to comment.