From ca4c9eae269c34765df26699fe756860c7827693 Mon Sep 17 00:00:00 2001 From: Martin Schanzenbach Date: Tue, 30 Mar 2021 19:26:40 +0200 Subject: UTIL/SCALARPRODUCT: Do not build ECC dlog or scalarproduct with incompatible libgcrypt versions (>=1.9.0) --- configure.ac | 12 ++++++++++-- po/POTFILES.in | 3 +++ src/Makefile.am | 6 +++++- src/util/Makefile.am | 18 +++++++++++++++--- 4 files changed, 33 insertions(+), 6 deletions(-) diff --git a/configure.ac b/configure.ac index 28c616069..f72039d09 100644 --- a/configure.ac +++ b/configure.ac @@ -416,8 +416,16 @@ gcrypt=0 NEED_LIBGCRYPT_API=1 NEED_LIBGCRYPT_VERSION=1.6.0 - -AM_PATH_LIBGCRYPT("$NEED_LIBGCRYPT_API:$NEED_LIBGCRYPT_VERSION", gcrypt=1) +# Check if we have libgcrypt >= 1.9. Some things do not work with it +gcrypt19=0 +AM_PATH_LIBGCRYPT("$NEED_LIBGCRYPT_API:1.9.0", + [AC_MSG_WARN(["Some subsystems do not work with gcrypt >=1.9.0"]) + gcrypt=1 + gcrypt19=1], + [AM_PATH_LIBGCRYPT("$NEED_LIBGCRYPT_API:$NEED_LIBGCRYPT_VERSION", gcrypt=1)] +) +AM_CONDITIONAL(HAVE_NOLIBGCRYPT19, + [test "$gcrypt19" = 0]) AC_CHECK_DECLS([gcry_mpi_set_opaque_copy], [], [], [[#include ]]) AS_IF([test $gcrypt = 0], diff --git a/po/POTFILES.in b/po/POTFILES.in index dbbb68bcc..b3849abbd 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -407,6 +407,9 @@ src/testbed/gnunet_mpi_test.c src/testbed/gnunet_testbed_mpi_spawn.c src/testbed/testbed_api.c src/testbed/testbed_api_barriers.c +src/testbed/testbed_api_cmd_controller.c +src/testbed/testbed_api_cmd_peer.c +src/testbed/testbed_api_cmd_service.c src/testbed/testbed_api_hosts.c src/testbed/testbed_api_operations.c src/testbed/testbed_api_peers.c diff --git a/src/Makefile.am b/src/Makefile.am index d8a869acb..564923e28 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -45,6 +45,10 @@ if HAVE_POSTGRESQL POSTGRES_DIR = pq endif +if HAVE_NOLIBGCRYPT19 + SCALARPRODUCT_DIR = scalarproduct +endif + REST_DIR = rest @@ -93,7 +97,7 @@ SUBDIRS = \ seti \ setu \ consensus \ - scalarproduct \ + $(SCALARPRODUCT_DIR) \ revocation \ vpn \ gns \ diff --git a/src/util/Makefile.am b/src/util/Makefile.am index 6b9e083a7..e2614e5e3 100644 --- a/src/util/Makefile.am +++ b/src/util/Makefile.am @@ -25,6 +25,11 @@ if ENABLE_BENCHMARK PTHREAD = -lpthread endif +if HAVE_NOLIBGCRYPT19 + DLOG = crypto_ecc_dlog.c + DLOG_TEST = test_crypto_ecc_dlog +endif + gnunet_config_diff_SOURCES = \ gnunet-config-diff.c gnunet_config_diff_LDADD = \ @@ -58,7 +63,7 @@ libgnunetutil_la_SOURCES = \ crypto_symmetric.c \ crypto_crc.c \ crypto_ecc.c \ - crypto_ecc_dlog.c \ + $(DLOG) \ crypto_ecc_setup.c \ crypto_hash.c \ crypto_hash_file.c \ @@ -248,7 +253,6 @@ libgnunet_plugin_test_la_LDFLAGS = \ if HAVE_BENCHMARKS BENCHMARKS = \ perf_crypto_hash \ - perf_crypto_ecc_dlog \ perf_crypto_rsa \ perf_crypto_paillier \ perf_crypto_symmetric \ @@ -256,6 +260,10 @@ if HAVE_BENCHMARKS perf_malloc \ perf_mq \ perf_scheduler + +if HAVE_NOLIBGCRYPT19 + BENCHMARKS += perf_crypto_ecc_dlog +endif endif if HAVE_SSH_KEY @@ -287,7 +295,7 @@ check_PROGRAMS = \ test_crypto_ecdhe \ test_crypto_ecdh_eddsa \ test_crypto_ecdh_ecdsa \ - test_crypto_ecc_dlog \ + $(DLOG_TEST) \ test_crypto_hash \ test_crypto_hash_context \ test_crypto_hkdf \ @@ -448,11 +456,13 @@ test_crypto_eddsa_LDADD = \ libgnunetutil.la \ $(LIBGCRYPT_LIBS) +if HAVE_NOLIBGCRYPT19 test_crypto_ecc_dlog_SOURCES = \ test_crypto_ecc_dlog.c test_crypto_ecc_dlog_LDADD = \ libgnunetutil.la \ $(LIBGCRYPT_LIBS) +endif test_crypto_ecdhe_SOURCES = \ test_crypto_ecdhe.c @@ -595,11 +605,13 @@ perf_crypto_hash_SOURCES = \ perf_crypto_hash_LDADD = \ libgnunetutil.la +if HAVE_NOLIBGCRYPT19 perf_crypto_ecc_dlog_SOURCES = \ perf_crypto_ecc_dlog.c perf_crypto_ecc_dlog_LDADD = \ libgnunetutil.la \ -lgcrypt +endif perf_crypto_rsa_SOURCES = \ perf_crypto_rsa.c -- cgit v1.2.3