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.