Home GnuPG

fips: Add constructor to run selftests.

Description

fips: Add constructor to run selftests.

* src/fips.c (_gcry_fips_to_activate): New.
* src/g10lib.h (_gcry_fips_to_activate): New.
* src/global.c [ENABLE_HMAC_BINARY_CHECK] (_gcry_global_constructor):
New.

Note: constructor is non-portable feature of GCC. This behavior
of running selftests just after the load of the library is
specific to the build with ENABLE_HMAC_BINARY_CHECK.

  • GnuPG-bug-id: T5636
  • Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>

Details