Skip to content

Fix Content-MD5 in FIPS environments#48241

Open
JensWehner wants to merge 1 commit into
Azure:mainfrom
JensWehner:fix/storage-fips-content-md5
Open

Fix Content-MD5 in FIPS environments#48241
JensWehner wants to merge 1 commit into
Azure:mainfrom
JensWehner:fix/storage-fips-content-md5

Conversation

@JensWehner

Copy link
Copy Markdown

Content-MD5 uses hashlib.md5() and fails under FIPS policy. Mark the protocol checksum as non-security use and add a regression test.

Copilot AI review requested due to automatic review settings July 24, 2026 13:35
@github-actions github-actions Bot added Community Contribution Community members are working on the issue customer-reported Issues that are reported by GitHub users external to the Azure organization. Storage Storage Service (Queues, Blobs, Files) labels Jul 24, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Thank you for your contribution @JensWehner! We will review the pull request and get back to you soon.

@azure-pipelines

Copy link
Copy Markdown
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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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
@jalauzon-msft

Copy link
Copy Markdown
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 _shared folder in sync across all packages. You do not need to port the test to other packages if you do not want though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Community Contribution Community members are working on the issue customer-reported Issues that are reported by GitHub users external to the Azure organization. Storage Storage Service (Queues, Blobs, Files)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants