]> git.ipfire.org Git - thirdparty/ldns.git/commitdiff
Eliminate compile warnings without ED25519 and/or ED448 support
authorWillem Toorop <willem@nlnetlabs.nl>
Fri, 19 Nov 2021 14:53:07 +0000 (15:53 +0100)
committerWillem Toorop <willem@nlnetlabs.nl>
Fri, 19 Nov 2021 14:53:07 +0000 (15:53 +0100)
configure.ac
ldns/common.h.in
ldns/keys.h

index a8efe399dc14d94bbfa973b7fead8be4eedb8010..5e4b1e0083e983e13fc4b3b56e90deade229998b 100644 (file)
@@ -577,12 +577,16 @@ esac
 
 AC_ARG_ENABLE(ed25519, AC_HELP_STRING([--disable-ed25519], [Disable (experimental) ED25519 support. Default is detect]))
 case "$enable_ed25519" in
-    no) ;;
+    no)
+      AC_SUBST(ldns_build_config_use_ed25519, 0)
+      ;;
     *) dnl default
       AC_CHECK_DECLS([NID_ED25519], [
        AC_DEFINE_UNQUOTED([USE_ED25519], [1], [Define this to enable ED25519 support.])
+        AC_SUBST(ldns_build_config_use_ed25519, 1)
       ], [if test "x$enable_ed25519" = "xyes"; then AC_MSG_ERROR([OpenSSL does not support ED25519 and you used --enable-ed25519.])
-      fi ], [AC_INCLUDES_DEFAULT
+          fi
+         AC_SUBST(ldns_build_config_use_ed25519, 0)], [AC_INCLUDES_DEFAULT
 #include <openssl/evp.h>
       ])
       ;;
@@ -590,12 +594,16 @@ esac
 
 AC_ARG_ENABLE(ed448, AC_HELP_STRING([--disable-ed448], [Disable (experimental) ED448 support. Default is detect]))
 case "$enable_ed448" in
-    no) ;;
+    no)
+      AC_SUBST(ldns_build_config_use_ed448, 0)
+      ;;
     *) dnl default
       AC_CHECK_DECLS([NID_ED448], [
        AC_DEFINE_UNQUOTED([USE_ED448], [1], [Define this to enable ED448 support.])
+        AC_SUBST(ldns_build_config_use_ed448, 1)
       ], [if test "x$enable_ed448" = "xyes"; then AC_MSG_ERROR([OpenSSL does not support ED448 and you used --enable-ed448.])
-      fi ], [AC_INCLUDES_DEFAULT
+          fi
+          AC_SUBST(ldns_build_config_use_ed448, 0)], [AC_INCLUDES_DEFAULT
 #include <openssl/evp.h>
       ])
       ;;
index d4a8051df842c1b068faf0ddc119f22ad40242d8..db559608b06c9370f5720dcce2bbb0af2fb06528 100644 (file)
@@ -28,6 +28,8 @@
 #define LDNS_BUILD_CONFIG_HAVE_B32_PTON    @ldns_build_config_have_b32_pton@
 #define LDNS_BUILD_CONFIG_HAVE_B32_NTOP    @ldns_build_config_have_b32_ntop@
 #define LDNS_BUILD_CONFIG_USE_DSA          @ldns_build_config_use_dsa@
+#define LDNS_BUILD_CONFIG_USE_ED25519      @ldns_build_config_use_ed25519@
+#define LDNS_BUILD_CONFIG_USE_ED448        @ldns_build_config_use_ed448@
 
 /*
  * HAVE_STDBOOL_H is not available when distributed as a library, but no build 
index 7e5fac5c7f6bc41ab74b3e2b3f738df716411eb1..d6435825387b5d360a83a54af75be0ea06e7bb98 100644 (file)
@@ -59,8 +59,12 @@ enum ldns_enum_algorithm
         LDNS_ECC_GOST           = 12,  /* RFC 5933 */
         LDNS_ECDSAP256SHA256    = 13,  /* RFC 6605 */
         LDNS_ECDSAP384SHA384    = 14,  /* RFC 6605 */
+#if LDNS_BUILD_CONFIG_USE_ED25519
        LDNS_ED25519            = 15,  /* RFC 8080 */
+#endif /* LDNS_BUILD_CONFIG_USE_ED25519 */
+#if LDNS_BUILD_CONFIG_USE_ED448
        LDNS_ED448              = 16,  /* RFC 8080 */
+#endif /* LDNS_BUILD_CONFIG_USE_ED448 */
         LDNS_INDIRECT           = 252,
         LDNS_PRIVATEDNS         = 253,
         LDNS_PRIVATEOID         = 254
@@ -98,8 +102,12 @@ enum ldns_enum_signing_algorithm
        LDNS_SIGN_ECC_GOST       = LDNS_ECC_GOST,
         LDNS_SIGN_ECDSAP256SHA256 = LDNS_ECDSAP256SHA256,
         LDNS_SIGN_ECDSAP384SHA384 = LDNS_ECDSAP384SHA384,
+#if LDNS_BUILD_CONFIG_USE_ED25519
        LDNS_SIGN_ED25519        = LDNS_ED25519,
+#endif /* LDNS_BUILD_CONFIG_USE_ED25519 */
+#if LDNS_BUILD_CONFIG_USE_ED448
        LDNS_SIGN_ED448          = LDNS_ED448,
+#endif /* LDNS_BUILD_CONFIG_USE_ED448 */
        LDNS_SIGN_HMACMD5        = 157, /* not official! This type is for TSIG, not DNSSEC */
        LDNS_SIGN_HMACSHA1       = 158, /* not official! This type is for TSIG, not DNSSEC */
        LDNS_SIGN_HMACSHA256 = 159,  /* ditto */