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.
Bug 2083879 - -Wimplicit-function-declaration when compiling FIPS_mode() function with clang
Summary: -Wimplicit-function-declaration when compiling FIPS_mode() function with clang
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: openssl
Version: 9.1
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: rc
: ---
Assignee: Dmitry Belyavskiy
QA Contact: Alicja Kario
URL:
Whiteboard:
Depends On: 2083876
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-05-10 21:54 UTC by Tom Stellard
Modified: 2023-05-09 10:30 UTC (History)
11 users (show)

Fixed In Version: openssl-3.0.7-2.el9
Doc Type: No Doc Update
Doc Text:
Clone Of: 2083876
Environment:
Last Closed: 2023-05-09 08:20:36 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 2152504 0 medium CLOSED openssl: C99 compatibility in downstream-only 0032-Force-fips.patch 2023-01-05 11:11:29 UTC
Red Hat Issue Tracker CRYPTO-7251 0 None Waiting on Customer Path based routing is broken for ACME HTTP-01 validation 2022-06-24 08:03:36 UTC
Red Hat Issue Tracker RHELPLAN-121652 0 None None None 2022-05-10 21:56:29 UTC
Red Hat Product Errata RHSA-2023:2523 0 None None None 2023-05-09 08:20:52 UTC

Internal Links: 2152504

Description Tom Stellard 2022-05-10 21:54:34 UTC
+++ 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 7 Stephen 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 8 Dmitry 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

Comment 9 Tomáš Mráz 2022-12-05 11:20:13 UTC
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 11 Stephen 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.

Comment 14 errata-xmlrpc 2023-05-09 08:20:36 UTC
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


Note You need to log in before you can comment on or make changes to this bug.