Skip to content

add openssl fips provider#17341

Closed
tobiasb-ms wants to merge 1 commit into
4.0from
tobiasb-ms/openssl-fips-provider
Closed

add openssl fips provider#17341
tobiasb-ms wants to merge 1 commit into
4.0from
tobiasb-ms/openssl-fips-provider

Conversation

@tobiasb-ms

Copy link
Copy Markdown
Contributor

This change adds the FIPS provider for openssl. Modeled after RHEL, it is built in a separate component -- openssl-fips-provider so we can pin it separately from the main openssl component. This is important because once certified, we will almost never want to rev openssl-fips-provider. openssl then takes a run-time dependency on openssl-fips-provider, so it should always have the FIPS provider available.

That said, openssl-fips-provider is still based on the same source -- the openssl upstream. It builds very similarly to openssl, but then instead of deleting the fips-related things it deletes everything else.

We diverged significantly from RHEL on how to implement the FIPS provider -- going way, way closer to an unmodified openssl version. Our patches are now almost all outside of the FIPS boundary, and we package it the way openssl wants it packaged -- with the HMAC in a config file rather than embedded.

I've build and run these locally and everything behaves the same as Fedora. I've also built on the build server.

@tobiasb-ms tobiasb-ms force-pushed the tobiasb-ms/openssl-fips-provider branch 2 times, most recently from e6c633a to eb27bf2 Compare June 11, 2026 22:26
Extract the FIPS provider module (fips.so) from the openssl package into
a new openssl-fips-provider package, using the upstream fipsinstall
approach for integrity verification instead of embedded HMAC.

== New package: openssl-fips-provider ==

Built from the same openssl source with enable-fips. Ships:
- /usr/lib64/ossl-modules/fips.so
- /etc/pki/tls/fipsmodule.cnf (generated by fipsinstall post-strip)
- /etc/pki/tls/openssl.d/openssl-fips-provider.cnf (drop-in config)

The drop-in registers the fips provider in [provider_sect] and includes
fipsmodule.cnf, making the provider loadable via 'openssl ... -provider
fips' without requiring kernel FIPS mode.

== Changes to openssl ==

- Remove enable-fips from ./Configure (fips.so no longer built here)
- Drop patch 0018 (re-enables fipsinstall subcommand)
- Replace patch 0019 with simplified version: kernel FIPS mode just
  activates fips+base providers and sets FIPS properties, relying on
  the drop-in for config rather than loading fips_local.cnf directly
- Replace patch 0037 with rebased version (context conflict with 0018
  removal in doc/man5/fips_config.pod)
- Remove fips_local.cnf (no longer needed; drop-in provides config)
- Remove %{SOURCE1} hmac-ify call in %check (no fips.so to process)
- Keep Requires: openssl-fips-provider on openssl-libs

All other FIPS patches remain — they modify libcrypto/libssl runtime
behavior for loading and activating an external FIPS provider.

== Patch differences between openssl and openssl-fips-provider ==

Both packages share the same upstream source and nearly all patches.
Differences:

Dropped from both:
- 0018 (FIPS-disable-fipsinstall): re-enable fipsinstall subcommand

Dropped only from openssl-fips-provider:
- 0020 (FIPS-INTEG-CHECK-Embed-hmac-in-fips.so): embedded HMAC
  integrity check, replaced by fipsinstall/fipsmodule.cnf approach
- 0022 (FIPS-INTEG-CHECK-Execute-KATS-before-HMAC): KAT reordering
  for embedded HMAC verification, irrelevant without 0020

These remain in openssl because the patched files (providers/fips/
self_test.c) exist in the source tree but are not compiled without
enable-fips — they are inert and removing them would add overlay
complexity for no functional benefit.

Rebased in both:
- 0019 (FIPS-Force-fips-provider-on): simplified to just activate
  providers in kernel FIPS mode, drop fips_local.cnf loading
- 0037 (FIPS-TLS-Enforce-EMS): rebased fips_config.pod hunk against
  full upstream file (old version depended on 0018's gutting)

== Config model ==

- openssl.d drop-in: makes provider loadable (registers fips_sect,
  includes MAC data from fipsmodule.cnf)
- Patch 0019: auto-activates fips+base in kernel FIPS mode
- Crypto-policies: NOT included in drop-in (activation via
  update-crypto-policies is a separate concern)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@tobiasb-ms tobiasb-ms force-pushed the tobiasb-ms/openssl-fips-provider branch from eb27bf2 to 1f28794 Compare June 11, 2026 22:27
@tobiasb-ms tobiasb-ms closed this Jun 11, 2026
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.

1 participant