Skip to content

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

Merged
qmuntal merged 6 commits intomicrosoft/mainfrom
dev/qmuntal/osslfips2
Feb 4, 2025
Merged

Take into account the OpenSSL FIPS mode when setting GODEBUG=fips140#1519
qmuntal merged 6 commits intomicrosoft/mainfrom
dev/qmuntal/osslfips2

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 requested review from a user, dagood, gdams and mertakman January 31, 2025 10:36
@qmuntal qmuntal requested a review from a team as a code owner January 31, 2025 10:37
@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.

3 participants