From b54ab4788439685eb4259ace8014cf2ee83e17e9 Mon Sep 17 00:00:00 2001 From: Bence Mali Date: Mon, 13 May 2024 16:52:50 +0200 Subject: [PATCH] fix for no signatures defined error --- oqsprov/oqsprov_capabilities.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/oqsprov/oqsprov_capabilities.c b/oqsprov/oqsprov_capabilities.c index 551f7598..52c019da 100644 --- a/oqsprov/oqsprov_capabilities.c +++ b/oqsprov/oqsprov_capabilities.c @@ -613,6 +613,24 @@ static int oqs_group_capability(OSSL_CALLBACK *cb, void *arg) OSSL_PARAM_END \ } +#if defined(OQS_ENABLE_SIG_dilithium_2) \ + || defined(OQS_ENABLE_SIG_dilithium_3) \ + || defined(OQS_ENABLE_SIG_dilithium_5) \ + || defined(OQS_ENABLE_SIG_ml_dsa_44) \ + || defined(OQS_ENABLE_SIG_ml_dsa_65) \ + || defined(OQS_ENABLE_SIG_ml_dsa_87) \ + || defined(OQS_ENABLE_SIG_falcon_512) \ + || defined(OQS_ENABLE_SIG_falcon_padded_512) \ + || defined(OQS_ENABLE_SIG_falcon_1024) \ + || defined(OQS_ENABLE_SIG_falcon_padded_1024) \ + || defined(OQS_ENABLE_SIG_sphincs_sha2_128f_simple) \ + || defined(OQS_ENABLE_SIG_sphincs_sha2_128s_simple) \ + || defined(OQS_ENABLE_SIG_sphincs_sha2_192f_simple) \ + || defined(OQS_ENABLE_SIG_sphincs_shake_128f_simple) +#define OQS_SIGNATURES_USED +#endif + +#ifdef OQS_SIGNATURES_USED static const OSSL_PARAM oqs_param_sigalg_list[][12] = { ///// OQS_TEMPLATE_FRAGMENT_SIGALG_NAMES_START # ifdef OQS_ENABLE_SIG_dilithium_2 @@ -737,11 +755,14 @@ static const OSSL_PARAM oqs_param_sigalg_list[][12] = { rsa3072_sphincsshake128fsimple, rsa3072_sphincsshake128fsimple, "1.3.9999.6.7.15", 47), # endif + ///// OQS_TEMPLATE_FRAGMENT_SIGALG_NAMES_END }; +#endif static int oqs_sigalg_capability(OSSL_CALLBACK *cb, void *arg) { +#ifdef OQS_SIGNATURES_USED size_t i; // relaxed assertion for the case that not all algorithms are enabled in @@ -751,6 +772,7 @@ static int oqs_sigalg_capability(OSSL_CALLBACK *cb, void *arg) if (!cb(oqs_param_sigalg_list[i], arg)) return 0; } +#endif return 1; }