Skip to content

fix unknown checksum handling#633

Merged
DmitriyMusatkin merged 11 commits into
mainfrom
unknown_checksum
May 14, 2026
Merged

fix unknown checksum handling#633
DmitriyMusatkin merged 11 commits into
mainfrom
unknown_checksum

Conversation

@DmitriyMusatkin
Copy link
Copy Markdown
Contributor

@DmitriyMusatkin DmitriyMusatkin commented May 14, 2026

Issue #, if available:

Description of changes:
Before this pr sending default request with a body that had any header starting with "x-amz-checksum-" that was not a valid checksum would fail with a generic error about failing to asign the body. Ex. completeMPU call going through default that had a body and x-amz-checksum-type header. Note: this is manual call to completeMPU though default meta request and usual flow is not affected.

2 changes made in this pr to mitigate the issue:

  • dont treat headers like x-amz-checksum-type, x-amz-checksum-mode and x-amz-checksum-algorithm and unknown checksum type
  • narrow down the cases where checksum is recomputed for default case. i.e. if req does not need checksum and there is no verification callback then do not compute it. checksum is never recomputed for completeMPU.

Note: there is still a weird case that if checksum is provided for default with body and there is a verification callback, then we recompute checksum. on one side it makes sense to recompute on the other it does not. so leaving as is for now

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Comment thread source/s3_checksum_context.c Outdated
Comment thread tests/s3_util_tests.c
Copy link
Copy Markdown
Contributor

@TingDaoK TingDaoK left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@codecov-commenter
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.98%. Comparing base (10be224) to head (6f63ac3).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #633      +/-   ##
==========================================
+ Coverage   88.96%   88.98%   +0.01%     
==========================================
  Files          23       23              
  Lines        7759     7769      +10     
==========================================
+ Hits         6903     6913      +10     
  Misses        856      856              
Files with missing lines Coverage Δ
source/s3_auto_ranged_put.c 91.14% <100.00%> (+0.02%) ⬆️
source/s3_checksum_context.c 88.37% <100.00%> (+0.13%) ⬆️
source/s3_checksums.c 83.95% <100.00%> (ø)
source/s3_default_meta_request.c 94.31% <100.00%> (+0.06%) ⬆️
source/s3_request_messages.c 72.67% <100.00%> (ø)
source/s3_util.c 95.21% <100.00%> (+0.06%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@DmitriyMusatkin DmitriyMusatkin merged commit f1a52b5 into main May 14, 2026
39 checks passed
@DmitriyMusatkin DmitriyMusatkin deleted the unknown_checksum branch May 14, 2026 23:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants