Commit graph

966 commits

Author SHA1 Message Date
Ondřej Surý
288f5a4b52 Various little fixes found by coccinelle
The coccinellery repository provides many little semantic patches to fix common
problems in the code.  The number of semantic patches in the coccinellery
repository is high and most of the semantic patches apply only for Linux, so it
doesn't make sense to run them on regular basis as the processing takes a lot of
time.

The list of issue found in BIND 9, by no means complete, includes:

- double assignment to a variable
- `continue` at the end of the loop
- double checks for `NULL`
- useless checks for `NULL` (cannot be `NULL`, because of earlier return)
- using `0` instead of `NULL`
- useless extra condition (`if (foo) return; if (!foo) { ...; }`)
- removing & in front of static functions passed as arguments
2019-10-01 16:48:55 +02:00
Ondřej Surý
c2dad0dcb2 Replace RUNTIME_CHECK(dns_name_copy(..., NULL)) with dns_name_copynf()
Use the semantic patch from the previous commit to replace all the calls to
dns_name_copy() with NULL as third argument with dns_name_copynf().
2019-10-01 10:43:26 +10:00
Ondřej Surý
89b269b0d2 Add RUNTIME_CHECK() around result = dns_name_copy(..., NULL) calls
This second commit uses second semantic patch to replace the calls to
dns_name_copy() with NULL as third argument where the result was stored in a
isc_result_t variable.  As the dns_name_copy(..., NULL) cannot fail gracefully
when the third argument is NULL, it was just a bunch of dead code.

Couple of manual tweaks (removing dead labels and unused variables) were
manually applied on top of the semantic patch.
2019-10-01 10:43:26 +10:00
Ondřej Surý
35bd7e4da0 Add RUNTIME_CHECK() around plain dns_name_copy(..., NULL) calls using spatch
This commit add RUNTIME_CHECK() around all simple dns_name_copy() calls where
the third argument is NULL using the semantic patch from the previous commit.
2019-10-01 10:43:26 +10:00
Michał Kępień
0476e8f1ac Make VS solution upgrading unnecessary
Until now, the build process for BIND on Windows involved upgrading the
solution file to the version of Visual Studio used on the build host.
Unfortunately, the executable used for that (devenv.exe) is not part of
Visual Studio Build Tools and thus there is no clean way to make that
executable part of a Windows Server container.

Luckily, the solution upgrade process boils down to just adding XML tags
to Visual Studio project files and modifying certain XML attributes - in
files which we pregenerate anyway using win32utils/Configure.  Thus,
extend win32utils/Configure with three new command line parameters that
enable it to mimic what "devenv.exe bind9.sln /upgrade" does.  This
makes the devenv.exe build step redundant and thus facilitates building
BIND in Windows Server containers.
2019-09-26 15:11:15 +02:00
Mark Andrews
b59fe46e76 address or suppress cppcheck warnings 2019-09-12 17:59:28 +10:00
Ondřej Surý
4957255d13 Use the semantic patch to change the usage isc_mem_create() to new API 2019-09-12 09:26:09 +02:00
Ondřej Surý
50e109d659 isc_event_allocate() cannot fail, remove the fail handling blocks
isc_event_allocate() calls isc_mem_get() to allocate the event structure.  As
isc_mem_get() cannot fail softly (e.g. it never returns NULL), the
isc_event_allocate() cannot return NULL, hence we remove the (ret == NULL)
handling blocks using the semantic patch from the previous commit.
2019-08-30 08:55:34 +02:00
Tinderbox User
1b9b826518 prep 9.15.3 2019-08-12 14:08:12 +00:00
Evan Hunt
f9c07c78bc remove DLV support from dnssec-signzone 2019-08-09 09:18:02 -07:00
Evan Hunt
3a19e9ea19 remove DLV support from dnssec-dsfromkey 2019-08-09 09:18:02 -07:00
Evan Hunt
664b8f04f5 add -q to getopt flags, and use newlines consistently with report() 2019-07-31 10:05:52 +02:00
Evan Hunt
022649abc3 document -q option in dnssec-signzone and dnssec-verify man pages 2019-07-31 10:05:52 +02:00
Ondřej Surý
fd00bac736 Add -q (quiet) option to dnssec-signzone and dnssec-verify tool
With the move of the normal output to stdout, we need a way how to silence the
extra output, so the signed file name can be captured in a simple way.  This
commit adds `-q` command line option that will silence all the normal output
that get's printed from both tools.
2019-07-31 10:05:52 +02:00
Ondřej Surý
ced15edea1 Change the zoneverify.c to print the information to user supplied function
The lib/dns/zoneverify.c output was hardwired to stderr, which was inconsistent
with lib/dns/dnssec.c.  This commit changes zoneverify.c to print the normal run
information to caller supplied function - same model as in the lib/dns/dnssec.c.
2019-07-31 10:05:52 +02:00
Ondřej Surý
90f4c1c5a2 Use stdout to print information about signing
Previously, the default output from the libdns library went to stderr by
default.  This was inconsistent with the rest of the output.  This commit
changes the default logging to go to stdout, with notable exception - when the
output of the signing process goes to stdout, the messages are printed to the
stderr.  This is consistent with other functions that output information about
the signing process - e.g. print_stats().
2019-07-31 10:05:51 +02:00
Ondřej Surý
9bdc24a9fd Use coccinelle to cleanup the failure handling blocks from isc_mem_strdup 2019-07-23 15:32:36 -04:00
Ondřej Surý
601cb4e4cc Use coccinelle to cleanup the failure handling blocks from isc_mem_allocate 2019-07-23 15:32:35 -04:00
Ondřej Surý
ae83801e2b Remove blocks checking whether isc_mem_get() failed using the coccinelle 2019-07-23 15:32:35 -04:00
Tinderbox User
2e637325ed prep 9.15.2 2019-07-10 14:59:47 +00:00
Witold Kręcicki
e56cc07f50 Fix a few broken atomics initializations 2019-07-09 16:11:14 +02:00
Ondřej Surý
b104a9bc50 bin/dnssec/dnssec-signzone.c: Protect global variables by making them atomic
Both global shuttingdown and finished bool variables were prone to data race
(as reported by ThreadSanitizer).  The commit makes them both atomic.
2019-07-03 00:05:34 -04:00
Evan Hunt
fea6b5bf10 add a search for GeoIP2 libraries in configure
- "--with-geoip" is used to enable the legacy GeoIP library.
- "--with-geoip2" is used to enable the new GeoIP2 library
  (libmaxminddb), and is on by default if the library is found.
- using both "--with-geoip" and "--with-geoip2" at the same time
  is an error.
- an attempt is made to determine the default GeoIP2 database path at
  compile time if pkg-config is able to report the module prefix. if
  this fails, it will be necessary to set the path in named.conf with
  geoip-directory
- Makefiles have been updated, and a stub lib/dns/geoip2.c has been
  added for the eventual GeoIP2 search implementation.
2019-06-27 14:58:13 -07:00
Ondřej Surý
5d1e7be582 Rename OPENSSL_INCLUDES to OPENSSL_CFLAGS in AX_CHECK_OPENSSL() macro
The ax_check_openssl m4 macro used OPENSSL_INCLUDES.  Rename the
subst variable to OPENSSL_CFLAGS and wrap AX_CHECK_OPENSSL() in
action-if-not-found part of PKG_CHECK_MODULE check for libcrypto.
2019-06-25 12:36:01 +02:00
Ondřej Surý
e3e6888946 Make the usage of json-c objects opaque to the caller
The json-c have previously leaked into the global namespace leading
to forced -I<include_path> for every compilation unit using isc/xml.h
header.  This MR fixes the usage making the caller object opaque.
2019-06-25 12:04:20 +02:00
Ondřej Surý
0771dd3be8 Make the usage of libxml2 opaque to the caller
The libxml2 have previously leaked into the global namespace leading
to forced -I<include_path> for every compilation unit using isc/xml.h
header.  This MR fixes the usage making the caller object opaque.
2019-06-25 12:01:32 +02:00
Tony Finch
24f23e7fad Use 2048 bits as the default ZSK RSA key size in dnssec-keygen 2019-06-19 19:39:21 -07:00
Ondřej Surý
4d2d3b49ce Cleanup the way we detect json-c library to use only pkg-config 2019-05-29 15:08:52 +02:00
Tinderbox User
25e416fb67 prep 9.15.0 2019-05-10 04:39:43 +00:00
Tony Finch
d8f2eb249a Deprecate SHA-1 DS digests in dnssec-signzone
This affects two cases:

  * When writing a `dsset` file for this zone, to be used by its
    parent, only write a SHA-256 DS record.

  * When reading a `keyset` file for a child, to generate DS records
    to include in this zone, generate SHA-256 DS records only.

This change does not affect digests used in CDS records.

This is for conformance with the DS/CDS algorithm requirements in
https://tools.ietf.org/html/draft-ietf-dnsop-algorithm-update
2019-05-08 18:17:55 -07:00
Tony Finch
796a6c4e4e Deprecate SHA-1 in dnssec-dsfromkey
This makes the `-12a` options to `dnssec-dsfromkey` work more like
`dnssec-cds`, in that you can specify more than one digest and you
will get multiple records. (Previously you could only get one
non-default digest type at a time.)

The default is now `-2`. You can get the old behaviour with `-12`.

Tests and tools that use `dnssec-dsfromkey` have been updated to use
`-12` where necessary.

This is for conformance with the DS/CDS algorithm requirements in
https://tools.ietf.org/html/draft-ietf-dnsop-algorithm-update
2019-05-08 18:17:55 -07:00
Tony Finch
a177b07da1 bin/dnssec: move a little boilerplate into shared code 2019-05-08 18:17:55 -07:00
Tony Finch
acc3fa04b7 A bit more cleanup in the dnssec-keygen manual
Remove another remnant of shared secret HMAC-MD5 support.

Explain that with currently recommended setups DNSKEY records are
inserted automatically, but you can still use $INCLUDE in other cases.
2019-03-14 13:22:01 +11:00
Ondřej Surý
a04a390195 Convert *.vcxproj.user to CRLF line endings 2019-03-08 18:01:48 +01:00
Ondřej Surý
c2637c8429 Use ForcedIncludeFiles directive to include config.h everywhere automatically 2019-03-08 17:14:38 +01:00
Ondřej Surý
78d0cb0a7d Use coccinelle to remove explicit '#include <config.h>' from the source files 2019-03-08 15:15:05 +01:00
Tony Finch
0f219714e1 cleanup: use dns_secalg_t and dns_dsdigest_t where appropriate
Use them in structs for various rdata types where they are missing.
This doesn't change the structs since we are replacing explicit
uint8_t field types with aliases for uint8_t.

Use dns_dsdigest_t in library function arguments.

Improve dnssec-cds with these more specific types.
2019-03-08 18:37:50 +11:00
Tony Finch
1954f8d2bf cleanup dnssec-keygen manual page
Alphabetize options and synopsis; remove spurious -z from synopsis;
remove remnants of deprecated -k option; remove mention of long-gone
TSIG support; refer to -T KEY in options that are only relevant to
pre-RFC3755 DNSSEC; remove unnecessary -n ZONE from the example, and
add a -f KSK example.
2019-03-06 13:24:56 -08:00
Tinderbox User
b4d3f78293 prep 9.13.6 2019-02-06 22:13:05 +00:00
Tony Finch
2e173bbd24 cleanup: allow building DS directly from CDNSKEY
Relax an assertion in lib/dns/ds.c so that dnssec-cds does
not have to work around it. This will also be useful for
dnssec-dsfromkey.
2019-02-05 22:57:13 -05:00
Tony Finch
f7b2bd304e cleanup: fix dnssec-revoke help text
Correct alignment and alphabetize
2019-02-05 22:51:30 -05:00
Tony Finch
6ca8e130ac cleanup: revamp the dnssec-dsfromkey man page and help output
* Alphabetize the option lists in the man page and help text

* Make the synopses more consistent between the man page and help
  text, in particular the number of different modes

* Group mutually exclusive options in the man page synopses, and order
  options so that it is more clear which are available in every mode

* Expand the DESCRIPTION to provide an overview of the output modes
  and input modes

* Improve cross-references between options

* Leave RFC citations to the SEE ALSO section, and clarify which RFC
  specifies what

* Clarify list of digest algorithms in dnssec-dsfromkey and dnssec-cds
  man pages
2019-02-05 19:02:18 -08:00
Evan Hunt
1bc0ab5217 complete the set of tools available in windows tests
- dnssec-cds wasn't being built for windows
- nsec3hash was available, but the NSEC3HASH variable wasn't
  set in conf.sh.win32
2019-01-25 00:44:11 -08:00
Mark Andrews
c69ad95238 indenting 2019-01-02 10:56:59 +11:00
Mark Andrews
dc64b70616 update copyrights 2019-01-02 10:20:43 +11:00
Ondřej Surý
e69dc0dbc7 Remove RSAMD5 support 2018-12-11 11:32:24 +01:00
Tinderbox User
5bd855251c prep 9.13.5 2018-12-07 03:41:19 +00:00
Matthijs Mekking
0737079824 Replace some more DSA examples with ECDSAP256SHA256
(cherry picked from commit 5f27dc35df7651be8bfd24138c2ccd6fd28806af)
2018-12-06 14:47:05 +01:00
Matthijs Mekking
7ef858f503 Remove one more GOST reference
We can remove this, because it is used in `strtodsdigest` but that
already no longer covers the algorithm name "GOST".

There is one more GOST reference in `bin/python/isc/checkds.py.in`
but that is used for presentation format and probably should stay.

(cherry picked from commit 57d44fbc628d3c7dafdd545f6b83dbdcdc39a986)
2018-12-06 14:47:05 +01:00
Witold Kręcicki
929ea7c2c4 - Make isc_mutex_destroy return void
- Make isc_mutexblock_init/destroy return void
- Minor cleanups
2018-11-22 11:52:08 +00:00