Fix Content-MD5 in FIPS environments#48241
Open
JensWehner wants to merge 1 commit into
Open
Conversation
JensWehner
requested review from
jalauzon-msft,
vincenttran-msft and
weirongw23-msft
as code owners
July 24, 2026 13:35
Contributor
|
Thank you for your contribution @JensWehner! We will review the pull request and get back to you soon. |
|
Azure Pipelines: Successfully started running 1 pipeline(s). 8 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
There was a problem hiding this comment.
Pull request overview
Updates Blob Content-MD5 calculation for FIPS environments and adds regression coverage.
Changes:
- Marks MD5 as non-security usage.
- Adds a FIPS-policy regression test.
- Sibling Storage packages remain unaddressed.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
tests/test_content_validation.py |
Tests non-security MD5 usage. |
_shared/validation.py |
Passes usedforsecurity=False to MD5. |
|
|
||
| def calculate_content_md5(data: Union[bytes, IO[bytes]]) -> bytes: | ||
| md5 = hashlib.md5() # nosec | ||
| md5 = hashlib.md5(usedforsecurity=False) # nosec |
Member
|
@JensWehner, thanks for the contribution! We are good to take this change but please address the comment from Copilot and bring this change to all four of our base packages. While it may not be used in all packages, we like to keep the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Content-MD5useshashlib.md5()and fails under FIPS policy. Mark the protocol checksum as non-security use and add a regression test.