Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Take into account the OpenSSL FIPS mode when setting GODEBUG=fips140 #1519

Merged
merged 6 commits into from
Feb 4, 2025

Conversation

qmuntal
Copy link
Member

@qmuntal qmuntal commented Jan 31, 2025

As agreed in https://github.com/microsoft/go-lab/blob/main/docs/adr/0012-remove-gofips.md, we should set GODEBUG=fips140=on if OpenSSL is in FIPS mode. We are currently only taking into account the kernel FIPS mode (aka /proc/sys/crypto/fips_enabled).

This PR adds the missing check. I had to factor the OpenSSL init logic into its own package, crypto/internal/backend/internal/opensslsetup, so that it can be used in crypto/internal/backend/fips140 without creating a dependency cycle.

I've also added some much needed tests to the OpenSSL library selection logic and improved the TestDependencies script to reduce the chance of upstream conflicts.

For #1445.

@qmuntal qmuntal enabled auto-merge (squash) February 4, 2025 07:06
@qmuntal qmuntal merged commit 32ecffa into microsoft/main Feb 4, 2025
35 checks passed
@qmuntal qmuntal deleted the dev/qmuntal/osslfips2 branch February 4, 2025 08:58
qmuntal added a commit that referenced this pull request Feb 7, 2025
…1519)

* check OpenSSL config

* add tests

* simplify deps

* fix bootstrap

* fix compilation

* review suggestions
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.

None yet

3 participants