From: Wouter Wijngaards Date: Thu, 20 Jan 2011 08:29:55 +0000 (+0000) Subject: fix set_bit (from NSEC3 sign) patch from Jan Komissar X-Git-Tag: release-1.6.9rc1~26 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c44f8586bc80ac115a35566d63fa581d7b0c083d;p=thirdparty%2Fldns.git fix set_bit (from NSEC3 sign) patch from Jan Komissar --- diff --git a/Makefile.in b/Makefile.in index 5abb293b..0cb2bf4c 100644 --- a/Makefile.in +++ b/Makefile.in @@ -53,7 +53,18 @@ LIBTOOL = $(libtool) --tag=CC --quiet INSTALL_LDNS_CONFIG = @INSTALL_LDNS_CONFIG@ LINT = splint -LINTFLAGS = +quiet -weak -warnposix -unrecog -Din_addr_t=uint32_t -Du_int=unsigned -Du_char=uint8_t -preproc -D__u16=uint16_t -fixedformalarray +LINTFLAGS=+quiet -weak -warnposix -unrecog -Din_addr_t=uint32_t -Du_int=unsigned -Du_char=uint8_t -preproc -Drlimit=rlimit64 -D__gnuc_va_list=va_list +#-Dglob64=glob -Dglobfree64=globfree +# compat with openssl linux edition. +LINTFLAGS+="-DBN_ULONG=unsigned long" -Dkrb5_int32=int "-Dkrb5_ui_4=unsigned int" -DPQ_64BIT=uint64_t -DRC4_INT=unsigned -fixedformalarray -D"ENGINE=unsigned" -D"RSA=unsigned" -D"DSA=unsigned" -D"EVP_PKEY=unsigned" -D"EVP_MD=unsigned" -D"SSL=unsigned" -D"SSL_CTX=unsigned" -D"X509=unsigned" -D"RC4_KEY=unsigned" -D"EVP_MD_CTX=unsigned" +# compat with NetBSD +ifeq "$(shell uname)" "NetBSD" +LINTFLAGS+="-D__RENAME(x)=" -D_NETINET_IN_H_ +endif +# compat with OpenBSD +LINTFLAGS+="-Dsigset_t=long" +# FreeBSD8 +LINTFLAGS+="-D__uint16_t=uint16_t" INSTALL = $(srcdir)/install-sh diff --git a/drill/Makefile.in b/drill/Makefile.in index 3b1d46c4..7d8d3354 100644 --- a/drill/Makefile.in +++ b/drill/Makefile.in @@ -24,7 +24,19 @@ COMPILE = $(CC) $(CPPFLAGS) $(CFLAGS) -I. -I$(srcdir) LINK = $(CC) $(CFLAGS) $(LDFLAGS) LINT = splint -LINTFLAGS = +quiet -weak -warnposix -unrecog -Din_addr_t=uint32_t -Du_int=unsigned -Du_char=uint8_t -D__signed__=signed -I../ -fixedformalarray +LINTFLAGS=+quiet -weak -warnposix -unrecog -Din_addr_t=uint32_t -Du_int=unsigned -Du_char=uint8_t -preproc -Drlimit=rlimit64 -D__gnuc_va_list=va_list +#-Dglob64=glob -Dglobfree64=globfree +# compat with openssl linux edition. +LINTFLAGS+="-DBN_ULONG=unsigned long" -Dkrb5_int32=int "-Dkrb5_ui_4=unsigned int" -DPQ_64BIT=uint64_t -DRC4_INT=unsigned -fixedformalarray -D"ENGINE=unsigned" -D"RSA=unsigned" -D"DSA=unsigned" -D"EVP_PKEY=unsigned" -D"EVP_MD=unsigned" -D"SSL=unsigned" -D"SSL_CTX=unsigned" -D"X509=unsigned" -D"RC4_KEY=unsigned" -D"EVP_MD_CTX=unsigned" +# compat with NetBSD +ifeq "$(shell uname)" "NetBSD" +LINTFLAGS+="-D__RENAME(x)=" -D_NETINET_IN_H_ +endif +# compat with OpenBSD +LINTFLAGS+="-Dsigset_t=long" +# FreeBSD8 +LINTFLAGS+="-D__uint16_t=uint16_t" +LINTFLAGS+=-D__signed__=signed OBJ=drill.o drill_util.o error.o root.o work.o chasetrace.o dnssec.o securetrace.o SRC=$(OBJ:.o=.c) @@ -97,7 +109,7 @@ uninstall: lint: @for i in $(SRC) ; do \ - $(LINT) $(LINTFLAGS) -I$(srcdir) $(srcdir)/$$i ; \ + $(LINT) $(LINTFLAGS) $(CPPFLAGS) -I$(srcdir) $(srcdir)/$$i ; \ if [ $$? -ne 0 ] ; then exit 1 ; fi ; \ done diff --git a/examples/Makefile.in b/examples/Makefile.in index c7d7e9c6..60102fea 100644 --- a/examples/Makefile.in +++ b/examples/Makefile.in @@ -29,8 +29,19 @@ LINK = $(libtool) --tag=CC --quiet --mode=link $(CC) $(CFLAGS) $(LDFLAGS) $(LIB LINK_STATIC = $(libtool) --tag=CC --quiet --mode=link $(CC) $(CFLAGS) -static $(LDFLAGS) $(LIBS) $(RUNTIME_PATH) LINT = splint -LINTFLAGS = +quiet -weak -warnposix -unrecog -formatcode -Din_addr_t=uint32_t -Du_int=unsigned -Du_char=uint8_t -D__u16=uint16_t -D__u32=uint32_t -preproc -D__signed__=signed -fixedformalarray - +LINTFLAGS=+quiet -weak -warnposix -unrecog -Din_addr_t=uint32_t -Du_int=unsigned -Du_char=uint8_t -preproc -Drlimit=rlimit64 -D__gnuc_va_list=va_list +#-Dglob64=glob -Dglobfree64=globfree +# compat with openssl linux edition. +LINTFLAGS+="-DBN_ULONG=unsigned long" -Dkrb5_int32=int "-Dkrb5_ui_4=unsigned int" -DPQ_64BIT=uint64_t -DRC4_INT=unsigned -fixedformalarray -D"ENGINE=unsigned" -D"RSA=unsigned" -D"DSA=unsigned" -D"EVP_PKEY=unsigned" -D"EVP_MD=unsigned" -D"SSL=unsigned" -D"SSL_CTX=unsigned" -D"X509=unsigned" -D"RC4_KEY=unsigned" -D"EVP_MD_CTX=unsigned" +# compat with NetBSD +ifeq "$(shell uname)" "NetBSD" +LINTFLAGS+="-D__RENAME(x)=" -D_NETINET_IN_H_ +endif +# compat with OpenBSD +LINTFLAGS+="-Dsigset_t=long" +# FreeBSD8 +LINTFLAGS+="-D__uint16_t=uint16_t" +LINTFLAGS+=-D__signed__=signed HEADER = config.h MAIN_SOURCES = ldns-read-zone.c \ diff --git a/test/05-nm.tpkg b/test/05-nm.tpkg index d012c22f..5c6bc998 100644 Binary files a/test/05-nm.tpkg and b/test/05-nm.tpkg differ diff --git a/test/12.unit-tests-dnssec.tpkg b/test/12.unit-tests-dnssec.tpkg index b66f7d90..0cfee883 100644 Binary files a/test/12.unit-tests-dnssec.tpkg and b/test/12.unit-tests-dnssec.tpkg differ diff --git a/test/14-drill-random.tpkg b/test/14-drill-random.tpkg index 0c583159..bda46849 100644 Binary files a/test/14-drill-random.tpkg and b/test/14-drill-random.tpkg differ diff --git a/test/14-unit-tests-base.tpkg b/test/14-unit-tests-base.tpkg index c8be6f2a..93dc15e0 100644 Binary files a/test/14-unit-tests-base.tpkg and b/test/14-unit-tests-base.tpkg differ diff --git a/test/18-drill-tests1.tpkg b/test/18-drill-tests1.tpkg index 0aa0460f..4dbbd8a3 100644 Binary files a/test/18-drill-tests1.tpkg and b/test/18-drill-tests1.tpkg differ diff --git a/test/19-keygen.tpkg b/test/19-keygen.tpkg index dce7db13..b6d372d4 100644 Binary files a/test/19-keygen.tpkg and b/test/19-keygen.tpkg differ diff --git a/test/19.unit-tests-rrtypes.tpkg b/test/19.unit-tests-rrtypes.tpkg index f7da73ed..cd0b51e8 100644 Binary files a/test/19.unit-tests-rrtypes.tpkg and b/test/19.unit-tests-rrtypes.tpkg differ diff --git a/test/20-sign-zone.tpkg b/test/20-sign-zone.tpkg index 7a69f8c8..70823ecc 100644 Binary files a/test/20-sign-zone.tpkg and b/test/20-sign-zone.tpkg differ diff --git a/util.c b/util.c index 5870bb6e..eb24f81d 100644 --- a/util.c +++ b/util.c @@ -111,7 +111,7 @@ ldns_set_bit(uint8_t *byte, int bit_nr, bool value) if (value) { *byte = *byte | (0x01 << bit_nr); } else { - *byte = *byte & !(0x01 << bit_nr); + *byte = *byte & ~(0x01 << bit_nr); } } }