From 26b5c40d95021a813935f70c77071a0df112c175 Mon Sep 17 00:00:00 2001 From: Simon Kelley Date: Sat, 27 Mar 2021 23:29:36 +0000 Subject: [PATCH] Replace ad-hoc libnettle version detecion with MIN_VERSION macro. --- src/crypto.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/crypto.c b/src/crypto.c index eaf9ea9..e366778 100644 --- a/src/crypto.c +++ b/src/crypto.c @@ -124,10 +124,8 @@ const struct nettle_hash *hash_find(char *name) /* libnettle >= 3.4 provides nettle_lookup_hash() which avoids nasty ABI incompatibilities if sizeof(nettle_hashes) changes between library - versions. It also #defines nettle_hashes, so use that to tell - if we have the new facilities. */ - -#ifdef nettle_hashes + versions. */ +#if MIN_VERSION(3, 4) return nettle_lookup_hash(name); #else { @@ -180,7 +178,7 @@ int hash_init(const struct nettle_hash *hash, void **ctxp, unsigned char **diges return 1; } -#endif +#endif /* defined(HAVE_DNSSEC) || defined(HAVE_CRYPTOHASH) */ #ifdef HAVE_DNSSEC