Skip to content

Reduce crypto/internal/backend/fips140 API surface#2343

Merged
qmuntal merged 3 commits into
microsoft/mainfrom
dev/qmuntal/slimfips140
Jun 3, 2026
Merged

Reduce crypto/internal/backend/fips140 API surface#2343
qmuntal merged 3 commits into
microsoft/mainfrom
dev/qmuntal/slimfips140

Conversation

@qmuntal
Copy link
Copy Markdown
Member

@qmuntal qmuntal commented Jun 3, 2026

crypto/internal/backend/fips140 is intended to be used from upstream crypto packages, but there are some APIs that are specific to crypto/internal/backend, which is not part of upstream.

Moving these API to unexported crypto/internal/backend APIs will make future refactors easier.

@qmuntal qmuntal requested a review from a team as a code owner June 3, 2026 09:05
Copilot AI review requested due to automatic review settings June 3, 2026 09:05
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors the crypto/internal/backend/fips140 integration to reduce backend-specific surface area by moving FIPS validation logic into crypto/internal/backend (via a new unexported checkFIPS helper) and updating backend implementations to use it.

Changes:

  • Adds crypto/internal/backend/checkFIPS and rewires backend init-time FIPS validation to call it instead of fips140.Check.
  • Moves requirefips / ms_skipfipscheck build-tag plumbing from crypto/internal/backend/fips140 into crypto/internal/backend.
  • Adjusts crypto/internal/backend/fips140 to expose state needed by checkFIPS (Message, Require) and removes the previous Check API.
Show a summary per file
File Description
patches/0002-Add-crypto-backends.patch Updates the crypto-backends patch to relocate FIPS-checking logic into crypto/internal/backend and revise the fips140 package API accordingly.

Copilot's findings

  • Files reviewed: 1/1 changed files
  • Comments generated: 3

Comment thread patches/0002-Add-crypto-backends.patch Outdated
Comment thread patches/0002-Add-crypto-backends.patch Outdated
Comment thread patches/0002-Add-crypto-backends.patch
@qmuntal qmuntal enabled auto-merge June 3, 2026 12:32
@qmuntal qmuntal merged commit c6ca7d0 into microsoft/main Jun 3, 2026
54 checks passed
@qmuntal qmuntal deleted the dev/qmuntal/slimfips140 branch June 3, 2026 14:08
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