]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MEDIUM: ssl: add fips_mode() config condition predicate
authorWilliam Lallemand <wlallemand@haproxy.com>
Thu, 13 Aug 2026 09:28:05 +0000 (09:28 +0000)
committerWilliam Lallemand <wlallemand@haproxy.com>
Thu, 13 Aug 2026 14:08:06 +0000 (16:08 +0200)
commit3a853db582eefdb09941da24cf1acd09e2dd512e
tree03f8c4f2700d379da867ef4b9fb7ee99bf5868cd
parent40c627282d800f8686ad6a57baa2707aa3d59ca0
MEDIUM: ssl: add fips_mode() config condition predicate

Add a new "fips_mode()" predicate usable in .if/.elif configuration
conditional blocks and with the "-cc" command line option. It
evaluates to true when the loaded SSL library is currently running in
FIPS mode.

The check relies on a new openssl_fips_mode() helper in tools.c,
following the same pattern as openssl_compare_current_version() and
awslc_compare_current_api(). Two APIs are used depending on the SSL
library:

  - FIPS_mode(), implemented by OpenSSL 1.0.x/1.1.x (including
    FIPS-validated builds) and by compatible libraries such as AWS-LC.

  - EVP_default_properties_is_fips_enabled(), for OpenSSL 3.0 and
    above, where FIPS_mode() was removed in favor of a provider-based
    FIPS model. It reports whether the default library context
    currently resolves algorithm fetches to the FIPS provider, which
    is the closest 3.x equivalent.

The predicate is a no-op (always false) with any other SSL library, or
when built without SSL support.

This lets configurations, and reg-tests in particular, detect and
adapt to (or skip) TLS constructs that are rejected by HAProxy's own
FIPS compliance checks (src/fips.c) when FIPS mode is active, e.g.
non-ECDHE TLS 1.2 cipher suites.
doc/configuration.txt
include/haproxy/cfgcond-t.h
include/haproxy/tools.h
src/cfgcond.c
src/tools.c