-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[fips140][configtls.TestTPM_loadCertificate] Skip test if GODEBUG=fips140=only is set
#14225
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
Conversation
CodSpeed Performance ReportMerging #14225 will not alter performanceComparing
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #14225 +/- ##
==========================================
- Coverage 92.15% 92.11% -0.04%
==========================================
Files 667 667
Lines 41446 41446
==========================================
- Hits 38194 38179 -15
- Misses 2215 2225 +10
- Partials 1037 1042 +5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
a9f386e
…DEBUG=fips140=only` is set (#14255) <!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> #### Description In #14225, we skipped the `configtls.TestTPM_loadCertificate` unit test if the tests were run with `GODEBUG=fips140=only`. Otherwise, the unit test failed with a `panic: crypto/cipher: use of CFB is not allowed in FIPS 140-only mode` error. Turns out there was a second unit test in the same package that needed skipping for the same reason: `configtls.TestTPM_tpmCertificate_errors`. This PR skips it too. <!-- Issue number if applicable --> #### Link to tracking issue Follow up to #14225
…DEBUG=fips140=only` is set (open-telemetry#14255) <!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> #### Description In open-telemetry#14225, we skipped the `configtls.TestTPM_loadCertificate` unit test if the tests were run with `GODEBUG=fips140=only`. Otherwise, the unit test failed with a `panic: crypto/cipher: use of CFB is not allowed in FIPS 140-only mode` error. Turns out there was a second unit test in the same package that needed skipping for the same reason: `configtls.TestTPM_tpmCertificate_errors`. This PR skips it too. <!-- Issue number if applicable --> #### Link to tracking issue Follow up to open-telemetry#14225
…DEBUG=fips140=only` is set (open-telemetry#14255) <!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> #### Description In open-telemetry#14225, we skipped the `configtls.TestTPM_loadCertificate` unit test if the tests were run with `GODEBUG=fips140=only`. Otherwise, the unit test failed with a `panic: crypto/cipher: use of CFB is not allowed in FIPS 140-only mode` error. Turns out there was a second unit test in the same package that needed skipping for the same reason: `configtls.TestTPM_tpmCertificate_errors`. This PR skips it too. <!-- Issue number if applicable --> #### Link to tracking issue Follow up to open-telemetry#14225
Description
When #13926 is merged, all unit tests in this repository will be run with
GODEBUG=fips140=onlyto help surface any FIPS-140 violations in all the Go modules in this repository.One such unit test that fails in these circumstances is
config/configtls.TestTPM_loadCertificate. However, the FIPS violation surfaced by this test is from the test code itself (as opposed to from OpenTelemetry Collector core code that the test is exercising), specifically when this call is made:opentelemetry-collector/config/configtls/tpm_test.go
Line 191 in 974da01
As such, this is not a FIPS violation we need to worry about when running the OpenTelemetry Collector. To prevent the unit test from failing when it's run with
GODEBUG=fips140=only, we skip it.Link to tracking issue
Fixes #13989
Testing
Run the
configtls.TestTPM_loadCertificateunit test withGODEBUG=fips140=only. Make sure OS is Linux and Go version is >= 1.24.6.