From: Willem Toorop Date: Fri, 19 Nov 2021 14:53:07 +0000 (+0100) Subject: Eliminate compile warnings without ED25519 and/or ED448 support X-Git-Tag: 1.8.0-rc.2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5635ebe48a6afeb38f4405760fa8513f09c7b9a1;p=thirdparty%2Fldns.git Eliminate compile warnings without ED25519 and/or ED448 support --- diff --git a/configure.ac b/configure.ac index a8efe399..5e4b1e00 100644 --- a/configure.ac +++ b/configure.ac @@ -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 ]) ;; @@ -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 ]) ;; diff --git a/ldns/common.h.in b/ldns/common.h.in index d4a8051d..db559608 100644 --- a/ldns/common.h.in +++ b/ldns/common.h.in @@ -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 diff --git a/ldns/keys.h b/ldns/keys.h index 7e5fac5c..d6435825 100644 --- a/ldns/keys.h +++ b/ldns/keys.h @@ -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 */