From 0e9abcd69eedb4080f74e0631ca3cf065cf6553e Mon Sep 17 00:00:00 2001 From: Marco Herrera-Rendon Date: Fri, 8 Nov 2024 15:44:51 -0700 Subject: [PATCH] check sign_payload instead of skip_signature before computing checksum (#6698) * check sign_payload instead of skip_signature before computing checksum * Update object_store/src/aws/client.rs Co-authored-by: Raphael Taylor-Davies <1781103+tustvold@users.noreply.github.com> * fix format --------- Co-authored-by: Raphael Taylor-Davies <1781103+tustvold@users.noreply.github.com> --- object_store/src/aws/client.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/object_store/src/aws/client.rs b/object_store/src/aws/client.rs index a610e635178d..895308f5880e 100644 --- a/object_store/src/aws/client.rs +++ b/object_store/src/aws/client.rs @@ -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();