Hi,

 

Commit 2024f9729713fd657d65e64c2e4e471baa0a3e5b "Support hash function from
nettle (only)" has introduced HAVE_NETTLEHASH option (thanks, Petr!).
But, I think, there's no much sense to bind feature name to specific
cryptolib because this will require rename or introduce more similar opts
for some other cryptolib backend if/when it'll be available (for example in
my dnsmasq-openssl fork).

If no objections, let's name it "cryptohash" early before 2.84 is out?
Sorry, have missed pre-2.83, but it has dns issues so unlikely be widely
deployed.

Please refer patch attached.

 

--

Best Regards, Vladislav Grishenko

 

>From d0a80d2ba18cb8d6bf3e93b66656ca5a9339df9f Mon Sep 17 00:00:00 2001
From: Vladislav Grishenko <themi...@mail.ru>
Date: Sun, 24 Jan 2021 19:15:31 +0500
Subject: [PATCH] Rename HAVE_NETTLEHASH to HAVE_CRYPTOHASH

There's no much sense to bind feature name to specific cryptolib
because this will require rename or introduce more similar opts
for some other cryptolib backend if/when it'll be available.
So, let's name it "cryptohash" early before 2.84 is out, 2.83
has dns issues so unlikely be widely deployed.
---
 Makefile             |  4 ++--
 src/config.h         | 10 +++++-----
 src/crypto.c         |  2 +-
 src/dnsmasq.h        |  2 +-
 src/hash_questions.c |  2 +-
 5 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/Makefile b/Makefile
index 7d2afd1..92bc811 100644
--- a/Makefile
+++ b/Makefile
@@ -63,9 +63,9 @@ ct_libs =       `echo $(COPTS) | $(top)/bld/pkg-wrapper 
HAVE_CONNTRACK $(PKG_CON
 lua_cflags =    `echo $(COPTS) | $(top)/bld/pkg-wrapper HAVE_LUASCRIPT 
$(PKG_CONFIG) --cflags lua5.2` 
 lua_libs =      `echo $(COPTS) | $(top)/bld/pkg-wrapper HAVE_LUASCRIPT 
$(PKG_CONFIG) --libs lua5.2` 
 nettle_cflags = `echo $(COPTS) | $(top)/bld/pkg-wrapper HAVE_DNSSEC     
$(PKG_CONFIG) --cflags 'nettle hogweed' \
-                                                        HAVE_NETTLEHASH 
$(PKG_CONFIG) --cflags nettle`
+                                                        HAVE_CRYPTOHASH 
$(PKG_CONFIG) --cflags nettle`
 nettle_libs =   `echo $(COPTS) | $(top)/bld/pkg-wrapper HAVE_DNSSEC     
$(PKG_CONFIG) --libs 'nettle hogweed' \
-                                                        HAVE_NETTLEHASH 
$(PKG_CONFIG) --libs nettle`
+                                                        HAVE_CRYPTOHASH 
$(PKG_CONFIG) --libs nettle`
 gmp_libs =      `echo $(COPTS) | $(top)/bld/pkg-wrapper HAVE_DNSSEC NO_GMP 
--copy -lgmp`
 sunos_libs =    `if uname | grep SunOS >/dev/null 2>&1; then echo -lsocket 
-lnsl -lposix4; fi`
 version =     -DVERSION='\"`$(top)/bld/get-version $(top)`\"'
diff --git a/src/config.h b/src/config.h
index e71a117..ba461b7 100644
--- a/src/config.h
+++ b/src/config.h
@@ -120,8 +120,8 @@ HAVE_AUTH
    define this to include the facility to act as an authoritative DNS
    server for one or more zones.
 
-HAVE_NETTLEHASH
-   include just hash function from nettle, but no DNSSEC.
+HAVE_CRYPTOHASH
+   include just hash function from crypto library, but no DNSSEC.
 
 HAVE_DNSSEC
    include DNSSEC validator.
@@ -190,7 +190,7 @@ RESOLVFILE
 /* #define HAVE_IDN */
 /* #define HAVE_LIBIDN2 */
 /* #define HAVE_CONNTRACK */
-/* #define HAVE_NETTLEHASH */
+/* #define HAVE_CRYPTOHASH */
 /* #define HAVE_DNSSEC */
 
 
@@ -424,10 +424,10 @@ static char *compile_opts =
 "no-"
 #endif
 "auth "
-#if !defined(HAVE_NETTLEHASH) && !defined(HAVE_DNSSEC)
+#if !defined(HAVE_CRYPTOHASH) && !defined(HAVE_DNSSEC)
 "no-"
 #endif
-"nettlehash "
+"cryptohash "
 #ifndef HAVE_DNSSEC
 "no-"
 #endif
diff --git a/src/crypto.c b/src/crypto.c
index 09525d2..5f4c390 100644
--- a/src/crypto.c
+++ b/src/crypto.c
@@ -27,7 +27,7 @@
 #endif
 #endif
 
-#if defined(HAVE_DNSSEC) || defined(HAVE_NETTLEHASH)
+#if defined(HAVE_DNSSEC) || defined(HAVE_CRYPTOHASH)
 #include <nettle/nettle-meta.h>
 #include <nettle/bignum.h>
 
diff --git a/src/dnsmasq.h b/src/dnsmasq.h
index 360c226..e108359 100644
--- a/src/dnsmasq.h
+++ b/src/dnsmasq.h
@@ -157,7 +157,7 @@ extern int capget(cap_user_header_t header, cap_user_data_t 
data);
 #include <priv.h>
 #endif
 
-#if defined(HAVE_DNSSEC) || defined(HAVE_NETTLEHASH)
+#if defined(HAVE_DNSSEC) || defined(HAVE_CRYPTOHASH)
 #  include <nettle/nettle-meta.h>
 #endif
 
diff --git a/src/hash_questions.c b/src/hash_questions.c
index 51d88c2..90fa9f8 100644
--- a/src/hash_questions.c
+++ b/src/hash_questions.c
@@ -28,7 +28,7 @@
 
 #include "dnsmasq.h"
 
-#if defined(HAVE_DNSSEC) || defined(HAVE_NETTLEHASH)
+#if defined(HAVE_DNSSEC) || defined(HAVE_CRYPTOHASH)
 unsigned char *hash_questions(struct dns_header *header, size_t plen, char 
*name)
 {
   int q;
-- 
2.17.1

_______________________________________________
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss

Reply via email to