[PATCH 7/7] fips: Skip selftests of unsupported PK algos

Clemens Lang cllang at redhat.com
Tue Jun 21 19:00:48 CEST 2022


* src/fips.c (run_pubkey_selftests): Do not run selftests for disabled
  public key algorithms.

--

Skip running FIPS selftests that are specific for a public key algorithm
if that algorithm was disabled using the --enable-pubkey-ciphers
configure option.

Signed-off-by: Clemens Lang <cllang at redhat.com>
---
 src/fips.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/fips.c b/src/fips.c
index 89f8204b..a1958b14 100644
--- a/src/fips.c
+++ b/src/fips.c
@@ -554,8 +554,12 @@ run_pubkey_selftests (int extended)
 {
   static int algos[] =
     {
+#if USE_RSA
       GCRY_PK_RSA,
+#endif /* USE_RSA */
+#if USE_ECC
       GCRY_PK_ECC,
+#endif /* USE_ECC */
       0
     };
   int idx;
-- 
2.35.3




More information about the Gcrypt-devel mailing list