Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
+++ This bug was initially created as a clone of Bug #2083876 +++
Description of problem:
The new FIPS_mode() macros expands to EVP_default_properties_is_fips_enabled() which has a declaration in a different header file. This causes clang to emit the -Wimplicit-function-declaration warning when compiling applications that use the macro.
Version-Release number of selected component (if applicable):
openssl-3.0.2-5.fc36
How reproducible:
Always
Steps to Reproduce:
$ dnf install clang openssl-devel
$ cat fips-clang.c
#include <stdio.h>
#include <openssl/fips.h>
int main(int argc, char **argv) {
if (FIPS_mode())
printf("FIPS mode enabled\n");
return 0;
}
$ clang -Werror clang-fips.c
clang-fips.c:5:7: error: implicit declaration of function 'EVP_default_properties_is_fips_enabled' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
if (FIPS_mode())
^
/usr/include/openssl/fips.h:20:22: note: expanded from macro 'FIPS_mode'
# define FIPS_mode() EVP_default_properties_is_fips_enabled(NULL)
^
1 error generated.
Expected results:
Program compiles successfully.
Comment 7Stephen Gallagher
2022-12-02 15:53:17 UTC
There's one other place that should be fixed for compatibility: previously, the <openssl/crypto.h> header included <openssl/fips.h>. Packages that were (perhaps unknowingly) relying on this implicit behavior are now broken. (For example, my sscg package compiled fine on 3.0.5 and fails with `../src/dhparams.c:234:8: error: implicit declaration of function ‘FIPS_mode’ [-Werror=implicit-function-declaration]` on 3.0.7.
Comment 8Dmitry Belyavskiy
2022-12-02 15:59:29 UTC
Unfortunately, including <openssl/fips.h> into the <openssl/crypto.h> seems to be a mistake. It causes a circular dependency: we need to include <openssl/evp.h> before <openssl/fips.h>, but evp.h requires some definitions from crypto.h
Yeah, IMO, given the <openssl/fips.h> is Red Hat specific thing, it is better to bite the bullet and explicitly include it in applications code instead of depending on it being implicitly included from some other upstream header file.
Comment 11Stephen Gallagher
2022-12-07 20:06:31 UTC
(In reply to Stephen Gallagher from comment #7)
> There's one other place that should be fixed for compatibility: previously,
> the <openssl/crypto.h> header included <openssl/fips.h>. Packages that were
> (perhaps unknowingly) relying on this implicit behavior are now broken. (For
> example, my sscg package compiled fine on 3.0.5 and fails with
> `../src/dhparams.c:234:8: error: implicit declaration of function
> ‘FIPS_mode’ [-Werror=implicit-function-declaration]` on 3.0.7.
For the record, I've patched my sscg package to call EVP_default_properties_is_fips_enabled(NULL) instead of FIPS_mode() on OpenSSL 3.
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory (Low: openssl security and bug fix update), and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.
https://access.redhat.com/errata/RHSA-2023:2523