From: Willem Toorop Date: Tue, 17 May 2011 19:47:47 +0000 (+0000) Subject: Elimination of the defines in config.h from the header files that are distributed... X-Git-Tag: release-1.6.10rc1~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=32e78f9a0f71c483fe747c4561816494a5a6f130;p=thirdparty%2Fldns.git Elimination of the defines in config.h from the header files that are distributed with the library. Where possible, those are replaced by build configuration defines (that won't conflict with another autoconf environment) --- diff --git a/Makefile.in b/Makefile.in index 8b769d23..b1c59640 100644 --- a/Makefile.in +++ b/Makefile.in @@ -76,7 +76,6 @@ LIBDNS_SOURCES = rdata.c util.c rr.c packet.c wire2host.c \ sha1.c sha2.c LIBDNS_HEADERS = $(srcdir)/ldns/error.h \ $(srcdir)/ldns/packet.h \ - $(srcdir)/ldns/common.h \ $(srcdir)/ldns/rdata.h \ $(srcdir)/ldns/rr.h \ $(srcdir)/ldns/wire2host.h \ @@ -111,7 +110,7 @@ COMP_LIB = $(LIBTOOL) --mode=compile $(CC) $(CPPFLAGS) $(CFLAGS) LINK = $(CC) $(strip $(CFLAGS) $(LDFLAGS) $(LIBS)) LINK_LIB = $(LIBTOOL) --mode=link $(CC) $(strip $(CFLAGS) $(LDFLAGS) $(LIBS) -version-number $(version_info) -no-undefined) -%.o: $(srcdir)/%.c $(LIBDNS_HEADERS) ldns/net.h ldns/util.h ldns/config.h +%.o: $(srcdir)/%.c $(LIBDNS_HEADERS) ldns/common.h ldns/net.h ldns/util.h ldns/config.h $(COMP_LIB) $(LIBSSL_CPPFLAGS) -c $< .PHONY: clean realclean docclean manpages doc lint all lib pyldns test @@ -120,7 +119,7 @@ LINK_LIB = $(LIBTOOL) --mode=link $(CC) $(strip $(CFLAGS) $(LDFLAGS) $(LIBS) -ve all: copy-headers lib linktest manpages @PYLDNS@ -linktest: $(srcdir)/linktest.c $(LIBDNS_HEADERS) ldns/net.h ldns/util.h ldns/config.h libldns.la +linktest: $(srcdir)/linktest.c $(LIBDNS_HEADERS) ldns/common.h ldns/net.h ldns/util.h ldns/config.h libldns.la $(LIBTOOL) --mode=link $(CC) $(srcdir)/linktest.c $(CPPFLAGS) $(LIBSSL_CPPFLAGS) $(CFLAGS) -lldns $(LIBS) -o linktest lib: libldns.la @@ -140,12 +139,12 @@ $(addprefix include/ldns/, $(notdir $(LIBDNS_HEADERS))): include/ldns/%.h: $(src @if [ ! -d include/ldns ] ; then (cd include; ln -s ../ldns ./ldns || echo "include/ldns exists") ; fi ; $(INSTALL) -c -m 644 $< ./include/ldns/ -include/ldns/util.h include/ldns/net.h include/ldns/config.h: include/ldns/%.h: ./ldns/%.h +include/ldns/util.h include/ldns/common.h include/ldns/net.h include/ldns/config.h: include/ldns/%.h: ./ldns/%.h @if [ ! -d include ] ; then ($(INSTALL) -d include || echo "include exists") ; fi ; @if [ ! -d include/ldns ] ; then (cd include; ln -s ../ldns ./ldns || echo "include/ldns exists") ; fi ; $(INSTALL) -c -m 644 $< ./include/ldns/ -copy-headers: $(addprefix include/ldns/, $(notdir $(LIBDNS_HEADERS))) include/ldns/util.h include/ldns/net.h include/ldns/config.h +copy-headers: $(addprefix include/ldns/, $(notdir $(LIBDNS_HEADERS))) include/ldns/common.h include/ldns/util.h include/ldns/net.h include/ldns/config.h mancheck: sh -c 'find . -name \*.\[13\] -exec troff -z {} \;' 2>&1 | sed "s/^\.\///" | sed "s/\(:[0\-9]\+:\)/\1 warning:/g" @@ -167,10 +166,10 @@ manpages: $(srcdir)/doc/function_manpages pyldns: _ldns.la -$(pywrapdir)/ldns_wrapper.c: $(pywrapdir)/ldns.i $(wildcard $(pywrapdir)/*.i) $(LIBDNS_HEADERS) ldns/util.h ldns/config.h +$(pywrapdir)/ldns_wrapper.c: $(pywrapdir)/ldns.i $(wildcard $(pywrapdir)/*.i) $(LIBDNS_HEADERS) ldns/common.h ldns/util.h ldns/config.h $(swig) -python -o $@ $(CPPFLAGS) $(PYTHON_CPPFLAGS) $< -ldns_wrapper.lo: $(pywrapdir)/ldns_wrapper.c $(LIBDNS_HEADERS) ldns/util.h ldns/config.h +ldns_wrapper.lo: $(pywrapdir)/ldns_wrapper.c $(LIBDNS_HEADERS) ldns/common.h ldns/util.h ldns/config.h $(COMP_LIB) -I./include/ldns $(PYTHON_CPPFLAGS) -c $< -o $@ _ldns.la: ldns_wrapper.lo libldns.la @@ -178,7 +177,7 @@ _ldns.la: ldns_wrapper.lo libldns.la install: install-h install-lib install-config install-manpages $(pyldns_inst) -uninstall: uninstall-manpages uninstall-h uninstall-lib $(pyldns_uninst) +uninstall: uninstall-manpages uninstall-config uninstall-h uninstall-lib $(pyldns_uninst) destclean: uninstall @@ -188,6 +187,12 @@ install-config: $(INSTALL) -c -m 755 packaging/ldns-config $(DESTDIR)$(bindir)/; \ fi +uninstall-config: + if [ $(INSTALL_LDNS_CONFIG) = "yes" ] ; then \ + rm -f $(DESTDIR)$(bindir)/ldns-config; \ + [ ! -d $(DESTDIR)$(bindir) ] || rmdir -p $(DESTDIR)$(bindir) || echo "ok, dir already gone"; \ + fi + install-manpages: manpages ${INSTALL} -d $(DESTDIR)$(mandir)/man3 for f in doc/man/man3/*; do \ @@ -203,12 +208,16 @@ install-h: lib $(INSTALL) -m 755 -d $(DESTDIR)$(includedir)/ldns for i in $(LIBDNS_HEADERS); do \ $(INSTALL) -c -m 644 $$i $(DESTDIR)$(includedir)/ldns/; done + $(INSTALL) -c -m 644 include/ldns/common.h $(DESTDIR)$(includedir)/ldns/ $(INSTALL) -c -m 644 include/ldns/util.h $(DESTDIR)$(includedir)/ldns/ $(INSTALL) -c -m 644 include/ldns/net.h $(DESTDIR)$(includedir)/ldns/ uninstall-h: for i in $(LIBDNS_HEADERS); do \ rm -f $(DESTDIR)$(includedir)/$$i; done + rm -f $(DESTDIR)$(includedir)/ldns/net.h + rm -f $(DESTDIR)$(includedir)/ldns/util.h + rm -f $(DESTDIR)$(includedir)/ldns/common.h [ ! -d $(DESTDIR)$(includedir)/ldns ] || rmdir -p $(DESTDI)$(includedir)/ldns || echo "ok, dir already gone" exit 0 @@ -255,6 +264,7 @@ realclean: clean docclean libclean rm -f ldns/config.h.in rm -f ldns/config.h rm -f ldns/util.h + rm -f ldns/common.h rm -f config.h.in rm -f configure rm -f config.sub @@ -275,7 +285,7 @@ libclean: $(LIBTOOL) --mode clean rm -f libldns.so $(LIBTOOL) --mode clean rm -f libldns.so.* $(LIBTOOL) --mode clean rm -f _ldns.la - rm -rf ldns/net.h ldns/util.h ldns/config.h + rm -rf ldns/net.h ldns/util.h ldns/config.h ldns/common.h rm -rf *.lo rm -rf .libs rm -rf libtool diff --git a/acx_nlnetlabs.m4 b/acx_nlnetlabs.m4 index 147af7f9..ec5da2a8 100644 --- a/acx_nlnetlabs.m4 +++ b/acx_nlnetlabs.m4 @@ -405,6 +405,9 @@ void (*pf) (char *format, ...) __attribute__ ((format (printf, 1, 2))); AC_MSG_RESULT($ac_cv_c_format_attribute) if test $ac_cv_c_format_attribute = yes; then AC_DEFINE(HAVE_ATTR_FORMAT, 1, [Whether the C compiler accepts the "format" attribute]) + AC_SUBST(ldns_build_config_have_attr_format, 1) +else + AC_SUBST(ldns_build_config_have_attr_format, 0) fi ])dnl End of ACX_CHECK_FORMAT_ATTRIBUTE @@ -456,6 +459,9 @@ AC_DEFUN([AHX_CONFIG_UNUSED_ATTRIBUTE], AC_MSG_RESULT($ac_cv_c_unused_attribute) if test $ac_cv_c_unused_attribute = yes; then AC_DEFINE(HAVE_ATTR_UNUSED, 1, [Whether the C compiler accepts the "unused" attribute]) + AC_SUBST(ldns_build_config_have_attr_unused, 1) +else + AC_SUBST(ldns_build_config_have_attr_unused, 0) fi ])dnl diff --git a/configure.ac b/configure.ac index ce31eba4..1d9b7d36 100644 --- a/configure.ac +++ b/configure.ac @@ -177,6 +177,7 @@ case "$enable_ecdsa" in ]) # we now know we have ECDSA and the required curves. AC_DEFINE_UNQUOTED([USE_ECDSA], [1], [Define this to enable ECDSA support.]) + AC_SUBST(ldns_build_config_use_ecdsa, 1) AC_WARN([ ***************************************************************** *** YOU HAVE ENABLED ECDSA WHICH IS EXPERIMENTAL AT THIS TIME *** @@ -184,8 +185,10 @@ case "$enable_ecdsa" in *****************************************************************]) ;; no) + AC_SUBST(ldns_build_config_use_ecdsa, 0) ;; *) + AC_SUBST(ldns_build_config_use_ecdsa, 0) ;; esac @@ -260,8 +263,10 @@ AC_CHECK_HEADER(inttypes.h, [ include_inttypes_h='#include ' AC_DEFINE(HAVE_INTTYPES_H, 1, [define if you have inttypes.h]) +AC_SUBST(ldns_build_config_have_inttypes_h, 1) ],[ include_inttypes_h='' +AC_SUBST(ldns_build_config_have_inttypes_h, 0) ],[AC_INCLUDES_DEFAULT ]) AC_SUBST(include_inttypes_h) @@ -495,7 +500,13 @@ size_t strlcpy(char *dst, const char *src, size_t siz); #endif ]) -AC_CONFIG_FILES([Makefile ldns/net.h ldns/util.h packaging/libldns.pc packaging/ldns-config]) +if test "x$HAVE_SSL" = "xyes"; then + AC_SUBST(ldns_build_config_have_ssl, 1) +else + AC_SUBST(ldns_build_config_have_ssl, 0) +fi + +AC_CONFIG_FILES([Makefile ldns/common.h ldns/net.h ldns/util.h packaging/libldns.pc packaging/ldns-config]) AC_CONFIG_HEADER([ldns/config.h]) AC_OUTPUT diff --git a/ldns/common.h b/ldns/common.h deleted file mode 100644 index c400c1a8..00000000 --- a/ldns/common.h +++ /dev/null @@ -1,52 +0,0 @@ -/** - * \file common.h - * - * Common definitions for LDNS - */ - -/** - * a Net::DNS like library for C - * - * (c) NLnet Labs, 2004-2006 - * - * See the file LICENSE for the license - */ - -#ifndef LDNS_COMMON_H -#define LDNS_COMMON_H - -/*@ignore@*/ -/* splint barfs on this construct */ -#ifdef HAVE_STDBOOL_H -# include -#else -# ifndef HAVE__BOOL -# ifdef __cplusplus -typedef bool _Bool; -# else -# define _Bool signed char -# endif -# endif -# define bool _Bool -# define false 0 -# define true 1 -# define __bool_true_false_are_defined 1 -#endif -/*@end@*/ - -#ifdef HAVE_ATTR_FORMAT -#define ATTR_FORMAT(archetype, string_index, first_to_check) \ - __attribute__ ((format (archetype, string_index, first_to_check))) -#else /* !HAVE_ATTR_FORMAT */ -#define ATTR_FORMAT(archetype, string_index, first_to_check) /* empty */ -#endif /* !HAVE_ATTR_FORMAT */ - -#if defined(__cplusplus) -#define ATTR_UNUSED(x) -#elif defined(HAVE_ATTR_UNUSED) -#define ATTR_UNUSED(x) x __attribute__((unused)) -#else /* !HAVE_ATTR_UNUSED */ -#define ATTR_UNUSED(x) x -#endif /* !HAVE_ATTR_UNUSED */ - -#endif /* LDNS_COMMON_H */ diff --git a/ldns/common.h.in b/ldns/common.h.in new file mode 100644 index 00000000..98470eea --- /dev/null +++ b/ldns/common.h.in @@ -0,0 +1,69 @@ +/** + * \file common.h + * + * Common definitions for LDNS + */ + +/** + * a Net::DNS like library for C + * + * (c) NLnet Labs, 2004-2006 + * + * See the file LICENSE for the license + */ + +#ifndef LDNS_COMMON_H +#define LDNS_COMMON_H + +/* + * The build configuration that is used in the distributed headers, + * as detected and determined by the auto configure script. + */ +#define LDNS_BUILD_CONFIG_HAVE_SSL @ldns_build_config_have_ssl@ +#define LDNS_BUILD_CONFIG_USE_ECDSA @ldns_build_config_use_ecdsa@ +#define LDNS_BUILD_CONFIG_HAVE_INTTYPES_H @ldns_build_config_have_inttypes_h@ +#define LDNS_BUILD_CONFIG_HAVE_ATTR_FORMAT @ldns_build_config_have_attr_format@ +#define LDNS_BUILD_CONFIG_HAVE_ATTR_UNUSED @ldns_build_config_have_attr_unused@ + +/* + * HAVE_STDBOOL_H is not available when distributed as a library, but no build + * configuration variables may be used (like those above) because the header + * is sometimes only available when using special compiler flags to enable the + * c99 environment. Because we cannot force the usage of this flag, we have to + * provide a default type. Below what is suggested by the autoconf manual. + */ +/*@ignore@*/ +/* splint barfs on this construct */ +#ifdef HAVE_STDBOOL_H +# include +#else +# ifndef HAVE__BOOL +# ifdef __cplusplus +typedef bool _Bool; +# else +# define _Bool signed char +# endif +# endif +# define bool _Bool +# define false 0 +# define true 1 +# define __bool_true_false_are_defined 1 +#endif +/*@end@*/ + +#if LDNS_BUILD_CONFIG_HAVE_ATTR_FORMAT +#define ATTR_FORMAT(archetype, string_index, first_to_check) \ + __attribute__ ((format (archetype, string_index, first_to_check))) +#else /* !LDNS_BUILD_CONFIG_HAVE_ATTR_FORMAT */ +#define ATTR_FORMAT(archetype, string_index, first_to_check) /* empty */ +#endif /* !LDNS_BUILD_CONFIG_HAVE_ATTR_FORMAT */ + +#if defined(__cplusplus) +#define ATTR_UNUSED(x) +#elif LDNS_BUILD_CONFIG_HAVE_ATTR_UNUSED +#define ATTR_UNUSED(x) x __attribute__((unused)) +#else /* !LDNS_BUILD_CONFIG_HAVE_ATTR_UNUSED */ +#define ATTR_UNUSED(x) x +#endif /* !LDNS_BUILD_CONFIG_HAVE_ATTR_UNUSED */ + +#endif /* LDNS_COMMON_H */ diff --git a/ldns/dnssec.h b/ldns/dnssec.h index c68ce36e..739d136c 100644 --- a/ldns/dnssec.h +++ b/ldns/dnssec.h @@ -23,11 +23,11 @@ #ifndef LDNS_DNSSEC_H #define LDNS_DNSSEC_H -#ifdef HAVE_SSL +#include +#if LDNS_BUILD_CONFIG_HAVE_SSL #include #include -#endif /* HAVE_SSL */ -#include +#endif /* LDNS_BUILD_CONFIG_HAVE_SSL */ #include #include #include @@ -127,7 +127,7 @@ uint16_t ldns_calc_keytag(const ldns_rr *key); */ uint16_t ldns_calc_keytag_raw(uint8_t* key, size_t keysize); -#ifdef HAVE_SSL +#if LDNS_BUILD_CONFIG_HAVE_SSL /** * converts a buffer holding key material to a DSA key in openssl. * @@ -173,9 +173,9 @@ EVP_PKEY* ldns_gost2pkey_raw(unsigned char* key, size_t keylen); */ EVP_PKEY* ldns_ecdsa2pkey_raw(unsigned char* key, size_t keylen, uint8_t algo); -#endif /* HAVE_SSL */ +#endif /* LDNS_BUILD_CONFIG_HAVE_SSL */ -#ifdef HAVE_SSL +#if LDNS_BUILD_CONFIG_HAVE_SSL /** * converts a buffer holding key material to a RSA key in openssl. * @@ -191,7 +191,7 @@ RSA *ldns_key_buf2rsa(ldns_buffer *key); * \return a RSA * structure with the key material */ RSA *ldns_key_buf2rsa_raw(unsigned char* key, size_t len); -#endif /* HAVE_SSL */ +#endif /* LDNS_BUILD_CONFIG_HAVE_SSL */ /** * returns a new DS rr that represents the given key rr. @@ -382,7 +382,7 @@ bool ldns_nsec_bitmap_covers_type(const ldns_rdf *nsec_bitmap, ldns_rr_type type */ bool ldns_nsec_covers_name(const ldns_rr *nsec, const ldns_rdf *name); -#ifdef HAVE_SSL +#if LDNS_BUILD_CONFIG_HAVE_SSL /** * verify a packet * \param[in] p the packet @@ -448,7 +448,7 @@ int ldns_dnssec_default_delete_signatures(ldns_rr *sig, void *n); */ int ldns_dnssec_default_replace_signatures(ldns_rr *sig, void *n); -#ifdef HAVE_SSL +#if LDNS_BUILD_CONFIG_HAVE_SSL /** * Converts the DSA signature from ASN1 representation (RFC2459, as * used by OpenSSL) to raw signature data as used in DNS (rfc2536) @@ -498,7 +498,7 @@ ldns_status ldns_convert_ecdsa_rrsig_rdf2asn1(ldns_buffer *target_buffer, const ldns_rdf *sig_rdf); -#endif /* HAVE_SSL */ +#endif /* LDNS_BUILD_CONFIG_HAVE_SSL */ #ifdef __cplusplus } diff --git a/ldns/dnssec_sign.h b/ldns/dnssec_sign.h index bca7d511..4dd47f6c 100644 --- a/ldns/dnssec_sign.h +++ b/ldns/dnssec_sign.h @@ -42,7 +42,7 @@ ldns_sign_public_buffer(ldns_buffer *sign_buf, ldns_key *key); */ ldns_rr_list *ldns_sign_public(ldns_rr_list *rrset, ldns_key_list *keys); -#ifdef HAVE_SSL +#if LDNS_BUILD_CONFIG_HAVE_SSL /** * Sign a buffer with the DSA key (hash with SHA1) * \param[in] to_sign buffer with the data @@ -80,7 +80,7 @@ ldns_rdf *ldns_sign_public_rsasha1(ldns_buffer *to_sign, RSA *key); * \return a ldns_rdf with the signed data */ ldns_rdf *ldns_sign_public_rsamd5(ldns_buffer *to_sign, RSA *key); -#endif /* HAVE_SSL */ +#endif /* LDNS_BUILD_CONFIG_HAVE_SSL */ /** * Marks the names in the zone that are occluded. Those names will be skipped diff --git a/ldns/dnssec_verify.h b/ldns/dnssec_verify.h index 91b5b6d3..855729bf 100644 --- a/ldns/dnssec_verify.h +++ b/ldns/dnssec_verify.h @@ -494,7 +494,7 @@ ldns_status ldns_verify_rrsig(ldns_rr_list *rrset, * \param[in] key the EVP key structure * \param[in] digest_type The digest type of the signature */ -#ifdef HAVE_SSL +#if LDNS_BUILD_CONFIG_HAVE_SSL ldns_status ldns_verify_rrsig_evp(ldns_buffer *sig, ldns_buffer *rrset, EVP_PKEY *key, @@ -509,7 +509,7 @@ ldns_status ldns_verify_rrsig_evp(ldns_buffer *sig, * \param[in] key the EVP key structure * \param[in] digest_type The digest type of the signature */ -#ifdef HAVE_SSL +#if LDNS_BUILD_CONFIG_HAVE_SSL ldns_status ldns_verify_rrsig_evp_raw(unsigned char *sig, size_t siglen, ldns_buffer *rrset, diff --git a/ldns/keys.h b/ldns/keys.h index e0f568d8..ae5d4741 100644 --- a/ldns/keys.h +++ b/ldns/keys.h @@ -21,9 +21,10 @@ #ifndef LDNS_KEYS_H #define LDNS_KEYS_H -#ifdef HAVE_SSL +#include +#if LDNS_BUILD_CONFIG_HAVE_SSL #include -#endif /* HAVE_SSL */ +#endif /* LDNS_BUILD_CONFIG_HAVE_SSL */ #include #include #include @@ -53,7 +54,7 @@ enum ldns_enum_algorithm LDNS_RSASHA256 = 8, /* RFC 5702 */ LDNS_RSASHA512 = 10, /* RFC 5702 */ LDNS_ECC_GOST = 12, /* RFC 5933 */ -#ifdef USE_ECDSA +#if LDNS_BUILD_CONFIG_USE_ECDSA /* this ifdef has to be removed once it is no longer experimental, * to be able to use these values outside of the ldns library itself */ LDNS_ECDSAP256SHA256 = 13, /* draft-hoffman-dnssec-ecdsa */ @@ -73,7 +74,7 @@ enum ldns_enum_hash LDNS_SHA1 = 1, /* RFC 4034 */ LDNS_SHA256 = 2, /* RFC 4509 */ LDNS_HASH_GOST = 3 /* RFC 5933 */ -#ifdef USE_ECDSA +#if LDNS_BUILD_CONFIG_USE_ECDSA /* this ifdef has to be removed once it is no longer experimental, * to be able to use these values outside of the ldns library itself */ ,LDNS_SHA384 = 4 /* draft-hoffman-dnssec-ecdsa EXPERIMENTAL */ @@ -94,7 +95,7 @@ enum ldns_enum_signing_algorithm LDNS_SIGN_RSASHA512 = LDNS_RSASHA512, LDNS_SIGN_DSA_NSEC3 = LDNS_DSA_NSEC3, LDNS_SIGN_ECC_GOST = LDNS_ECC_GOST, -#ifdef USE_ECDSA +#if LDNS_BUILD_CONFIG_USE_ECDSA /* this ifdef has to be removed once it is no longer experimental, * to be able to use these values outside of the ldns library itself */ LDNS_SIGN_ECDSAP256SHA256 = LDNS_ECDSAP256SHA256, @@ -123,13 +124,13 @@ struct ldns_struct_key { /** Storage pointers for the types of keys supported */ /* TODO remove unions? */ struct { -#ifdef HAVE_SSL +#if LDNS_BUILD_CONFIG_HAVE_SSL #ifndef S_SPLINT_S /* The key can be an OpenSSL EVP Key */ EVP_PKEY *key; #endif -#endif /* HAVE_SSL */ +#endif /* LDNS_BUILD_CONFIG_HAVE_SSL */ /** * The key can be an HMAC key */ @@ -220,7 +221,7 @@ ldns_status ldns_key_new_frm_fp(ldns_key **k, FILE *fp); */ ldns_status ldns_key_new_frm_fp_l(ldns_key **k, FILE *fp, int *line_nr); -#ifdef HAVE_SSL +#if LDNS_BUILD_CONFIG_HAVE_SSL /** * Read the key with the given id from the given engine and store it * in the given ldns_key structure. The algorithm type is set @@ -235,9 +236,9 @@ ldns_status ldns_key_new_frm_engine(ldns_key **key, ENGINE *e, char *key_id, ldn * \return NULL on failure otherwise a RSA structure */ RSA *ldns_key_new_frm_fp_rsa(FILE *fp); -#endif /* HAVE_SSL */ +#endif /* LDNS_BUILD_CONFIG_HAVE_SSL */ -#ifdef HAVE_SSL +#if LDNS_BUILD_CONFIG_HAVE_SSL /** * frm_fp helper function. This function parses the * remainder of the (RSA) priv. key file generated from bind9 @@ -246,9 +247,9 @@ RSA *ldns_key_new_frm_fp_rsa(FILE *fp); * \return NULL on failure otherwise a RSA structure */ RSA *ldns_key_new_frm_fp_rsa_l(FILE *fp, int *line_nr); -#endif /* HAVE_SSL */ +#endif /* LDNS_BUILD_CONFIG_HAVE_SSL */ -#ifdef HAVE_SSL +#if LDNS_BUILD_CONFIG_HAVE_SSL /** * frm_fp helper function. This function parses the * remainder of the (DSA) priv. key file @@ -256,9 +257,9 @@ RSA *ldns_key_new_frm_fp_rsa_l(FILE *fp, int *line_nr); * \return NULL on failure otherwise a RSA structure */ DSA *ldns_key_new_frm_fp_dsa(FILE *fp); -#endif /* HAVE_SSL */ +#endif /* LDNS_BUILD_CONFIG_HAVE_SSL */ -#ifdef HAVE_SSL +#if LDNS_BUILD_CONFIG_HAVE_SSL /** * frm_fp helper function. This function parses the * remainder of the (DSA) priv. key file @@ -267,9 +268,9 @@ DSA *ldns_key_new_frm_fp_dsa(FILE *fp); * \return NULL on failure otherwise a RSA structure */ DSA *ldns_key_new_frm_fp_dsa_l(FILE *fp, int *line_nr); -#endif /* HAVE_SSL */ +#endif /* LDNS_BUILD_CONFIG_HAVE_SSL */ -#ifdef HAVE_SSL +#if LDNS_BUILD_CONFIG_HAVE_SSL /** * frm_fp helper function. This function parses the * remainder of the (HMAC-MD5) key file @@ -281,7 +282,7 @@ DSA *ldns_key_new_frm_fp_dsa_l(FILE *fp, int *line_nr); unsigned char *ldns_key_new_frm_fp_hmac(FILE *fp, size_t *hmac_size); #endif -#ifdef HAVE_SSL +#if LDNS_BUILD_CONFIG_HAVE_SSL /** * frm_fp helper function. This function parses the * remainder of the (HMAC-MD5) key file @@ -292,7 +293,7 @@ unsigned char *ldns_key_new_frm_fp_hmac(FILE *fp, size_t *hmac_size); * \return NULL on failure otherwise a newly allocated char buffer */ unsigned char *ldns_key_new_frm_fp_hmac_l(FILE *fp, int *line_nr, size_t *hmac_size); -#endif /* HAVE_SSL */ +#endif /* LDNS_BUILD_CONFIG_HAVE_SSL */ /* acces write functions */ /** @@ -301,7 +302,7 @@ unsigned char *ldns_key_new_frm_fp_hmac_l(FILE *fp, int *line_nr, size_t *hmac_s * \param[in] l the algorithm */ void ldns_key_set_algorithm(ldns_key *k, ldns_signing_algorithm l); -#ifdef HAVE_SSL +#if LDNS_BUILD_CONFIG_HAVE_SSL /** * Set the key's evp key * \param[in] k the key @@ -331,7 +332,7 @@ int ldns_key_EVP_load_gost_id(void); /** Release the engine reference held for the GOST engine. */ void ldns_key_EVP_unload_gost(void); -#endif /* HAVE_SSL */ +#endif /* LDNS_BUILD_CONFIG_HAVE_SSL */ /** * Set the key's hmac data @@ -424,7 +425,7 @@ size_t ldns_key_list_key_count(const ldns_key_list *key_list); */ ldns_key *ldns_key_list_key(const ldns_key_list *key, size_t nr); -#ifdef HAVE_SSL +#if LDNS_BUILD_CONFIG_HAVE_SSL /** * returns the (openssl) RSA struct contained in the key * \param[in] k the key to look in @@ -437,14 +438,14 @@ RSA *ldns_key_rsa_key(const ldns_key *k); * \return the RSA * structure in the key */ EVP_PKEY *ldns_key_evp_key(const ldns_key *k); -#endif /* HAVE_SSL */ +#endif /* LDNS_BUILD_CONFIG_HAVE_SSL */ /** * returns the (openssl) DSA struct contained in the key */ -#ifdef HAVE_SSL +#if LDNS_BUILD_CONFIG_HAVE_SSL DSA *ldns_key_dsa_key(const ldns_key *k); -#endif /* HAVE_SSL */ +#endif /* LDNS_BUILD_CONFIG_HAVE_SSL */ /** * return the signing alg of the key diff --git a/ldns/sha2.h b/ldns/sha2.h index beb0b6f3..238767af 100644 --- a/ldns/sha2.h +++ b/ldns/sha2.h @@ -55,17 +55,14 @@ extern "C" { * Import u_intXX_t size_t type definitions from system headers. You * may need to change this, or define these things yourself in this * file. - * - * (include ldns/config.h so HAVE_INTTYPES is defined (or not, depending - * on the system)) */ #include -#ifdef HAVE_INTTYPES_H +#if LDNS_BUILD_CONFIG_HAVE_INTTYPES_H #include -#endif /* HAVE_INTTYPES_H */ +#endif /* LDNS_BUILD_CONFIG_HAVE_INTTYPES_H */ /*** SHA-256/384/512 Various Length Definitions ***********************/