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

swtpm: Disable OpenSSL FIPS mode to avoid libtpms failures #704

Merged
merged 1 commit into from Jun 16, 2022

Conversation

stefanberger
Copy link
Owner

While libtpms does not provide any means to disable FIPS-disabled crypto
algorithms from being used, work around the issue by simply disabling the
FIPS mode of OpenSSL if it is enabled. If it cannot be disabled, exit
swtpm with a failure message that it cannot be disabled. If FIPS mode
was successfully disabled, print out a message as well.

Signed-off-by: Stefan Berger stefanb@linux.ibm.com

@stefanberger stefanberger self-assigned this Jun 8, 2022
@stefanberger
Copy link
Owner Author

@elmarco This is the solution for now to run swtpm on FIPS-enabled machines.

@coveralls
Copy link

coveralls commented Jun 8, 2022

Pull Request Test Coverage Report for Build 3897

  • 8 of 14 (57.14%) changed or added relevant lines in 4 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.03%) to 74.811%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/swtpm/fips.c 5 11 45.45%
Totals Coverage Status
Change from base Build 3884: -0.03%
Covered Lines: 6145
Relevant Lines: 8214

💛 - Coveralls

src/swtpm/utils.c Outdated Show resolved Hide resolved
@stefanberger stefanberger force-pushed the stefanberger/disable_fips_mode branch 4 times, most recently from 2ba4d24 to 3f17b23 Compare June 8, 2022 15:48
@stefanberger stefanberger marked this pull request as ready for review June 8, 2022 15:58
@stefanberger
Copy link
Owner Author

This should now be in a shape where this can be merged and should resolve the issue on the platform where the error was reported.

@stefanberger stefanberger force-pushed the stefanberger/disable_fips_mode branch from 3f17b23 to 12c1bfa Compare June 8, 2022 18:36
@berrange
Copy link

berrange commented Jun 9, 2022

Obviously this change would prevent the vTPM actually being used with/included in any government certification programs for virt hosts that require FIPS, but as a short term workaround to at least get the VMs booting, the code looks OK.

@stefanberger
Copy link
Owner Author

Obviously this change would prevent the vTPM actually being used with/included in any government certification programs for virt hosts that require FIPS, but as a short term workaround to at least get the VMs booting, the code looks OK.

So this patch works in the scenario described in the bugzilla?

@berrange
Copy link

berrange commented Jun 9, 2022

So this patch works in the scenario described in the bugzilla?

I can't claim to have tested it myself, nor in fact even used FIPS, but conceptually I believe it should address the immediate problem.

While libtpms does not provide any means to disable FIPS-disabled crypto
algorithms from being used, work around the issue by simply disabling the
FIPS mode of OpenSSL if it is enabled. If it cannot be disabled, exit
swtpm with a failure message that it cannot be disabled. If FIPS mode
was successfully disabled, print out a message as well.

Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=2090219
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
@stefanberger stefanberger force-pushed the stefanberger/disable_fips_mode branch from 12c1bfa to 5d95d9c Compare June 13, 2022 14:25
@stefanberger stefanberger merged commit a39c379 into master Jun 16, 2022
1 check passed
@stefanberger stefanberger deleted the stefanberger/disable_fips_mode branch June 16, 2022 11:36
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