Compare commits
74
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6c0747fc2b | ||
|
|
ac67436758 | ||
|
|
2fd5ba6507 | ||
|
|
e51c8613e4 | ||
|
|
df26656e4b | ||
|
|
2a8c0282da | ||
|
|
62c448beaf | ||
|
|
8452404bd7 | ||
|
|
f6d7b8c20d | ||
|
|
3e743da1bd | ||
|
|
aa811801cb | ||
|
|
e4d30cb007 | ||
|
|
2e748ba397 | ||
|
|
be8c589f28 | ||
|
|
ba2376b9e0 | ||
|
|
99ca842e0a | ||
|
|
8d15bef0dd | ||
|
|
d5350db5bc | ||
|
|
8e43f5e860 | ||
|
|
f85bb0691c | ||
|
|
b01d26c608 | ||
|
|
4005cc3864 | ||
|
|
8b75833aaa | ||
|
|
53f229f499 | ||
|
|
915616a34e | ||
|
|
dd29e2550c | ||
|
|
80d69ba04c | ||
|
|
7ae055cef1 | ||
|
|
7e49689746 | ||
|
|
9d446142d8 | ||
|
|
3429c35f52 | ||
|
|
9b93e5d684 | ||
|
|
73dd849655 | ||
|
|
7dc8e720ff | ||
|
|
031ee9e279 | ||
|
|
d7f7014803 | ||
|
|
a238f37239 | ||
|
|
3c492b3ef1 | ||
|
|
a92d973430 | ||
|
|
6c7e50c267 | ||
|
|
9bb966d579 | ||
|
|
262b52a154 | ||
|
|
eeb8b80547 | ||
|
|
c59ab04f6f | ||
|
|
191887ef2b | ||
|
|
f9aba90342 | ||
|
|
eb0d5a9526 | ||
|
|
c8538c50b4 | ||
|
|
790476332e | ||
|
|
88ad7b85e6 | ||
|
|
c2dcd95966 | ||
|
|
852a2d834f | ||
|
|
fd126553d4 | ||
|
|
1532a34658 | ||
|
|
a53a0a8df1 | ||
|
|
439fe9bc3c | ||
|
|
ba6af6d507 | ||
|
|
0b2555e8cf | ||
|
|
f9537a6f2a | ||
|
|
c9f019c931 | ||
|
|
fec73c7e79 | ||
|
|
a69afb37e0 | ||
|
|
e151eb3aa3 | ||
|
|
1e043a011b | ||
|
|
cde7f982eb | ||
|
|
5a4076fc40 | ||
|
|
82e9287459 | ||
|
|
46fcd927e7 | ||
|
|
e4c82fc7ae | ||
|
|
a43bb41909 | ||
|
|
a25f49f153 | ||
|
|
38cb43bc86 | ||
|
|
e3eb55fd1c | ||
|
|
04d8fc0143 |
@@ -1,6 +1,8 @@
|
||||
*.sln.in eol=crlf
|
||||
*.vcxproj.* eol=crlf
|
||||
|
||||
/fuzz/dns_rdata_fromwire_text.in/input-* -text
|
||||
|
||||
.gitignore export-ignore
|
||||
/conftools export-ignore
|
||||
/doc/design export-ignore
|
||||
|
||||
+39
-1
@@ -248,7 +248,7 @@ stages:
|
||||
- *setup_softhsm
|
||||
script:
|
||||
- cd bin/tests/system
|
||||
- make -j${TEST_PARALLEL_JOBS:-1} -k check V=1 || make -j${TEST_PARALLEL_JOBS:-1} -k recheck V=1
|
||||
- make -j${TEST_PARALLEL_JOBS:-1} -k check V=1
|
||||
after_script:
|
||||
- cat bin/tests/system/test-suite.log
|
||||
|
||||
@@ -709,6 +709,7 @@ gcc:tarball:
|
||||
- job: tarball-create
|
||||
artifacts: true
|
||||
only:
|
||||
- schedules
|
||||
- tags
|
||||
|
||||
system:gcc:tarball:
|
||||
@@ -721,6 +722,7 @@ system:gcc:tarball:
|
||||
- job: gcc:tarball
|
||||
artifacts: true
|
||||
only:
|
||||
- schedules
|
||||
- tags
|
||||
|
||||
unit:gcc:tarball:
|
||||
@@ -732,6 +734,7 @@ unit:gcc:tarball:
|
||||
- job: gcc:tarball
|
||||
artifacts: true
|
||||
only:
|
||||
- schedules
|
||||
- tags
|
||||
|
||||
# Jobs for regular GCC builds on Debian "sid" (i386)
|
||||
@@ -1291,6 +1294,7 @@ abi-check:
|
||||
variables:
|
||||
CC: gcc
|
||||
CFLAGS: "${CFLAGS_COMMON} -Og"
|
||||
EXTRA_CONFIGURE: "--enable-dnstap --with-libidn2"
|
||||
BIND_BASELINE_VERSION: v9_17_3
|
||||
script:
|
||||
- *configure
|
||||
@@ -1311,3 +1315,37 @@ abi-check:
|
||||
only:
|
||||
- main@isc-projects/bind9
|
||||
- /^v9_[1-9][0-9]$/@isc-projects/bind9
|
||||
|
||||
gcov:
|
||||
<<: *base_image
|
||||
stage: build
|
||||
needs:
|
||||
- job: autoreconf
|
||||
artifacts: true
|
||||
variables:
|
||||
CC: gcc
|
||||
CFLAGS: "${CFLAGS_COMMON} --coverage -O0"
|
||||
EXTRA_CONFIGURE: "--enable-dnstap --with-libidn2"
|
||||
script:
|
||||
- *configure
|
||||
- *setup_interfaces
|
||||
- *setup_softhsm
|
||||
- make -j${BUILD_PARALLEL_JOBS:-1} -k all V=1
|
||||
- make -j${TEST_PARALLEL_JOBS:-1} -k unit V=1 || true
|
||||
- make -C bin/tests/system -j${TEST_PARALLEL_JOBS:-1} -k check V=1 || cat bin/tests/system/test-suite.log
|
||||
# *.gcno and *.gcda files generated for shared library objects are created
|
||||
# in directories in which gcovr is unable to process them properly
|
||||
# (.../.libs/...). Move such *.gcno and *.gcda files one level higher.
|
||||
- find . -regex ".*/\.libs/.*\.\(gcda\|gcno\)" -execdir mv "{}" .. \;
|
||||
# Help gcovr process the nasty tricks in lib/dns/code.h, where we include C
|
||||
# source files from lib/dns/rdata/*/, using an even nastier trick.
|
||||
- find lib/dns/rdata/* -name "*.c" -execdir cp -f "{}" ../../ \;
|
||||
- gcovr --root . --exclude-directories bin/tests --exclude-directories doc --exclude-directories libltdl --exclude-directories lib/samples --exclude 'lib/.*/tests/.*' --html-details -o coverage.html
|
||||
- gcovr --root . --exclude-directories bin/tests --exclude-directories doc --exclude-directories libltdl --exclude-directories lib/samples --exclude 'lib/.*/tests/.*' -o coverage.txt
|
||||
- tail -n 3 coverage.txt
|
||||
artifacts:
|
||||
paths:
|
||||
- coverage*.html
|
||||
only:
|
||||
- main@isc-projects/bind9
|
||||
- /^v9_[1-9][0-9]$/@isc-projects/bind9
|
||||
|
||||
@@ -1,3 +1,25 @@
|
||||
5490. [func] Refactor the readline support to use pkg-config and
|
||||
add support for editline library. [GL !3942]
|
||||
|
||||
5489. [bug] Named failed to reject some invalid records resulting
|
||||
in records that, after being printed, could not be
|
||||
loaded or would result in DNSSEC validation failures
|
||||
when re-read from zone files as the wire format
|
||||
differed. The covered records records are: CERT,
|
||||
IPSECKEY, NSEC3, NSEC3PARAM, NXT, SIG, TLSA, WKS, and
|
||||
X25. [GL !3953]
|
||||
|
||||
5488. [bug] nta needed to have a weak reference on view to prevent
|
||||
the view being deleted while nta tests are being
|
||||
performed. [GL #2067]
|
||||
|
||||
5487. [cleanup] Update managed keys log messages to be less confusing.
|
||||
[GL #2027]
|
||||
|
||||
5486. [func] Add 'rndc dnssec -checkds' command to tell named
|
||||
that the DS record has been published in the parent.
|
||||
[GL #1613]
|
||||
|
||||
5485. [placeholder]
|
||||
|
||||
5484. [func] Expire the 0 TTL RRSet quickly rather using them for
|
||||
|
||||
@@ -33,6 +33,11 @@ LIBISC_CFLAGS += \
|
||||
$(LIBXML2_CFLAGS)
|
||||
endif HAVE_LIBXML2
|
||||
|
||||
if HAVE_READLINE
|
||||
LIBISC_CFLAGS += \
|
||||
$(READLINE_CFLAGS)
|
||||
endif HAVE_READLINE
|
||||
|
||||
LIBISC_LIBS = $(top_builddir)/lib/isc/libisc.la
|
||||
|
||||
LIBDNS_CFLAGS = \
|
||||
|
||||
@@ -28,7 +28,7 @@ tsig-keygen, ddns-confgen - TSIG key generation tool
|
||||
|
||||
Synopsis
|
||||
~~~~~~~~
|
||||
:program:`tsig-keygen` [**-a** algorithm] [**-h**] [**-r** randomfile] [**-s** name]
|
||||
:program:`tsig-keygen` [**-a** algorithm] [**-h**] [**-r** randomfile] [name]
|
||||
|
||||
:program:`ddns-confgen` [**-a** algorithm] [**-h**] [**-k** keyname] [**-q**] [**-r** randomfile] [**-s** name] [**-z** zone]
|
||||
|
||||
|
||||
+7
-3
@@ -25,6 +25,10 @@ libdighost_la_SOURCES = \
|
||||
|
||||
bin_PROGRAMS = dig host nslookup
|
||||
|
||||
nslookup_LDADD = \
|
||||
$(LDADD) \
|
||||
$(READLINE_LIB)
|
||||
nslookup_LDADD = \
|
||||
$(LDADD)
|
||||
|
||||
if HAVE_READLINE
|
||||
nslookup_LDADD += \
|
||||
$(READLINE_LIBS)
|
||||
endif HAVE_READLINE
|
||||
|
||||
+9
-35
@@ -22,6 +22,7 @@
|
||||
#include <isc/netaddr.h>
|
||||
#include <isc/parseint.h>
|
||||
#include <isc/print.h>
|
||||
#include <isc/readline.h>
|
||||
#include <isc/string.h>
|
||||
#include <isc/task.h>
|
||||
#include <isc/util.h>
|
||||
@@ -38,22 +39,6 @@
|
||||
|
||||
#include "dighost.h"
|
||||
|
||||
#if defined(HAVE_READLINE)
|
||||
#if defined(HAVE_EDIT_READLINE_READLINE_H)
|
||||
#include <edit/readline/readline.h>
|
||||
#if defined(HAVE_EDIT_READLINE_HISTORY_H)
|
||||
#include <edit/readline/history.h>
|
||||
#endif /* if defined(HAVE_EDIT_READLINE_HISTORY_H) */
|
||||
#elif defined(HAVE_EDITLINE_READLINE_H)
|
||||
#include <editline/readline.h>
|
||||
#elif defined(HAVE_READLINE_READLINE_H)
|
||||
#include <readline/readline.h>
|
||||
#if defined(HAVE_READLINE_HISTORY_H)
|
||||
#include <readline/history.h>
|
||||
#endif /* if defined(HAVE_READLINE_HISTORY_H) */
|
||||
#endif /* if defined(HAVE_EDIT_READLINE_READLINE_H) */
|
||||
#endif /* if defined(HAVE_READLINE) */
|
||||
|
||||
static bool short_form = true, tcpmode = false, tcpmode_set = false,
|
||||
identify = false, stats = true, comments = true,
|
||||
section_question = true, section_answer = true,
|
||||
@@ -848,38 +833,27 @@ do_next_command(char *input) {
|
||||
|
||||
static void
|
||||
get_next_command(void) {
|
||||
char *buf;
|
||||
char *ptr;
|
||||
char cmdlinebuf[COMMSIZE];
|
||||
char *cmdline, *ptr = NULL;
|
||||
|
||||
fflush(stdout);
|
||||
buf = isc_mem_allocate(mctx, COMMSIZE);
|
||||
isc_app_block();
|
||||
if (interactive) {
|
||||
#ifdef HAVE_READLINE
|
||||
ptr = readline("> ");
|
||||
if (ptr != NULL) {
|
||||
cmdline = ptr = readline("> ");
|
||||
if (ptr != NULL && *ptr != 0) {
|
||||
add_history(ptr);
|
||||
}
|
||||
#else /* ifdef HAVE_READLINE */
|
||||
fprintf(stderr, "> ");
|
||||
fflush(stderr);
|
||||
ptr = fgets(buf, COMMSIZE, stdin);
|
||||
#endif /* ifdef HAVE_READLINE */
|
||||
} else {
|
||||
ptr = fgets(buf, COMMSIZE, stdin);
|
||||
cmdline = fgets(cmdlinebuf, COMMSIZE, stdin);
|
||||
}
|
||||
isc_app_unblock();
|
||||
if (ptr == NULL) {
|
||||
if (cmdline == NULL) {
|
||||
in_use = false;
|
||||
} else {
|
||||
do_next_command(ptr);
|
||||
do_next_command(cmdline);
|
||||
}
|
||||
#ifdef HAVE_READLINE
|
||||
if (interactive) {
|
||||
if (ptr != NULL) {
|
||||
free(ptr);
|
||||
}
|
||||
#endif /* ifdef HAVE_READLINE */
|
||||
isc_mem_free(mctx, buf);
|
||||
}
|
||||
|
||||
ISC_NORETURN static void
|
||||
|
||||
@@ -68,7 +68,6 @@ DNSSEC-POLICY
|
||||
max-zone-ttl duration;
|
||||
parent-ds-ttl duration;
|
||||
parent-propagation-delay duration;
|
||||
parent-registration-delay duration;
|
||||
publish-safety duration;
|
||||
retire-safety duration;
|
||||
signatures-refresh duration;
|
||||
|
||||
+181
-33
@@ -89,6 +89,7 @@
|
||||
#include <dns/secalg.h>
|
||||
#include <dns/soa.h>
|
||||
#include <dns/stats.h>
|
||||
#include <dns/time.h>
|
||||
#include <dns/tkey.h>
|
||||
#include <dns/tsig.h>
|
||||
#include <dns/ttl.h>
|
||||
@@ -14497,6 +14498,23 @@ cleanup:
|
||||
return (result);
|
||||
}
|
||||
|
||||
static inline bool
|
||||
argcheck(char *cmd, const char *full) {
|
||||
size_t l;
|
||||
|
||||
if (cmd == NULL || cmd[0] != '-') {
|
||||
return (false);
|
||||
}
|
||||
|
||||
cmd++;
|
||||
l = strlen(cmd);
|
||||
if (l > strlen(full) || strncasecmp(cmd, full, l) != 0) {
|
||||
return (false);
|
||||
}
|
||||
|
||||
return (true);
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
named_server_dnssec(named_server_t *server, isc_lex_t *lex,
|
||||
isc_buffer_t **text) {
|
||||
@@ -14505,11 +14523,17 @@ named_server_dnssec(named_server_t *server, isc_lex_t *lex,
|
||||
dns_kasp_t *kasp = NULL;
|
||||
dns_dnsseckeylist_t keys;
|
||||
dns_dnsseckey_t *key;
|
||||
const char *ptr;
|
||||
char *ptr;
|
||||
const char *msg = NULL;
|
||||
/* variables for -checkds */
|
||||
bool checkds = false, dspublish = false, use_keyid = false;
|
||||
dns_keytag_t keyid = 0;
|
||||
uint8_t algorithm = 0;
|
||||
/* variables for -status */
|
||||
bool status = false;
|
||||
char output[4096];
|
||||
isc_stdtime_t now;
|
||||
isc_time_t timenow;
|
||||
isc_stdtime_t now, when;
|
||||
isc_time_t timenow, timewhen;
|
||||
const char *dir;
|
||||
|
||||
/* Skip the command name. */
|
||||
@@ -14524,43 +14548,184 @@ named_server_dnssec(named_server_t *server, isc_lex_t *lex,
|
||||
return (ISC_R_UNEXPECTEDEND);
|
||||
}
|
||||
|
||||
if (strcasecmp(ptr, "-status") != 0) {
|
||||
return (DNS_R_SYNTAX);
|
||||
}
|
||||
/* Initialize current time and key list. */
|
||||
TIME_NOW(&timenow);
|
||||
now = isc_time_seconds(&timenow);
|
||||
when = now;
|
||||
|
||||
ISC_LIST_INIT(keys);
|
||||
|
||||
if (strcasecmp(ptr, "-status") == 0) {
|
||||
status = true;
|
||||
} else if (strcasecmp(ptr, "-checkds") == 0) {
|
||||
checkds = true;
|
||||
|
||||
/* Check for options */
|
||||
for (;;) {
|
||||
ptr = next_token(lex, text);
|
||||
if (ptr == NULL) {
|
||||
msg = "Bad format";
|
||||
CHECK(ISC_R_UNEXPECTEDEND);
|
||||
} else if (argcheck(ptr, "alg")) {
|
||||
isc_consttextregion_t alg;
|
||||
ptr = next_token(lex, text);
|
||||
if (ptr == NULL) {
|
||||
msg = "No key algorithm specified";
|
||||
CHECK(ISC_R_UNEXPECTEDEND);
|
||||
}
|
||||
alg.base = ptr;
|
||||
alg.length = strlen(alg.base);
|
||||
result = dns_secalg_fromtext(
|
||||
&algorithm, (isc_textregion_t *)&alg);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
msg = "Bad algorithm";
|
||||
CHECK(DNS_R_SYNTAX);
|
||||
}
|
||||
continue;
|
||||
} else if (argcheck(ptr, "key")) {
|
||||
uint16_t id;
|
||||
ptr = next_token(lex, text);
|
||||
if (ptr == NULL) {
|
||||
msg = "No key identifier specified";
|
||||
CHECK(ISC_R_UNEXPECTEDEND);
|
||||
}
|
||||
CHECK(isc_parse_uint16(&id, ptr, 10));
|
||||
keyid = (dns_keytag_t)id;
|
||||
use_keyid = true;
|
||||
continue;
|
||||
} else if (argcheck(ptr, "when")) {
|
||||
uint32_t tw;
|
||||
ptr = next_token(lex, text);
|
||||
if (ptr == NULL) {
|
||||
msg = "No time specified";
|
||||
CHECK(ISC_R_UNEXPECTEDEND);
|
||||
}
|
||||
CHECK(dns_time32_fromtext(ptr, &tw));
|
||||
when = (isc_stdtime_t)tw;
|
||||
continue;
|
||||
} else if (ptr[0] == '-') {
|
||||
msg = "Unknown option";
|
||||
CHECK(DNS_R_SYNTAX);
|
||||
} else {
|
||||
/*
|
||||
* No arguments provided, so we must be
|
||||
* parsing "published|withdrawn".
|
||||
*/
|
||||
if (strcasecmp(ptr, "published") == 0) {
|
||||
dspublish = true;
|
||||
} else if (strcasecmp(ptr, "withdrawn") != 0) {
|
||||
CHECK(DNS_R_SYNTAX);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if (algorithm > 0 && !use_keyid) {
|
||||
msg = "Key id is required when setting algorithm";
|
||||
CHECK(DNS_R_SYNTAX);
|
||||
}
|
||||
} else {
|
||||
CHECK(DNS_R_SYNTAX);
|
||||
}
|
||||
|
||||
/* Get zone. */
|
||||
CHECK(zone_from_args(server, lex, NULL, &zone, NULL, text, false));
|
||||
if (zone == NULL) {
|
||||
msg = "Zone not found";
|
||||
CHECK(ISC_R_UNEXPECTEDEND);
|
||||
}
|
||||
|
||||
/* Trailing garbage? */
|
||||
ptr = next_token(lex, text);
|
||||
if (ptr != NULL) {
|
||||
msg = "Too many arguments";
|
||||
CHECK(DNS_R_SYNTAX);
|
||||
}
|
||||
|
||||
/* Get dnssec-policy. */
|
||||
kasp = dns_zone_getkasp(zone);
|
||||
if (kasp == NULL) {
|
||||
CHECK(putstr(text, "zone does not have dnssec-policy"));
|
||||
CHECK(putnull(text));
|
||||
msg = "Zone does not have dnssec-policy";
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
/* -status */
|
||||
TIME_NOW(&timenow);
|
||||
now = isc_time_seconds(&timenow);
|
||||
/* Get DNSSEC keys. */
|
||||
dir = dns_zone_getkeydirectory(zone);
|
||||
LOCK(&kasp->lock);
|
||||
result = dns_dnssec_findmatchingkeys(dns_zone_getorigin(zone), dir, now,
|
||||
dns_zone_getmctx(zone), &keys);
|
||||
UNLOCK(&kasp->lock);
|
||||
|
||||
if (result != ISC_R_SUCCESS && result != ISC_R_NOTFOUND) {
|
||||
goto cleanup;
|
||||
}
|
||||
LOCK(&kasp->lock);
|
||||
dns_keymgr_status(kasp, &keys, now, &output[0], sizeof(output));
|
||||
UNLOCK(&kasp->lock);
|
||||
CHECK(putstr(text, output));
|
||||
|
||||
if (status) {
|
||||
/*
|
||||
* Output the DNSSEC status of the key and signing policy.
|
||||
*/
|
||||
LOCK(&kasp->lock);
|
||||
dns_keymgr_status(kasp, &keys, now, &output[0], sizeof(output));
|
||||
UNLOCK(&kasp->lock);
|
||||
CHECK(putstr(text, output));
|
||||
} else if (checkds) {
|
||||
/*
|
||||
* Mark DS record has been seen, so it may move to the
|
||||
* rumoured state.
|
||||
*/
|
||||
char whenbuf[80];
|
||||
isc_time_set(&timewhen, when, 0);
|
||||
isc_time_formattimestamp(&timewhen, whenbuf, sizeof(whenbuf));
|
||||
|
||||
LOCK(&kasp->lock);
|
||||
if (use_keyid) {
|
||||
result = dns_keymgr_checkds_id(kasp, &keys, dir, when,
|
||||
dspublish, keyid,
|
||||
(unsigned int)algorithm);
|
||||
} else {
|
||||
result = dns_keymgr_checkds(kasp, &keys, dir, when,
|
||||
dspublish);
|
||||
}
|
||||
UNLOCK(&kasp->lock);
|
||||
|
||||
switch (result) {
|
||||
case ISC_R_SUCCESS:
|
||||
if (use_keyid) {
|
||||
char tagbuf[6];
|
||||
snprintf(tagbuf, sizeof(tagbuf), "%u", keyid);
|
||||
CHECK(putstr(text, "KSK "));
|
||||
CHECK(putstr(text, tagbuf));
|
||||
CHECK(putstr(text, ": "));
|
||||
}
|
||||
CHECK(putstr(text, "Marked DS as "));
|
||||
if (dspublish) {
|
||||
CHECK(putstr(text, "published "));
|
||||
} else {
|
||||
CHECK(putstr(text, "withdrawn "));
|
||||
}
|
||||
CHECK(putstr(text, "since "));
|
||||
CHECK(putstr(text, whenbuf));
|
||||
break;
|
||||
case ISC_R_NOTFOUND:
|
||||
CHECK(putstr(text, "No matching KSK found"));
|
||||
break;
|
||||
case ISC_R_FAILURE:
|
||||
CHECK(putstr(text,
|
||||
"Error: multiple possible KSKs found, "
|
||||
"retry command with -key id"));
|
||||
break;
|
||||
default:
|
||||
CHECK(putstr(text, "Error executing checkds command"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
CHECK(putnull(text));
|
||||
|
||||
cleanup:
|
||||
if (msg != NULL) {
|
||||
(void)putstr(text, msg);
|
||||
(void)putnull(text);
|
||||
}
|
||||
|
||||
while (!ISC_LIST_EMPTY(keys)) {
|
||||
key = ISC_LIST_HEAD(keys);
|
||||
ISC_LIST_UNLINK(keys, key, link);
|
||||
@@ -14905,23 +15070,6 @@ cleanup:
|
||||
return (result);
|
||||
}
|
||||
|
||||
static inline bool
|
||||
argcheck(char *cmd, const char *full) {
|
||||
size_t l;
|
||||
|
||||
if (cmd == NULL || cmd[0] != '-') {
|
||||
return (false);
|
||||
}
|
||||
|
||||
cmd++;
|
||||
l = strlen(cmd);
|
||||
if (l > strlen(full) || strncasecmp(cmd, full, l) != 0) {
|
||||
return (false);
|
||||
}
|
||||
|
||||
return (true);
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
named_server_nta(named_server_t *server, isc_lex_t *lex, bool readonly,
|
||||
isc_buffer_t **text) {
|
||||
|
||||
@@ -18,8 +18,12 @@ LDADD = \
|
||||
$(LIBISCCFG_LIBS) \
|
||||
$(LIBIRS_LIBS) \
|
||||
$(LIBBIND9_LIBS) \
|
||||
$(READLINE_LIB) \
|
||||
$(GSSAPI_LIBS) \
|
||||
$(KRB5_LIBS)
|
||||
|
||||
if HAVE_READLINE
|
||||
LDADD += \
|
||||
$(READLINE_LIBS)
|
||||
endif
|
||||
|
||||
bin_PROGRAMS = nsupdate
|
||||
|
||||
+8
-28
@@ -36,6 +36,7 @@
|
||||
#include <isc/portset.h>
|
||||
#include <isc/print.h>
|
||||
#include <isc/random.h>
|
||||
#include <isc/readline.h>
|
||||
#include <isc/region.h>
|
||||
#include <isc/sockaddr.h>
|
||||
#include <isc/socket.h>
|
||||
@@ -94,20 +95,6 @@
|
||||
|
||||
#include <bind9/getaddresses.h>
|
||||
|
||||
#if defined(HAVE_READLINE)
|
||||
#if defined(HAVE_EDIT_READLINE_READLINE_H)
|
||||
#include <edit/readline/readline.h>
|
||||
#if defined(HAVE_EDIT_READLINE_HISTORY_H)
|
||||
#include <edit/readline/history.h>
|
||||
#endif /* if defined(HAVE_EDIT_READLINE_HISTORY_H) */
|
||||
#elif defined(HAVE_EDITLINE_READLINE_H)
|
||||
#include <editline/readline.h>
|
||||
#else /* if defined(HAVE_EDIT_READLINE_READLINE_H) */
|
||||
#include <readline/history.h>
|
||||
#include <readline/readline.h>
|
||||
#endif /* if defined(HAVE_EDIT_READLINE_READLINE_H) */
|
||||
#endif /* if defined(HAVE_READLINE) */
|
||||
|
||||
#define MAXCMD (128 * 1024)
|
||||
#define MAXWIRE (64 * 1024)
|
||||
#define PACKETSIZE ((64 * 1024) - 1)
|
||||
@@ -2290,20 +2277,14 @@ static uint16_t
|
||||
get_next_command(void) {
|
||||
uint16_t result = STATUS_QUIT;
|
||||
char cmdlinebuf[MAXCMD];
|
||||
char *cmdline;
|
||||
char *cmdline = NULL, *ptr = NULL;
|
||||
|
||||
isc_app_block();
|
||||
if (interactive) {
|
||||
#ifdef HAVE_READLINE
|
||||
cmdline = readline("> ");
|
||||
if (cmdline != NULL) {
|
||||
add_history(cmdline);
|
||||
cmdline = ptr = readline("> ");
|
||||
if (ptr != NULL && *ptr != 0) {
|
||||
add_history(ptr);
|
||||
}
|
||||
#else /* ifdef HAVE_READLINE */
|
||||
fprintf(stdout, "> ");
|
||||
fflush(stdout);
|
||||
cmdline = fgets(cmdlinebuf, MAXCMD, input);
|
||||
#endif /* ifdef HAVE_READLINE */
|
||||
} else {
|
||||
cmdline = fgets(cmdlinebuf, MAXCMD, input);
|
||||
}
|
||||
@@ -2319,11 +2300,10 @@ get_next_command(void) {
|
||||
(void)nsu_strsep(&tmp, "\r\n");
|
||||
result = do_next_command(cmdline);
|
||||
}
|
||||
#ifdef HAVE_READLINE
|
||||
if (interactive) {
|
||||
free(cmdline);
|
||||
if (ptr != NULL) {
|
||||
free(ptr);
|
||||
}
|
||||
#endif /* ifdef HAVE_READLINE */
|
||||
|
||||
return (result);
|
||||
}
|
||||
|
||||
|
||||
@@ -169,7 +169,7 @@ install_hooks(ns_hooktable_t *hooktable, isc_mem_t *mctx,
|
||||
.action_data = inst,
|
||||
};
|
||||
|
||||
ns_hook_add(hooktable, mctx, -NS_QUERY_QCTX_INITIALIZED, &filter_init);
|
||||
ns_hook_add(hooktable, mctx, NS_QUERY_QCTX_INITIALIZED, &filter_init);
|
||||
ns_hook_add(hooktable, mctx, NS_QUERY_RESPOND_BEGIN, &filter_respbegin);
|
||||
ns_hook_add(hooktable, mctx, NS_QUERY_RESPOND_ANY_FOUND,
|
||||
&filter_respanyfound);
|
||||
|
||||
@@ -108,6 +108,12 @@ command is one of the following:\n\
|
||||
Add zone to given view. Requires allow-new-zones option.\n\
|
||||
delzone [-clean] zone [class [view]]\n\
|
||||
Removes zone from given view.\n\
|
||||
dnssec -checkds [-key id [-alg algorithm] [-when time] (published|withdrawn) zone [class [view]]\n\
|
||||
Mark the DS record for the KSK of the given zone as seen\n\
|
||||
in the parent. If the zone has multiple KSKs, select a\n\
|
||||
specific key by providing the keytag with -key id and\n\
|
||||
optionally the key's algorithm with -alg algorithm.\n\
|
||||
Requires the zone to have a dnssec-policy.\n\
|
||||
dnssec -status zone [class [view]]\n\
|
||||
Show the DNSSEC signing state for the specified zone.\n\
|
||||
Requires the zone to have a dnssec-policy.\n\
|
||||
|
||||
+15
-3
@@ -161,9 +161,21 @@ Currently supported commands are:
|
||||
|
||||
See also ``rndc addzone`` and ``rndc modzone``.
|
||||
|
||||
``dnssec`` [**-status** *zone* [*class* [*view*]]
|
||||
Show the DNSSEC signing state for the specified zone. Requires the
|
||||
zone to have a "dnssec-policy".
|
||||
``dnssec`` ( **-status** | **-checkds** [**-key** *id* [**-alg** *algorithm*]] [**-when** *time*] ( *published* | *withdrawn* )) *zone* [*class* [*view*]]
|
||||
This command allows you to interact with the "dnssec-policy" of a given
|
||||
zone.
|
||||
|
||||
``rndc dnssec -status`` show the DNSSEC signing state for the specified
|
||||
zone.
|
||||
|
||||
``rndc dnssec -checkds`` will let ``named`` know that the DS for the given
|
||||
key has been seen published into or withdrawn from the parent. This is
|
||||
required in order to complete a KSK rollover. If the ``-key id`` argument
|
||||
is specified, look for the key with the given identifier, otherwise if there
|
||||
is only one key acting as a KSK in the zone, assume the DS of that key (if
|
||||
there are multiple keys with the same tag, use ``-alg algorithm`` to
|
||||
select the correct algorithm). The time that the DS has been published or
|
||||
withdrawn is set to now, unless otherwise specified with the argument ``-when time``.
|
||||
|
||||
``dnstap`` ( **-reopen** | **-roll** [*number*] )
|
||||
This command closes and re-opens DNSTAP output files. ``rndc dnstap -reopen`` allows
|
||||
|
||||
@@ -24,7 +24,6 @@ dnssec-policy "test" {
|
||||
max-zone-ttl 86400;
|
||||
parent-ds-ttl 7200;
|
||||
parent-propagation-delay PT1H;
|
||||
parent-registration-delay P1D;
|
||||
publish-safety PT3600S;
|
||||
retire-safety PT3600S;
|
||||
signatures-refresh P3D;
|
||||
|
||||
@@ -24,7 +24,6 @@ dnssec-policy "test" {
|
||||
max-zone-ttl 86400;
|
||||
parent-ds-ttl 7200;
|
||||
parent-propagation-delay PT1H;
|
||||
parent-registration-delay P1D;
|
||||
publish-safety PT3600S;
|
||||
retire-safety PT3600S;
|
||||
signatures-refresh P3D;
|
||||
|
||||
@@ -24,5 +24,5 @@ rm -f ns*/managed-keys.bind
|
||||
rm -f ns*/*.mkeys
|
||||
rm -f ns*/zones ns*/*.db.infile
|
||||
rm -f *.created published.test* retired.test*
|
||||
rm -f rndc.dnssec.status.out.*
|
||||
rm -f rndc.dnssec.*.out.*
|
||||
rm -f python.out.*
|
||||
|
||||
@@ -45,6 +45,27 @@ zone "default.kasp" {
|
||||
dnssec-policy "default";
|
||||
};
|
||||
|
||||
/* checkds: Zone with one KSK. */
|
||||
zone "checkds-ksk.kasp" {
|
||||
type primary;
|
||||
file "checkds-ksk.kasp.db";
|
||||
dnssec-policy "checkds-ksk";
|
||||
};
|
||||
|
||||
/* checkds: Zone with two KSKs. */
|
||||
zone "checkds-doubleksk.kasp" {
|
||||
type primary;
|
||||
file "checkds-doubleksk.kasp.db";
|
||||
dnssec-policy "checkds-doubleksk";
|
||||
};
|
||||
|
||||
/* checkds: Zone with one CSK. */
|
||||
zone "checkds-csk.kasp" {
|
||||
type primary;
|
||||
file "checkds-csk.kasp.db";
|
||||
dnssec-policy "checkds-csk";
|
||||
};
|
||||
|
||||
/* Key lifetime unlimited. */
|
||||
zone "unlimited.kasp" {
|
||||
type primary;
|
||||
|
||||
@@ -36,7 +36,6 @@ dnssec-policy "enable-dnssec" {
|
||||
publish-safety PT5M;
|
||||
|
||||
parent-propagation-delay 1h;
|
||||
parent-registration-delay P1D;
|
||||
parent-ds-ttl 2h;
|
||||
|
||||
keys {
|
||||
@@ -82,7 +81,6 @@ dnssec-policy "ksk-doubleksk" {
|
||||
max-zone-ttl 1d;
|
||||
|
||||
parent-ds-ttl 3600;
|
||||
parent-registration-delay P1D;
|
||||
parent-propagation-delay PT1H;
|
||||
};
|
||||
|
||||
@@ -104,7 +102,6 @@ dnssec-policy "csk-roll" {
|
||||
max-zone-ttl P1D;
|
||||
|
||||
parent-ds-ttl 1h;
|
||||
parent-registration-delay 1d;
|
||||
parent-propagation-delay 1h;
|
||||
};
|
||||
|
||||
@@ -126,6 +123,5 @@ dnssec-policy "csk-roll2" {
|
||||
max-zone-ttl 1d;
|
||||
|
||||
parent-ds-ttl PT1H;
|
||||
parent-registration-delay P1W;
|
||||
parent-propagation-delay PT1H;
|
||||
parent-propagation-delay P1W;
|
||||
};
|
||||
|
||||
@@ -76,3 +76,30 @@ dnssec-policy "ecdsa384" {
|
||||
zsk key-directory lifetime P1Y algorithm 14 384;
|
||||
};
|
||||
};
|
||||
|
||||
dnssec-policy "checkds-ksk" {
|
||||
dnskey-ttl 303;
|
||||
|
||||
keys {
|
||||
ksk key-directory lifetime unlimited algorithm 13;
|
||||
zsk key-directory lifetime unlimited algorithm 13;
|
||||
};
|
||||
};
|
||||
|
||||
dnssec-policy "checkds-doubleksk" {
|
||||
dnskey-ttl 303;
|
||||
|
||||
keys {
|
||||
ksk key-directory lifetime unlimited algorithm 13;
|
||||
ksk key-directory lifetime unlimited algorithm 13;
|
||||
zsk key-directory lifetime unlimited algorithm 13;
|
||||
};
|
||||
};
|
||||
|
||||
dnssec-policy "checkds-csk" {
|
||||
dnskey-ttl 303;
|
||||
|
||||
keys {
|
||||
csk key-directory lifetime unlimited algorithm 13;
|
||||
};
|
||||
};
|
||||
|
||||
+213
-309
@@ -53,7 +53,7 @@ U="UNRETENTIVE"
|
||||
for zn in default rsasha1 dnssec-keygen some-keys legacy-keys pregenerated \
|
||||
rumoured rsasha1-nsec3 rsasha256 rsasha512 ecdsa256 ecdsa384 \
|
||||
dynamic dynamic-inline-signing inline-signing \
|
||||
inherit unlimited
|
||||
checkds-ksk checkds-doubleksk checkds-csk inherit unlimited
|
||||
do
|
||||
setup "${zn}.kasp"
|
||||
cp template.db.in "$zonefile"
|
||||
@@ -221,23 +221,22 @@ setup step3.enable-dnssec.autosign
|
||||
# Step 4:
|
||||
# The DS has been submitted long enough ago to become OMNIPRESENT.
|
||||
setup step4.enable-dnssec.autosign
|
||||
# DS TTL: 1 day (86400 seconds)
|
||||
# parent-registration-delay: 1 day (86400 seconds)
|
||||
# DS TTL: 2 hour (7200 seconds)
|
||||
# parent-propagation-delay: 1 hour (3600 seconds)
|
||||
# retire-safety: 20 minutes (1200 seconds)
|
||||
# Total aditional time: 98400 seconds
|
||||
# 44700 + 98400 = 143100
|
||||
TpubN="now-143100s"
|
||||
# 43800 + 98400 = 142200
|
||||
TcotN="now-142200s"
|
||||
TsbmN="now-98400s"
|
||||
# Total aditional time: 12000 seconds
|
||||
# 44700 + 12000 = 56700
|
||||
TpubN="now-56700s"
|
||||
# 43800 + 12000 = 55800
|
||||
TcotN="now-55800s"
|
||||
TsbmN="now-12000s"
|
||||
keytimes="-P ${TpubN} -P sync ${TsbmN} -A ${TpubN}"
|
||||
CSK=$($KEYGEN -k enable-dnssec -l policies/autosign.conf $keytimes $zone 2> keygen.out.$zone.1)
|
||||
$SETTIME -s -g $O -k $O $TcotN -r $O $TcotN -d $R $TsbmN -z $O $TsbmN "$CSK" > settime.out.$zone.1 2>&1
|
||||
cat template.db.in "${CSK}.key" > "$infile"
|
||||
private_type_record $zone 13 "$CSK" >> "$infile"
|
||||
$SIGNER -S -z -x -s now-1h -e now+30d -o $zone -O full -f $zonefile $infile > signer.out.$zone.1 2>&1
|
||||
setup step3.enable-dnssec.autosign
|
||||
setup step4.enable-dnssec.autosign
|
||||
|
||||
#
|
||||
# The zones at zsk-prepub.autosign represent the various steps of a ZSK
|
||||
@@ -547,7 +546,7 @@ setup step3.ksk-doubleksk.autosign
|
||||
# Tnow
|
||||
#
|
||||
# Lksk: 60d
|
||||
# Dreg: 1d
|
||||
# Dreg: N/A
|
||||
# DprpP: 1h
|
||||
# TTLds: 1h
|
||||
# retire-safety: 2d
|
||||
@@ -557,23 +556,23 @@ setup step3.ksk-doubleksk.autosign
|
||||
# publish-safety: 1d
|
||||
# IpubC: 27h
|
||||
#
|
||||
# Tact(N) = Tnow + Dreg - Lksk = now + 1d - 60d = now - 59d
|
||||
# Tret(N) = Tnow + Dreg = now + 1d
|
||||
# Trem(N) = Tnow + Dreg + Iret = now + 1d + 50h = now + 74h
|
||||
# Tact(N) = Tnow + Lksk = now - 60d = now - 60d
|
||||
# Tret(N) = now
|
||||
# Trem(N) = Tnow + Iret = now + 50h
|
||||
# Tpub(N+1) = Tnow - IpubC = now - 27h
|
||||
# Tsbm(N+1) = now
|
||||
# Tact(N+1) = Tret(N)
|
||||
# Tret(N+1) = Tnow + Dreg + Lksk = now + 1d + 60d = now + 61d
|
||||
# Trem(N+1) = Tnow + Dreg + Lksk + Iret = now + 61d + 50h
|
||||
# = now + 1464h + 50h = 1514h
|
||||
TactN="now-59d"
|
||||
TretN="now+1d"
|
||||
TremN="now+74h"
|
||||
# Tret(N+1) = Tnow + Lksk = now + 60d
|
||||
# Trem(N+1) = Tnow + Lksk + Iret = now + 60d + 50h
|
||||
# = now + 1440h + 50h = 1490h
|
||||
TactN="now-60d"
|
||||
TretN="now"
|
||||
TremN="now+50h"
|
||||
TpubN1="now-27h"
|
||||
TsbmN1="now"
|
||||
TactN1="${TretN}"
|
||||
TretN1="now+61d"
|
||||
TremN1="now+1514h"
|
||||
TretN1="now+60d"
|
||||
TremN1="now+1490h"
|
||||
ksktimes="-P ${TactN} -A ${TactN} -P sync ${TactN} -I ${TretN} -D ${TremN}"
|
||||
newtimes="-P ${TpubN1} -A ${TactN1} -P sync ${TsbmN1} -I ${TretN1} -D ${TremN1}"
|
||||
zsktimes="-P ${TactN} -A ${TactN}"
|
||||
@@ -597,7 +596,7 @@ $SIGNER -S -x -s now-1h -e now+2w -o $zone -O full -f $zonefile $infile > signer
|
||||
setup step4.ksk-doubleksk.autosign
|
||||
# According to RFC 7583:
|
||||
#
|
||||
# Tret(N) = Tsbm(N+1) + Dreg
|
||||
# Tret(N) = Tsbm(N+1)
|
||||
# Tdea(N) = Tret(N) + Iret
|
||||
# Tact(N+1) = Tret(N)
|
||||
#
|
||||
@@ -613,24 +612,24 @@ setup step4.ksk-doubleksk.autosign
|
||||
# Tnow
|
||||
#
|
||||
# Lksk: 60d
|
||||
# Dreg: 1d
|
||||
# Dreg: N/A
|
||||
# Iret: 50h
|
||||
#
|
||||
# Tact(N) = Tnow - Lksk - Iret = now - 60d - 50h
|
||||
# = now - 1440h - 50h = now - 1490h
|
||||
# Tret(N) = Tnow - Iret = now - 50h
|
||||
# Trem(N) = Tnow
|
||||
# Tpub(N+1) = Tnow - Iret - Dreg - IpubC = now - 50h - 1d - 27h
|
||||
# = now - 101h
|
||||
# Tsbm(N+1) = Tnow - Iret - Dreg = now - 50h - 1d = now - 74h
|
||||
# Tpub(N+1) = Tnow - Iret - IpubC = now - 50h - 27h
|
||||
# = now - 77h
|
||||
# Tsbm(N+1) = Tnow - Iret = now - 50h
|
||||
# Tact(N+1) = Tret(N)
|
||||
# Tret(N+1) = Tnow + Lksk - Iret = now + 60d - 50h = now + 1390h
|
||||
# Trem(N+1) = Tnow + Lksk = now + 60d
|
||||
TactN="now-1490h"
|
||||
TretN="now-50h"
|
||||
TremN="now"
|
||||
TpubN1="now-101h"
|
||||
TsbmN1="now-74h"
|
||||
TpubN1="now-77h"
|
||||
TsbmN1="now-50h"
|
||||
TactN1="${TretN}"
|
||||
TretN1="now+1390h"
|
||||
TremN1="now+60d"
|
||||
@@ -657,21 +656,21 @@ $SIGNER -S -x -s now-1h -e now+2w -o $zone -O full -f $zonefile $infile > signer
|
||||
setup step5.ksk-doubleksk.autosign
|
||||
# Subtract DNSKEY TTL from all the times (2h).
|
||||
# Tact(N) = now - 1490h - 2h = now - 1492h
|
||||
# Tret(N) = now - 52h - 2h = now - 52h
|
||||
# Tret(N) = now - 50h - 2h = now - 52h
|
||||
# Trem(N) = now - 2h
|
||||
# Tpub(N+1) = now - 101h - 2h = now - 103h
|
||||
# Tsbm(N+1) = now - 74h - 2h = now - 76h
|
||||
# Tpub(N+1) = now - 77h - 2h = now - 79h
|
||||
# Tsbm(N+1) = now - 50h - 2h = now - 52h
|
||||
# Tact(N+1) = Tret(N)
|
||||
# Tret(N+1) = now + 1390h - 2h = now + 1388h
|
||||
# Trem(N+1) = now + 60d + 2h = now + 1442h
|
||||
TactN="now-1492h"
|
||||
TretN="now-52h"
|
||||
TremN="now-2h"
|
||||
TpubN1="now-103h"
|
||||
TsbmN1="now-76h"
|
||||
TpubN1="now-79h"
|
||||
TsbmN1="now-52h"
|
||||
TactN1="${TretN}"
|
||||
TretN1="now+1388h"
|
||||
TremN1="now+1438h"
|
||||
TremN1="now+1442h"
|
||||
ksktimes="-P ${TactN} -A ${TactN} -P sync ${TactN} -I ${TretN} -D ${TremN}"
|
||||
newtimes="-P ${TpubN1} -A ${TretN} -P sync ${TsbmN1} -I ${TretN1} -D ${TremN1}"
|
||||
zsktimes="-P ${TactN} -A ${TactN}"
|
||||
@@ -694,11 +693,6 @@ $SIGNER -S -x -s now-1h -e now+2w -o $zone -O full -f $zonefile $infile > signer
|
||||
# The zones at csk-roll.autosign represent the various steps of a CSK rollover
|
||||
# (which is essentially a ZSK Pre-Publication / KSK Double-KSK rollover).
|
||||
#
|
||||
#
|
||||
# The activation time for zone signing (ZSK) is different than for chain of
|
||||
# trust validation (KSK). Therefor, for zone signing we use TactZ and TretZ
|
||||
# instead of Tact and Tret.
|
||||
#
|
||||
|
||||
# Step 1:
|
||||
# Introduce the first key. This will immediately be active.
|
||||
@@ -715,28 +709,25 @@ $SIGNER -S -z -x -s now-1h -e now+30d -o $zone -O full -f $zonefile $infile > si
|
||||
# It is time to introduce the new CSK.
|
||||
setup step2.csk-roll.autosign
|
||||
# According to RFC 7583:
|
||||
# KSK: Tpub(N+1) <= Tact(N) + Lksk - Dreg - IpubC
|
||||
# ZSK: Tpub(N+1) <= TactZ(N) + Lzsk - Ipub
|
||||
# KSK: Tpub(N+1) <= Tact(N) + Lksk - IpubC
|
||||
# ZSK: Tpub(N+1) <= Tact(N) + Lzsk - Ipub
|
||||
# IpubC = DprpC + TTLkey (+publish-safety)
|
||||
# Ipub = IpubC
|
||||
# Lcsk = Lksk = Lzsk
|
||||
#
|
||||
# Lcsk: 6mo (186d, 4464h)
|
||||
# Dreg: 1d
|
||||
# Dreg: N/A
|
||||
# DprpC: 1h
|
||||
# TTLkey: 1h
|
||||
# publish-safety: 1h
|
||||
# Ipub: 3h
|
||||
#
|
||||
# Tact(N) = Tnow - Lcsk + Ipub + Dreg = now - 186d + 3h + 1d
|
||||
# = now - 4464h + 3h + 24h = now - 4437h
|
||||
# TactZ(N) = Tnow - Lcsk + IpubC = now - 186d + 3h
|
||||
# = now - 4464h + 3h = now - 4461h
|
||||
TactN="now-4437h"
|
||||
TactZN="now-4461h"
|
||||
csktimes="-P ${TactN} -P sync ${TactZN} -A ${TactZN}"
|
||||
# Tact(N) = Tnow - Lcsk + Ipub = now - 186d + 3h
|
||||
# = now - 4464h + 3h = now - 4461h
|
||||
TactN="now-4461h"
|
||||
csktimes="-P ${TactN} -P sync ${TactN} -A ${TactN}"
|
||||
CSK=$($KEYGEN -k csk-roll -l policies/autosign.conf $csktimes $zone 2> keygen.out.$zone.1)
|
||||
$SETTIME -s -g $O -k $O $TactZN -r $O $TactZN -d $O $TactN -z $O $TactZN "$CSK" > settime.out.$zone.1 2>&1
|
||||
$SETTIME -s -g $O -k $O $TactN -r $O $TactN -d $O $TactN -z $O $TactN "$CSK" > settime.out.$zone.1 2>&1
|
||||
cat template.db.in "${CSK}.key" > "$infile"
|
||||
private_type_record $zone 13 "$CSK" >> "$infile"
|
||||
$SIGNER -S -z -x -s now-1h -e now+30d -o $zone -O full -f $zonefile $infile > signer.out.$zone.1 2>&1
|
||||
@@ -747,15 +738,15 @@ setup step3.csk-roll.autosign
|
||||
# According to RFC 7583:
|
||||
#
|
||||
# Tsbm(N+1) >= Trdy(N+1)
|
||||
# KSK: Tact(N+1) = Tsbm(N+1) + Dreg
|
||||
# ZSK: TactZ(N+1) = Tpub(N+1) + Ipub = Tsbm(N+1)
|
||||
# KSK: Tact(N+1) = Tsbm(N+1)
|
||||
# ZSK: Tact(N+1) = Tpub(N+1) + Ipub = Tsbm(N+1)
|
||||
# KSK: Iret = DprpP + TTLds (+retire-safety)
|
||||
# ZSK: IretZ = Dsgn + Dprp + TTLsig (+retire-safety)
|
||||
#
|
||||
# Lcsk: 186d
|
||||
# Dprp: 1h
|
||||
# DprpP: 1h
|
||||
# Dreg: 1d
|
||||
# Dreg: N/A
|
||||
# Dsgn: 25d
|
||||
# TTLds: 1h
|
||||
# TTLsig: 1d
|
||||
@@ -764,37 +755,29 @@ setup step3.csk-roll.autosign
|
||||
# IretZ: 26d3h
|
||||
# Ipub: 3h
|
||||
#
|
||||
# TactZ(N) = Tnow - Lcsk = now - 186d
|
||||
# TretZ(N) = now
|
||||
# Tact(N) = Tnow + Dreg - Lcsk = now + 1d - 186d = now - 185d
|
||||
# Tret(N) = Tnow + Dreg = now + 1d
|
||||
# Trem(N) = Tnow + IretZ = now + 26d3h = now + 627h
|
||||
# Tpub(N+1) = Tnow - Ipub = now - 3h
|
||||
# Tsbm(N+1) = TretZ(N)
|
||||
# TactZ(N+1) = TretZ(N)
|
||||
# TretZ(N+1) = Tnow + Lcsk = now + 186d
|
||||
# Tact(N+1) = Tret(N)
|
||||
# Tret(N+1) = Tnow + Dreg + Lcsk = now + 1d + 186d = now + 187d
|
||||
# Trem(N+1) = Tnow + Lcsk + IretZ = now + 186d + 26d3h =
|
||||
# = now + 5091h
|
||||
TactZN="now-186d"
|
||||
TretZN="now"
|
||||
TactN="now-185d"
|
||||
TretN="now+1d"
|
||||
# Tact(N) = Tnow - Lcsk = now - 186d
|
||||
# Tret(N) = now
|
||||
# Trem(N) = Tnow + IretZ = now + 26d3h = now + 627h
|
||||
# Tpub(N+1) = Tnow - Ipub = now - 3h
|
||||
# Tsbm(N+1) = Tret(N)
|
||||
# Tact(N+1) = Tret(N)
|
||||
# Tret(N+1) = Tnow + Lcsk = now + 186d = now + 186d
|
||||
# Trem(N+1) = Tnow + Lcsk + IretZ = now + 186d + 26d3h =
|
||||
# = now + 5091h
|
||||
TactN="now-186d"
|
||||
TretN="now"
|
||||
TremN="now+627h"
|
||||
TpubN1="now-3h"
|
||||
TsbmN1="now"
|
||||
TactZN1="${TsbmN1}"
|
||||
TretZN1="now+186d"
|
||||
TactN1="${TretN}"
|
||||
TretN1="now+187d"
|
||||
TretN1="now+186d"
|
||||
TremN1="now+5091h"
|
||||
csktimes="-P ${TactN} -P sync ${TactZN} -A ${TactZN} -I ${TretZN} -D ${TremN}"
|
||||
newtimes="-P ${TpubN1} -P sync ${TsbmN1} -A ${TactZN1} -I ${TretZN1} -D ${TremN1}"
|
||||
csktimes="-P ${TactN} -P sync ${TactN} -A ${TactN} -I ${TretN} -D ${TremN}"
|
||||
newtimes="-P ${TpubN1} -P sync ${TsbmN1} -A ${TactN1} -I ${TretN1} -D ${TremN1}"
|
||||
CSK1=$($KEYGEN -k csk-roll -l policies/autosign.conf $csktimes $zone 2> keygen.out.$zone.1)
|
||||
CSK2=$($KEYGEN -k csk-roll -l policies/autosign.conf $newtimes $zone 2> keygen.out.$zone.2)
|
||||
$SETTIME -s -g $H -k $O $TactZN -r $O $TactZN -d $O $TactN -z $O $TactZN "$CSK1" > settime.out.$zone.1 2>&1
|
||||
$SETTIME -s -g $O -k $R $TpubN1 -r $R $TpubN1 -d $H $TpubN1 -z $H $TpubN1 "$CSK2" > settime.out.$zone.2 2>&1
|
||||
$SETTIME -s -g $H -k $O $TactN -r $O $TactN -d $O $TactN -z $O $TactN "$CSK1" > settime.out.$zone.1 2>&1
|
||||
$SETTIME -s -g $O -k $R $TpubN1 -r $R $TpubN1 -d $H $TpubN1 -z $H $TpubN1 "$CSK2" > settime.out.$zone.2 2>&1
|
||||
# Set key rollover relationship.
|
||||
key_successor $CSK1 $CSK2
|
||||
# Sign zone.
|
||||
@@ -806,50 +789,40 @@ $SIGNER -S -z -x -s now-1h -e now+30d -o $zone -O full -f $zonefile $infile > si
|
||||
# Step 4:
|
||||
# Some time later all the ZRRSIG records should be from the new CSK, and the
|
||||
# DS should be swapped. The ZRRSIG records are all replaced after IretZ
|
||||
# (which is 26d3h). The DS is swapped after Dreg + Iret (which is 1d4h).
|
||||
# (which is 26d3h). The DS is swapped after Iret (which is 4h).
|
||||
# In other words, the DS is swapped before all zone signatures are replaced.
|
||||
setup step4.csk-roll.autosign
|
||||
# According to RFC 7583:
|
||||
# Trem(N) = TretZ(N) + IretZ
|
||||
# Tnow = Tsbm(N+1) + Dreg + Iret
|
||||
# Trem(N) = Tret(N) - Iret + IretZ
|
||||
# Tnow = Tsbm(N+1) + Iret
|
||||
#
|
||||
# Lcsk: 186d
|
||||
# Iret: 4h
|
||||
# IretZ: 26d3h
|
||||
#
|
||||
# TactZ(N) = Tnow - Iret - Dreg - Lcsk = now - 4h - 24h - 4464h
|
||||
# = now - 4492h
|
||||
# TretZ(N) = Tnow - Iret - Dreg = now - 4h - 1d = now - 28h
|
||||
# Tact(N) = Tnow - Iret - Lcsk = now - 4h - 186d = now - 4468h
|
||||
# Tret(N) = Tnow - Iret = now - 4h = now - 4h
|
||||
# Trem(N) = Tnow - Iret - Dreg + IretZ = now - 4h - 1d + 26d3h
|
||||
# = now + 24d23h = now + 599h
|
||||
# Tpub(N+1) = Tnow - Iret - Dreg - IpubC = now - 4h - 1d - 3h = now - 31h
|
||||
# Tsbm(N+1) = TretZ(N)
|
||||
# TactZ(N+1) = TretZ(N)
|
||||
# TretZ(N+1) = Tnow - Iret - Dreg + Lcsk = now - 4h - 1d + 186d
|
||||
# = now + 4436h
|
||||
# Tact(N+1) = Tret(N)
|
||||
# Tret(N+1) = Tnow - Iret + Lcsk = now + 6mo - 4h = now + 4460h
|
||||
# Trem(N+1) = Tnow - Iret - Dreg + Lcsk + IretZ = now - 4h - 1d + 186d + 26d3h
|
||||
# = now + 5063h
|
||||
TactZN="now-4492h"
|
||||
TretZN="now-28h"
|
||||
# Tact(N) = Tnow - Iret - Lcsk = now - 4h - 186d = now - 4468h
|
||||
# Tret(N) = Tnow - Iret = now - 4h = now - 4h
|
||||
# Trem(N) = Tnow - Iret + IretZ = now - 4h + 26d3h
|
||||
# = now + 623h
|
||||
# Tpub(N+1) = Tnow - Iret - IpubC = now - 4h - 3h = now - 7h
|
||||
# Tsbm(N+1) = Tret(N)
|
||||
# Tact(N+1) = Tret(N)
|
||||
# Tret(N+1) = Tnow - Iret + Lcsk = now - 4h + 186d = now + 4460h
|
||||
# Trem(N+1) = Tnow - Iret + Lcsk + IretZ = now - 4h + 186d + 26d3h
|
||||
# = now + 5087h
|
||||
TactN="now-4468h"
|
||||
TretN="now-4h"
|
||||
TremN="now+599h"
|
||||
TpubN1="now-31h"
|
||||
TsbmN1="${TretZN}"
|
||||
TactZN1="${TretZN}"
|
||||
TretZN1="now+4436h"
|
||||
TremN="now+623h"
|
||||
TpubN1="now-7h"
|
||||
TsbmN1="${TretN}"
|
||||
TactN1="${TretN}"
|
||||
TretN1="now+4460h"
|
||||
TremN1="now+5063h"
|
||||
csktimes="-P ${TactN} -P sync ${TactZN} -A ${TactZN} -I ${TretZN} -D ${TremN}"
|
||||
newtimes="-P ${TpubN1} -P sync ${TsbmN1} -A ${TactZN1} -I ${TretZN1} -D ${TremN1}"
|
||||
TremN1="now+5087h"
|
||||
csktimes="-P ${TactN} -P sync ${TactN} -A ${TactN} -I ${TretN} -D ${TremN}"
|
||||
newtimes="-P ${TpubN1} -P sync ${TsbmN1} -A ${TactN1} -I ${TretN1} -D ${TremN1}"
|
||||
CSK1=$($KEYGEN -k csk-roll -l policies/autosign.conf $csktimes $zone 2> keygen.out.$zone.1)
|
||||
CSK2=$($KEYGEN -k csk-roll -l policies/autosign.conf $newtimes $zone 2> keygen.out.$zone.2)
|
||||
$SETTIME -s -g $H -k $O $TactZN -r $O $TactZN -d $U $TsbmN1 -z $U $TsbmN1 "$CSK1" > settime.out.$zone.1 2>&1
|
||||
$SETTIME -s -g $H -k $O $TactN -r $O $TactN -d $U $TsbmN1 -z $U $TsbmN1 "$CSK1" > settime.out.$zone.1 2>&1
|
||||
$SETTIME -s -g $O -k $O $TsbmN1 -r $O $TsbmN1 -d $R $TsbmN1 -z $R $TsbmN1 "$CSK2" > settime.out.$zone.2 2>&1
|
||||
# Set key rollover relationship.
|
||||
key_successor $CSK1 $CSK2
|
||||
@@ -864,36 +837,28 @@ $SIGNER -S -z -x -s now-1h -e now+30d -o $zone -O full -f $zonefile $infile > si
|
||||
# At this time these have all become hidden.
|
||||
setup step5.csk-roll.autosign
|
||||
# Subtract DNSKEY TTL plus zone propagation delay from all the times (2h).
|
||||
# TactZ(N) = now - 4492h - 2h = now - 4494h
|
||||
# TretZ(N) = now - 28h - 2h = now - 30h
|
||||
# Tact(N) = now - 4468h - 2h = now - 4470h
|
||||
# Tret(N) = now - 4h - 2h = now - 6h
|
||||
# Trem(N) = now + 599h - 2h = now + 597h
|
||||
# Tpub(N+1) = now - 31h - 2h = now - 33h
|
||||
# Tsbm(N+1) = TretZ(N)
|
||||
# TactZ(N+1) = TretZ(N)
|
||||
# TretZ(N+1) = now + 4436h - 2h = now + 4434h
|
||||
# Tact(N+1) = Tret(N)
|
||||
# Tret(N+1) = now + 4460h - 2h = now + 4458h
|
||||
# Trem(N+1) = now + 5063h - 2h = now + 5061h
|
||||
TactZN="now-4494h"
|
||||
TretZN="now-30h"
|
||||
# Tact(N) = now - 4468h - 2h = now - 4470h
|
||||
# Tret(N) = now - 4h - 2h = now - 6h
|
||||
# Trem(N) = now + 623h - 2h = now + 621h
|
||||
# Tpub(N+1) = now - 7h - 2h = now - 9h
|
||||
# Tsbm(N+1) = Tret(N)
|
||||
# Tact(N+1) = Tret(N)
|
||||
# Tret(N+1) = now + 4460h - 2h = now + 4458h
|
||||
# Trem(N+1) = now + 5087h - 2h = now + 5085h
|
||||
TactN="now-4470h"
|
||||
TretN="now-6h"
|
||||
TremN="now+597h"
|
||||
TpubN1="now-33h"
|
||||
TsbmN1="now-30h"
|
||||
TactZN1="${TsbmN1}"
|
||||
TretZN1="now+4434h"
|
||||
TremN="now+621h"
|
||||
TpubN1="now-9h"
|
||||
TsbmN1="${TretN}"
|
||||
TactN1="${TretN}"
|
||||
TretN1="now+4458h"
|
||||
TremN1="now+5061h"
|
||||
csktimes="-P ${TactN} -P sync ${TactZN} -A ${TactZN} -I ${TretZN} -D ${TremN}"
|
||||
newtimes="-P ${TpubN1} -P sync ${TsbmN1} -A ${TactZN1} -I ${TretZN1} -D ${TremN1}"
|
||||
TremN1="now+5085h"
|
||||
csktimes="-P ${TactN} -P sync ${TactN} -A ${TactN} -I ${TretN} -D ${TremN}"
|
||||
newtimes="-P ${TpubN1} -P sync ${TsbmN1} -A ${TactN1} -I ${TretN1} -D ${TremN1}"
|
||||
CSK1=$($KEYGEN -k csk-roll -l policies/autosign.conf $csktimes $zone 2> keygen.out.$zone.1)
|
||||
CSK2=$($KEYGEN -k csk-roll -l policies/autosign.conf $newtimes $zone 2> keygen.out.$zone.2)
|
||||
$SETTIME -s -g $H -k $O $TactZN -r $U now-2h -d $H now-2h -z $U $TactZN1 "$CSK1" > settime.out.$zone.1 2>&1
|
||||
$SETTIME -s -g $O -k $O $TsbmN1 -r $O $TsbmN1 -d $O now-2h -z $R $TactZN1 "$CSK2" > settime.out.$zone.2 2>&1
|
||||
$SETTIME -s -g $H -k $O $TactN -r $U now-2h -d $H now-2h -z $U $TactN1 "$CSK1" > settime.out.$zone.1 2>&1
|
||||
$SETTIME -s -g $O -k $O $TsbmN1 -r $O $TsbmN1 -d $O now-2h -z $R $TactN1 "$CSK2" > settime.out.$zone.2 2>&1
|
||||
# Set key rollover relationship.
|
||||
key_successor $CSK1 $CSK2
|
||||
# Sign zone.
|
||||
@@ -907,45 +872,35 @@ $SIGNER -S -z -x -s now-1h -e now+30d -o $zone -O full -f $zonefile $infile > si
|
||||
# removed from the zone.
|
||||
setup step6.csk-roll.autosign
|
||||
# According to RFC 7583:
|
||||
# Trem(N) = TretZ(N) + IretZ
|
||||
# TretZ(N) = TactZ(N) + Lcsk
|
||||
# Trem(N) = Tret(N) + IretZ
|
||||
# Tret(N) = Tact(N) + Lcsk
|
||||
#
|
||||
# Lcsk: 186d
|
||||
# Iret: 4h
|
||||
# IretZ: 26d3h
|
||||
#
|
||||
# TactZ(N) = Tnow - IretZ - Lcsk = now - 627h - 186d
|
||||
# = now - 627h - 4464h = now - 5091h
|
||||
# TretZ(N) = Tnow - IretZ = now - 627h
|
||||
# Tact(N) = Tnow - IretZ - Lcsk + Dreg = now - 627h - 186d + 1d =
|
||||
# now - 627h - 4464h + 24h = now - 5067h
|
||||
# Tret(N) = Tnow - IretZ + Dreg = now - 627h + 24h
|
||||
# = Tnow - 603h
|
||||
# Trem(N) = Tnow
|
||||
# Tpub(N+1) = Tnow - IretZ - Ipub = now - 627h - 3h = now - 630h
|
||||
# Tsbm(N+1) = TretZ(N)
|
||||
# TactZ(N+1) = TretZ(N)
|
||||
# TretZ(N+1) = Tnow - IretZ + Lcsk = now - 627h + 186d = now + 3837h
|
||||
# Tact(N+1) = Tret(N)
|
||||
# Tret(N+1) = Tnow - Iret + Lcsk = now - 4h + 186d = now + 4460h
|
||||
# Trem(N+1) = Tnow + Lcsk = now + 186d
|
||||
TactZN="now-5091h"
|
||||
TretZN="now-627h"
|
||||
TactN="now-5067h"
|
||||
TretN="now-603h"
|
||||
# Tact(N) = Tnow - IretZ - Lcsk = now - 627h - 186d
|
||||
# = now - 627h - 4464h = now - 5091h
|
||||
# Tret(N) = Tnow - IretZ = now - 627h
|
||||
# Trem(N) = Tnow
|
||||
# Tpub(N+1) = Tnow - IretZ - Ipub = now - 627h - 3h = now - 630h
|
||||
# Tsbm(N+1) = Tret(N)
|
||||
# Tact(N+1) = Tret(N)
|
||||
# Tret(N+1) = Tnow - IretZ + Lcsk = now - 627h + 186d = now + 3837h
|
||||
# Trem(N+1) = Tnow + Lcsk = now + 186d
|
||||
TactN="now-5091h"
|
||||
TretN="now-627h"
|
||||
TremN="now"
|
||||
TpubN1="now-630h"
|
||||
TsbmN1="${TretZN}"
|
||||
TactZN1="${TretZN}"
|
||||
TretZN1="now+3837h"
|
||||
TsbmN1="${TretN}"
|
||||
TactN1="${TretN}"
|
||||
TretN1="now+4460h"
|
||||
TretN1="now+3837h"
|
||||
TremN1="now+186d"
|
||||
csktimes="-P ${TactN} -P sync ${TactZN} -A ${TactZN} -I ${TretZN} -D ${TremN}"
|
||||
newtimes="-P ${TpubN1} -P sync ${TsbmN1} -A ${TactZN1} -I ${TretZN1} -D ${TremN1}"
|
||||
csktimes="-P ${TactN} -P sync ${TactN} -A ${TactN} -I ${TretN} -D ${TremN}"
|
||||
newtimes="-P ${TpubN1} -P sync ${TsbmN1} -A ${TactN1} -I ${TretN1} -D ${TremN1}"
|
||||
CSK1=$($KEYGEN -k csk-roll -l policies/autosign.conf $csktimes $zone 2> keygen.out.$zone.1)
|
||||
CSK2=$($KEYGEN -k csk-roll -l policies/autosign.conf $newtimes $zone 2> keygen.out.$zone.2)
|
||||
$SETTIME -s -g $H -k $O $TactZN -r $H $TremN -d $H $TremN -z $U $TsbmN1 "$CSK1" > settime.out.$zone.1 2>&1
|
||||
$SETTIME -s -g $H -k $O $TactN -r $H $TremN -d $H $TremN -z $U $TsbmN1 "$CSK1" > settime.out.$zone.1 2>&1
|
||||
$SETTIME -s -g $O -k $O $TsbmN1 -r $O $TsbmN1 -d $O $TremN -z $R $TsbmN1 "$CSK2" > settime.out.$zone.2 2>&1
|
||||
# Set key rollover relationship.
|
||||
key_successor $CSK1 $CSK2
|
||||
@@ -959,36 +914,28 @@ $SIGNER -S -z -x -s now-1h -e now+30d -o $zone -O full -f $zonefile $infile > si
|
||||
# Some time later the predecessor DNSKEY enters the HIDDEN state.
|
||||
setup step7.csk-roll.autosign
|
||||
# Subtract DNSKEY TTL plus zone propagation delay from all the times (2h).
|
||||
# TactZ(N) = now - 5091h - 2h = now - 5093h
|
||||
# TretZ(N) = now - 627h - 2h = now - 629h
|
||||
# Tact(N) = now - 5067h - 2h = now - 5069h
|
||||
# Tret(N) = now - 603h - 2h = now - 605h
|
||||
# Tact(N) = now - 5091h - 2h = now - 5093h
|
||||
# Tret(N) = now - 627h - 2h = now - 629h
|
||||
# Trem(N) = now - 2h
|
||||
# Tpub(N+1) = now - 630h - 2h = now - 632h
|
||||
# Tsbm(N+1) = now - 627h - 2h = now - 629h
|
||||
# TactZ(N+1) = Tsbm(N+1)
|
||||
# TretZ(N+1) = now + 3837h - 2h = now + 3835h
|
||||
# Tsbm(N+1) = Tret(N)
|
||||
# Tact(N+1) = Tret(N)
|
||||
# Tret(N+1) = now + 4460h - 2h = now + 4458h
|
||||
# Tret(N+1) = now + 3837h - 2h = now + 3835h
|
||||
# Trem(N+1) = now + 186d - 2h = now + 4462h
|
||||
TactZN="now-5093h"
|
||||
TretZN="now-629h"
|
||||
TactN="now-5069h"
|
||||
TretN="now-605h"
|
||||
TactN="now-5093h"
|
||||
TretN="now-629h"
|
||||
TremN="now-2h"
|
||||
TpubN1="now-632h"
|
||||
TsbmN1="${TretZN}"
|
||||
TactZN1="${TretZN}"
|
||||
TretZN1="now+3835h"
|
||||
TsbmN1="${TretN}"
|
||||
TactN1="${TretN}"
|
||||
TretN1="now+4458h"
|
||||
TretN1="now+3835h"
|
||||
TremN1="now+4462h"
|
||||
csktimes="-P ${TactN} -P sync ${TactZN} -A ${TactZN} -I ${TretZN} -D ${TremN}"
|
||||
newtimes="-P ${TpubN1} -P sync ${TsbmN1} -A ${TactZN1} -I ${TretZN1} -D ${TremN1}"
|
||||
csktimes="-P ${TactN} -P sync ${TactN} -A ${TactN} -I ${TretN} -D ${TremN}"
|
||||
newtimes="-P ${TpubN1} -P sync ${TsbmN1} -A ${TactN1} -I ${TretN1} -D ${TremN1}"
|
||||
CSK1=$($KEYGEN -k csk-roll -l policies/autosign.conf $csktimes $zone 2> keygen.out.$zone.1)
|
||||
CSK2=$($KEYGEN -k csk-roll -l policies/autosign.conf $newtimes $zone 2> keygen.out.$zone.2)
|
||||
$SETTIME -s -g $H -k $U $TremN -r $H $TremN -d $H $TremN -z $H $TactZN1 "$CSK1" > settime.out.$zone.1 2>&1
|
||||
$SETTIME -s -g $O -k $O $TsbmN1 -r $O $TsbmN1 -d $O $TactN1 -z $O $TactZN1 "$CSK2" > settime.out.$zone.2 2>&1
|
||||
$SETTIME -s -g $H -k $U $TremN -r $H $TremN -d $H $TremN -z $H $TactN1 "$CSK1" > settime.out.$zone.1 2>&1
|
||||
$SETTIME -s -g $O -k $O $TsbmN1 -r $O $TsbmN1 -d $O $TactN1 -z $O $TactN1 "$CSK2" > settime.out.$zone.2 2>&1
|
||||
# Set key rollover relationship.
|
||||
key_successor $CSK1 $CSK2
|
||||
# Sign zone.
|
||||
@@ -1003,11 +950,6 @@ $SIGNER -S -z -x -s now-1h -e now+30d -o $zone -O full -f $zonefile $infile > si
|
||||
# This scenario differs from the above one because the zone signatures (ZRRSIG)
|
||||
# are replaced with the new key sooner than the DS is swapped.
|
||||
#
|
||||
#
|
||||
# The activation time for zone signing (ZSK) is different than for chain of
|
||||
# trust validation (KSK). Therefor, for zone signing we use TactZ and TretZ
|
||||
# instead of Tact and Tret.
|
||||
#
|
||||
|
||||
# Step 1:
|
||||
# Introduce the first key. This will immediately be active.
|
||||
@@ -1024,28 +966,25 @@ $SIGNER -S -z -x -s now-1h -e now+30d -o $zone -O full -f $zonefile $infile > si
|
||||
# It is time to introduce the new CSK.
|
||||
setup step2.csk-roll2.autosign
|
||||
# According to RFC 7583:
|
||||
# KSK: Tpub(N+1) <= Tact(N) + Lksk - Dreg - IpubC
|
||||
# ZSK: Tpub(N+1) <= TactZ(N) + Lzsk - Ipub
|
||||
# KSK: Tpub(N+1) <= Tact(N) + Lksk - IpubC
|
||||
# ZSK: Tpub(N+1) <= Tact(N) + Lzsk - Ipub
|
||||
# IpubC = DprpC + TTLkey (+publish-safety)
|
||||
# Ipub = IpubC
|
||||
# Lcsk = Lksk = Lzsk
|
||||
#
|
||||
# Lcsk: 6mo (186d, 4464h)
|
||||
# Dreg: 1w
|
||||
# Dreg: N/A
|
||||
# DprpC: 1h
|
||||
# TTLkey: 1h
|
||||
# publish-safety: 1h
|
||||
# Ipub: 3h
|
||||
#
|
||||
# Tact(N) = Tnow - Lcsk + Ipub + Dreg = now - 186d + 3h + 1w
|
||||
# = now - 4464h + 3h + 168h = now - 4293h
|
||||
# TactZ(N) = Tnow - Lcsk + IpubC = now - 186d + 3h
|
||||
# Tact(N) = Tnow - Lcsk + Ipub = now - 186d + 3h
|
||||
# = now - 4464h + 3h = now - 4461h
|
||||
TactN="now-4293h"
|
||||
TactZN="now-4461h"
|
||||
csktimes="-P ${TactN} -P sync ${TactZN} -A ${TactZN}"
|
||||
TactN="now-4461h"
|
||||
csktimes="-P ${TactN} -P sync ${TactN} -A ${TactN}"
|
||||
CSK=$($KEYGEN -k csk-roll2 -l policies/autosign.conf $csktimes $zone 2> keygen.out.$zone.1)
|
||||
$SETTIME -s -g $O -k $O $TactZN -r $O $TactZN -d $O $TactN -z $O $TactZN "$CSK" > settime.out.$zone.1 2>&1
|
||||
$SETTIME -s -g $O -k $O $TactN -r $O $TactN -d $O $TactN -z $O $TactN "$CSK" > settime.out.$zone.1 2>&1
|
||||
cat template.db.in "${CSK}.key" > "$infile"
|
||||
private_type_record $zone 13 "$CSK" >> "$infile"
|
||||
$SIGNER -S -z -x -s now-1h -e now+30d -o $zone -O full -f $zonefile $infile > signer.out.$zone.1 2>&1
|
||||
@@ -1056,54 +995,46 @@ setup step3.csk-roll2.autosign
|
||||
# According to RFC 7583:
|
||||
#
|
||||
# Tsbm(N+1) >= Trdy(N+1)
|
||||
# KSK: Tact(N+1) = Tsbm(N+1) + Dreg
|
||||
# ZSK: TactZ(N+1) = Tpub(N+1) + Ipub = Tsbm(N+1)
|
||||
# KSK: Tact(N+1) = Tsbm(N+1)
|
||||
# ZSK: Tact(N+1) = Tpub(N+1) + Ipub = Tsbm(N+1)
|
||||
# KSK: Iret = DprpP + TTLds (+retire-safety)
|
||||
# ZSK: IretZ = Dsgn + Dprp + TTLsig (+retire-safety)
|
||||
#
|
||||
# Lcsk: 186d
|
||||
# Dprp: 1h
|
||||
# DprpP: 1h
|
||||
# Dreg: 1w
|
||||
# DprpP: 1w
|
||||
# Dreg: N/A
|
||||
# Dsgn: 12h
|
||||
# TTLds: 1h
|
||||
# TTLsig: 1d
|
||||
# retire-safety: 1h
|
||||
# Iret: 3h
|
||||
# Iret: 170h
|
||||
# IretZ: 38h
|
||||
# Ipub: 3h
|
||||
#
|
||||
# TactZ(N) = Tnow - Lcsk = now - 186d
|
||||
# TretZ(N) = now
|
||||
# Tact(N) = Tnow + Dreg - Lcsk = now + 1w - 186d = now - 179d
|
||||
# Tret(N) = Tnow + Dreg = now + 7d
|
||||
# Trem(N) = Tnow + Dreg + Iret = now + 1w + 3h = now + 171h
|
||||
# Tpub(N+1) = Tnow - Ipub = now - 3h
|
||||
# Tsbm(N+1) = TretZ(N)
|
||||
# TactZ(N+1) = TretZ(N)
|
||||
# TretZ(N+1) = Tnow + Lcsk = now + 186d
|
||||
# Tact(N+1) = Tret(N)
|
||||
# Tret(N+1) = Tnow + Lcsk + Dreg = now + 186d + 7d = now + 193d
|
||||
# Trem(N+1) = Tnow + Lcsk + Dreg + Iret = now + 186d + 7d + 3h =
|
||||
# = now + 193d + 3h = now + 4632h + 3h = now + 4635h
|
||||
TactZN="now-186d"
|
||||
TretZN="now"
|
||||
TactN="now-179d"
|
||||
TretN="now+7d"
|
||||
TremN="now+171h"
|
||||
# Tact(N) = Tnow - Lcsk = now - 186d
|
||||
# Tret(N) = now
|
||||
# Trem(N) = Tnow + Iret = now + 170h
|
||||
# Tpub(N+1) = Tnow - Ipub = now - 3h
|
||||
# Tsbm(N+1) = Tret(N)
|
||||
# Tact(N+1) = Tret(N)
|
||||
# Tret(N+1) = Tnow + Lcsk = now + 186d
|
||||
# Trem(N+1) = Tnow + Lcsk + Iret = now + 186d + 170h =
|
||||
# = now + 4464h + 170h = now + 4634h
|
||||
TactN="now-186d"
|
||||
TretN="now"
|
||||
TremN="now+170h"
|
||||
TpubN1="now-3h"
|
||||
TsbmN1="${TretZN}"
|
||||
TactZN1="${TretZN}"
|
||||
TretZN1="now+186d"
|
||||
TsbmN1="${TretN}"
|
||||
TactN1="${TretN}"
|
||||
TretN1="now+193d"
|
||||
TremN1="now+4635h"
|
||||
csktimes="-P ${TactN} -P sync ${TactZN} -A ${TactZN} -I ${TretZN} -D ${TremN}"
|
||||
newtimes="-P ${TpubN1} -P sync ${TsbmN1} -A ${TactZN1} -I ${TretZN1} -D ${TremN1}"
|
||||
TretN1="now+186d"
|
||||
TremN1="now+4634h"
|
||||
csktimes="-P ${TactN} -P sync ${TactN} -A ${TactN} -I ${TretN} -D ${TremN}"
|
||||
newtimes="-P ${TpubN1} -P sync ${TsbmN1} -A ${TactN1} -I ${TretN1} -D ${TremN1}"
|
||||
CSK1=$($KEYGEN -k csk-roll2 -l policies/autosign.conf $csktimes $zone 2> keygen.out.$zone.1)
|
||||
CSK2=$($KEYGEN -k csk-roll2 -l policies/autosign.conf $newtimes $zone 2> keygen.out.$zone.2)
|
||||
$SETTIME -s -g $H -k $O $TactZN -r $O $TactZN -d $O $TactN -z $O $TactZN "$CSK1" > settime.out.$zone.1 2>&1
|
||||
$SETTIME -s -g $O -k $R $TpubN1 -r $R $TpubN1 -d $H $TpubN1 -z $H $TpubN1 "$CSK2" > settime.out.$zone.2 2>&1
|
||||
$SETTIME -s -g $H -k $O $TactN -r $O $TactN -d $O $TactN -z $O $TactN "$CSK1" > settime.out.$zone.1 2>&1
|
||||
$SETTIME -s -g $O -k $R $TpubN1 -r $R $TpubN1 -d $H $TpubN1 -z $H $TpubN1 "$CSK2" > settime.out.$zone.2 2>&1
|
||||
# Set key rollover relationship.
|
||||
key_successor $CSK1 $CSK2
|
||||
# Sign zone.
|
||||
@@ -1119,49 +1050,38 @@ $SIGNER -S -z -x -s now-1h -e now+30d -o $zone -O full -f $zonefile $infile > si
|
||||
# signatures are replaced before the DS is swapped.
|
||||
setup step4.csk-roll2.autosign
|
||||
# According to RFC 7583:
|
||||
# Trem(N) = Tret(N) + Iret
|
||||
# Tnow = TretZ(N) + IretZ
|
||||
# Trem(N) = Tret(N) + IretZ
|
||||
#
|
||||
# Lcsk: 186d
|
||||
# Dreg: 1w
|
||||
# Iret: 3h
|
||||
# Dreg: N/A
|
||||
# Iret: 170h
|
||||
# IretZ: 38h
|
||||
#
|
||||
# TactZ(N) = Tnow - IretZ = Lcsk = now - 38h - 186d
|
||||
# Tact(N) = Tnow - IretZ = Lcsk = now - 38h - 186d
|
||||
# = now - 38h - 4464h = now - 4502h
|
||||
# TretZ(N) = Tnow - IretZ = now - 38h
|
||||
# Tact(N) = Tnow - IretZ - Lcsk + Dreg = now - 38h - 4464h + 168h
|
||||
# = now - 4334h
|
||||
# Tret(N) = Tnow - IretZ + Dreg = now - 38h + 168h = now + 130h
|
||||
# Trem(N) = Tnow - IretZ + Dreg + Iret = now + 130h + 3h = now + 133h
|
||||
# Tret(N) = Tnow - IretZ = now - 38h
|
||||
# Trem(N) = Tnow - IretZ + Iret = now - 38h + 170h = now + 132h
|
||||
# Tpub(N+1) = Tnow - IretZ - IpubC = now - 38h - 3h = now - 41h
|
||||
# Tsbm(N+1) = TretZ(N)
|
||||
# TactZ(N+1) = TretZ(N)
|
||||
# TretZ(N+1) = Tnow - IretZ + Lcsk = now - 38h + 186d
|
||||
# = now + 4426h
|
||||
# Tsbm(N+1) = Tret(N)
|
||||
# Tact(N+1) = Tret(N)
|
||||
# Tret(N+1) = Tnow - IretZ + Dreg + Lcsk = now - 38h + 168h + 4464h
|
||||
# = now + 4594h
|
||||
# Trem(N+1) = Tnow - IretZ + Dreg + Lcsk + Iret
|
||||
# = now + 4594h + 3h = now + 4597h
|
||||
TactZN="now-4502h"
|
||||
TretZN="now-38h"
|
||||
TactN="now-4334h"
|
||||
TretN="now+130h"
|
||||
TremN="now+133h"
|
||||
# Tret(N+1) = Tnow - IretZ + Lcsk = now - 38h + 186d
|
||||
# = now + 4426h
|
||||
# Trem(N+1) = Tnow - IretZ + Lcsk + Iret
|
||||
# = now + 4426h + 3h = now + 4429h
|
||||
TactN="now-4502h"
|
||||
TretN="now-38h"
|
||||
TremN="now+132h"
|
||||
TpubN1="now-41h"
|
||||
TsbmN1="${TretZN}"
|
||||
TactZN1="${TretZN}"
|
||||
TretZN1="now+4426h"
|
||||
TsbmN1="${TretN}"
|
||||
TactN1="${TretN}"
|
||||
TretN1="now+4594h"
|
||||
TremN1="now+4597h"
|
||||
csktimes="-P ${TactN} -P sync ${TactZN} -A ${TactZN} -I ${TretZN} -D ${TremN}"
|
||||
newtimes="-P ${TpubN1} -P sync ${TsbmN1} -A ${TactZN1} -I ${TretZN1} -D ${TremN1}"
|
||||
TretN1="now+4426h"
|
||||
TremN1="now+4429h"
|
||||
csktimes="-P ${TactN} -P sync ${TactN} -A ${TactN} -I ${TretN} -D ${TremN}"
|
||||
newtimes="-P ${TpubN1} -P sync ${TsbmN1} -A ${TactN1} -I ${TretN1} -D ${TremN1}"
|
||||
CSK1=$($KEYGEN -k csk-roll2 -l policies/autosign.conf $csktimes $zone 2> keygen.out.$zone.1)
|
||||
CSK2=$($KEYGEN -k csk-roll2 -l policies/autosign.conf $newtimes $zone 2> keygen.out.$zone.2)
|
||||
$SETTIME -s -g $H -k $O $TactZN -r $O $TactZN -d $U $TsbmN1 -z $U $TretZN "$CSK1" > settime.out.$zone.1 2>&1
|
||||
$SETTIME -s -g $O -k $O $TsbmN1 -r $O $TsbmN1 -d $R $TsbmN1 -z $R $TactZN1 "$CSK2" > settime.out.$zone.2 2>&1
|
||||
$SETTIME -s -g $H -k $O $TactN -r $O $TactN -d $U $TsbmN1 -z $U $TretN "$CSK1" > settime.out.$zone.1 2>&1
|
||||
$SETTIME -s -g $O -k $O $TsbmN1 -r $O $TsbmN1 -d $R $TsbmN1 -z $R $TactN1 "$CSK2" > settime.out.$zone.2 2>&1
|
||||
# Set key rollover relationship.
|
||||
key_successor $CSK1 $CSK2
|
||||
# Sign zone.
|
||||
@@ -1174,37 +1094,29 @@ $SIGNER -S -z -x -s now-1h -e now+30d -o $zone -O full -f $zonefile $infile > si
|
||||
# Some time later the DS can be swapped and the old DNSKEY can be removed from
|
||||
# the zone.
|
||||
setup step5.csk-roll2.autosign
|
||||
# Subtract Dreg + Iret (171h) - IretZ (38h) = 133h.
|
||||
# Subtract Iret (170h) - IretZ (38h) = 132h.
|
||||
#
|
||||
# TactZ(N) = now - 4502h - 133h = now - 4635h
|
||||
# TretZ(N) = now - 38h - 133h = now - 171h
|
||||
# Tact(N) = now - 4334h = 133h = now - 4467h
|
||||
# Tret(N) = now + 130h - 133h = now - 3h
|
||||
# Trem(N) = now + 133h - 133h = now
|
||||
# Tpub(N+1) = now - 41h - 133h = now - 174h
|
||||
# Tsbm(N+1) = TretZ(N)
|
||||
# TactZ(N+1) = TretZ(N)
|
||||
# TretZ(N+1) = now + 4426h - 133h = now + 4293h
|
||||
# Tact(N+1) = Tret(N)
|
||||
# Tret(N+1) = now + 4594h - 133h = now + 4461h
|
||||
# Trem(N+1) = now + 4597h - 133h = now + 4464h = now + 186d
|
||||
TactZN="now-4635h"
|
||||
TretZN="now-171h"
|
||||
TactN="now-4467h"
|
||||
TretN="now-3h"
|
||||
# Tact(N) = now - 4502h - 132h = now - 4634h
|
||||
# Tret(N) = now - 38h - 132h = now - 170h
|
||||
# Trem(N) = now + 132h - 132h = now
|
||||
# Tpub(N+1) = now - 41h - 132h = now - 173h
|
||||
# Tsbm(N+1) = Tret(N)
|
||||
# Tact(N+1) = Tret(N)
|
||||
# Tret(N+1) = now + 4426h - 132h = now + 4294h
|
||||
# Trem(N+1) = now + 4492h - 132h = now + 4360h
|
||||
TactN="now-4634h"
|
||||
TretN="now-170h"
|
||||
TremN="now"
|
||||
TpubN1="now-174h"
|
||||
TsbmN1="${TretZN}"
|
||||
TactZN1="${TretZN}"
|
||||
TretZN1="now+4293h"
|
||||
TpubN1="now-173h"
|
||||
TsbmN1="${TretN}"
|
||||
TactN1="${TretN}"
|
||||
TretN1="now+4461h"
|
||||
TremN1="now+186d"
|
||||
csktimes="-P ${TactN} -P sync ${TactZN} -A ${TactZN} -I ${TretZN} -D ${TremN}"
|
||||
newtimes="-P ${TpubN1} -P sync ${TsbmN1} -A ${TactZN1} -I ${TretZN1} -D ${TremN1}"
|
||||
TretN1="now+4294h"
|
||||
TremN1="now+4360h"
|
||||
csktimes="-P ${TactN} -P sync ${TactN} -A ${TactN} -I ${TretN} -D ${TremN}"
|
||||
newtimes="-P ${TpubN1} -P sync ${TsbmN1} -A ${TactN1} -I ${TretN1} -D ${TremN1}"
|
||||
CSK1=$($KEYGEN -k csk-roll2 -l policies/autosign.conf $csktimes $zone 2> keygen.out.$zone.1)
|
||||
CSK2=$($KEYGEN -k csk-roll2 -l policies/autosign.conf $newtimes $zone 2> keygen.out.$zone.2)
|
||||
$SETTIME -s -g $H -k $O $TactZN -r $O $TactZN -d $U $TsbmN1 -z $H now-133h "$CSK1" > settime.out.$zone.1 2>&1
|
||||
$SETTIME -s -g $H -k $O $TactN -r $O $TactN -d $U $TsbmN1 -z $H now-133h "$CSK1" > settime.out.$zone.1 2>&1
|
||||
$SETTIME -s -g $O -k $O $TsbmN1 -r $O $TsbmN1 -d $R $TsbmN1 -z $O now-133h "$CSK2" > settime.out.$zone.2 2>&1
|
||||
# Set key rollover relationship.
|
||||
key_successor $CSK1 $CSK2
|
||||
@@ -1219,32 +1131,24 @@ $SIGNER -S -z -x -s now-1h -e now+30d -o $zone -O full -f $zonefile $infile > si
|
||||
setup step6.csk-roll2.autosign
|
||||
# Subtract DNSKEY TTL plus zone propagation delay (2h).
|
||||
#
|
||||
# TactZ(N) = now - 4635h - 2h = now - 4637h
|
||||
# TretZ(N) = now - 171h - 2h = now - 173h
|
||||
# Tact(N) = now - 4467h - 2h = now - 4469h
|
||||
# Tret(N) = now - 3h - 2h = now - 5h
|
||||
# Trem(N) = now - 2h
|
||||
# Tpub(N+1) = now - 174h - 2h = now - 176h
|
||||
# Tsbm(N+1) = TretZ(N)
|
||||
# TactZ(N+1) = TretZ(N)
|
||||
# TretZ(N+1) = now + 4293h - 2h = now + 4291h
|
||||
# Tact(N+1) = Tret(N)
|
||||
# Tret(N+1) = now + 4461h - 2h = now + 4459h
|
||||
# Trem(N+1) = now + 4464h - 2h = now + 4462h
|
||||
TactZN="now-4637h"
|
||||
TretZN="now-173h"
|
||||
TactN="now-4469h"
|
||||
TretN="now-5h"
|
||||
# Tact(N) = now - 4634h - 2h = now - 4636h
|
||||
# Tret(N) = now - 170h - 2h = now - 172h
|
||||
# Trem(N) = now - 2h
|
||||
# Tpub(N+1) = now - 173h - 2h = now - 175h
|
||||
# Tsbm(N+1) = Tret(N)
|
||||
# Tact(N+1) = Tret(N)
|
||||
# Tret(N+1) = now + 4294h - 2h = now + 4292h
|
||||
# Trem(N+1) = now + 4360h - 2h = now + 4358h
|
||||
TactN="now-4636h"
|
||||
TretN="now-172h"
|
||||
TremN="now-2h"
|
||||
TpubN1="now-176h"
|
||||
TsbmN1="${TretZN}"
|
||||
TactZN1="${TretZN}"
|
||||
TretZN1="now+4291h"
|
||||
TpubN1="now-175h"
|
||||
TsbmN1="${TretN}"
|
||||
TactN1="${TretN}"
|
||||
TretN1="now+4459h"
|
||||
TremN1="now+4462h"
|
||||
csktimes="-P ${TactN} -P sync ${TactZN} -A ${TactZN} -I ${TretZN} -D ${TremN}"
|
||||
newtimes="-P ${TpubN1} -P sync ${TsbmN1} -A ${TactZN1} -I ${TretZN1} -D ${TremN1}"
|
||||
TretN1="now+4292h"
|
||||
TremN1="now+4358h"
|
||||
csktimes="-P ${TactN} -P sync ${TactN} -A ${TactN} -I ${TretN} -D ${TremN}"
|
||||
newtimes="-P ${TpubN1} -P sync ${TsbmN1} -A ${TactN1} -I ${TretN1} -D ${TremN1}"
|
||||
CSK1=$($KEYGEN -k csk-roll2 -l policies/autosign.conf $csktimes $zone 2> keygen.out.$zone.1)
|
||||
CSK2=$($KEYGEN -k csk-roll2 -l policies/autosign.conf $newtimes $zone 2> keygen.out.$zone.2)
|
||||
$SETTIME -s -g $H -k $U $TremN -r $U $TremN -d $H $TremN -z $H now-135h "$CSK1" > settime.out.$zone.1 2>&1
|
||||
|
||||
@@ -23,7 +23,6 @@ dnssec-policy "csk-algoroll" {
|
||||
retire-safety 2h;
|
||||
zone-propagation-delay 3600;
|
||||
max-zone-ttl 6h;
|
||||
parent-registration-delay 1d;
|
||||
parent-propagation-delay pt1h;
|
||||
parent-ds-ttl 7200;
|
||||
};
|
||||
|
||||
@@ -23,7 +23,6 @@ dnssec-policy "csk-algoroll" {
|
||||
retire-safety 2h;
|
||||
zone-propagation-delay 3600;
|
||||
max-zone-ttl 6h;
|
||||
parent-registration-delay 1d;
|
||||
parent-propagation-delay pt1h;
|
||||
parent-ds-ttl 7200;
|
||||
};
|
||||
|
||||
@@ -24,7 +24,6 @@ dnssec-policy "rsasha1" {
|
||||
retire-safety 2h;
|
||||
zone-propagation-delay 3600;
|
||||
max-zone-ttl 6h;
|
||||
parent-registration-delay 1d;
|
||||
parent-propagation-delay pt1h;
|
||||
parent-ds-ttl 7200;
|
||||
};
|
||||
@@ -44,7 +43,6 @@ dnssec-policy "ecdsa256" {
|
||||
retire-safety 2h;
|
||||
zone-propagation-delay 3600;
|
||||
max-zone-ttl 6h;
|
||||
parent-registration-delay 1d;
|
||||
parent-propagation-delay pt1h;
|
||||
parent-ds-ttl 7200;
|
||||
};
|
||||
@@ -74,8 +72,7 @@ dnssec-policy "migrate-nomatch-algnum" {
|
||||
zone-propagation-delay 3600;
|
||||
max-zone-ttl 11h;
|
||||
|
||||
// Together 24h
|
||||
parent-registration-delay 21h;
|
||||
// Together 3h
|
||||
parent-propagation-delay pt1h;
|
||||
parent-ds-ttl 7200;
|
||||
};
|
||||
@@ -96,8 +93,7 @@ dnssec-policy "migrate-nomatch-alglen" {
|
||||
zone-propagation-delay 3600;
|
||||
max-zone-ttl 11h;
|
||||
|
||||
// Together 24h
|
||||
parent-registration-delay 21h;
|
||||
// Together 3h
|
||||
parent-propagation-delay pt1h;
|
||||
parent-ds-ttl 7200;
|
||||
};
|
||||
|
||||
@@ -56,7 +56,7 @@ $SIGNER -S -x -s now-1h -e now+2w -o $zone -O full -f $zonefile $infile > signer
|
||||
# ECDSAP256SHA256 keys.
|
||||
setup migrate-nomatch-algnum.kasp
|
||||
echo "$zone" >> zones
|
||||
Tds="now-24h" # Time according to dnssec-policy that DS will be OMNIPRESENT
|
||||
Tds="now-3h" # Time according to dnssec-policy that DS will be OMNIPRESENT
|
||||
Tkey="now-3900s" # DNSKEY TTL + propagation delay
|
||||
Tsig="now-12h" # Zone's maximum TTL + propagation delay
|
||||
ksktimes="-P ${Tkey} -A ${Tkey} -P sync ${Tds}"
|
||||
@@ -74,7 +74,7 @@ $SIGNER -S -x -s now-1h -e now+2w -o $zone -O full -f $zonefile $infile > signer
|
||||
# dictates 2048 bits RSASHA1 keys.
|
||||
setup migrate-nomatch-alglen.kasp
|
||||
echo "$zone" >> zones
|
||||
Tds="now-24h" # Time according to dnssec-policy that DS will be OMNIPRESENT
|
||||
Tds="now-3h" # Time according to dnssec-policy that DS will be OMNIPRESENT
|
||||
Tkey="now-3900s" # DNSKEY TTL + propagation delay
|
||||
Tsig="now-12h" # Zone's maximum TTL + propagation delay
|
||||
ksktimes="-P ${Tkey} -A ${Tkey} -P sync ${Tds}"
|
||||
|
||||
+523
-258
File diff suppressed because it is too large
Load Diff
@@ -252,7 +252,7 @@ else
|
||||
fi
|
||||
|
||||
get_core_dumps() {
|
||||
find "$systest/" \( -name 'core*' -or -name '*.core' \) ! -name '*.gz' ! -name '*.txt' | sort
|
||||
find "$systest/" \( -name 'core' -or -name 'core.*' -or -name '*.core' \) ! -name '*.gz' ! -name '*.txt' | sort
|
||||
}
|
||||
|
||||
core_dumps=$(get_core_dumps | tr '\n' ' ')
|
||||
|
||||
@@ -61,7 +61,7 @@ if [ -n "${FAILED_TESTS}" ]; then
|
||||
status=1
|
||||
fi
|
||||
|
||||
CRASHED_TESTS=$(find . -name 'core*' -or -name '*.core' | cut -d'/' -f2 | sort -u | sed -e 's/^/I: /')
|
||||
CRASHED_TESTS=$(find . \( -name 'core' -or -name 'core.*' -or -name '*.core' \) ! -name '*.txt' | cut -d'/' -f2 | sort -u | sed -e 's/^/I: /')
|
||||
if [ -n "${CRASHED_TESTS}" ]; then
|
||||
echoinfo "I:Core dumps were found for the following system tests:"
|
||||
echoinfo "${CRASHED_TESTS}"
|
||||
|
||||
+38
-62
@@ -121,7 +121,7 @@ AC_PROG_MKDIR_P
|
||||
# Initialize libtool
|
||||
LT_INIT([disable-static dlopen pic-only])
|
||||
|
||||
AS_IF([test $enable_static != "no"],
|
||||
AS_IF([test "$enable_static" != "no" && test "$enable_developer" != "yes"],
|
||||
[AC_MSG_ERROR([Static linking is not supported as it disables dlopen() and certain security features (e.g. RELRO, ASLR)])])
|
||||
|
||||
LT_CONFIG_LTDL_DIR([libltdl])
|
||||
@@ -200,7 +200,7 @@ AC_ARG_ENABLE(buffer_useinline,
|
||||
AC_DEFINE([ISC_BUFFER_USEINLINE], [1]))
|
||||
|
||||
AC_ARG_ENABLE([fuzzing],
|
||||
[AS_HELP_STRING([--enable-fuzzing=<afl|libfuzzer>],
|
||||
[AS_HELP_STRING([--enable-fuzzing=<afl|libfuzzer|ossfuzz>],
|
||||
[Enable fuzzing using American Fuzzy Lop or libFuzzer (default=no)])],
|
||||
[],
|
||||
[enable_fuzzing=no])
|
||||
@@ -220,6 +220,9 @@ AS_CASE([$enable_fuzzing],
|
||||
LDFLAGS="$LDFLAGS -fsanitize=address,undefined"
|
||||
FUZZ_LDFLAGS="-fsanitize=fuzzer,address,undefined"
|
||||
FUZZ_LOG_COMPILER="libfuzzer.sh"],
|
||||
[ossfuzz],[
|
||||
AC_MSG_RESULT([using OSS-Fuzz])
|
||||
FUZZ_LDFLAGS="$LIB_FUZZING_ENGINE"],
|
||||
[*],[AC_MSG_ERROR([You need to explicitly select the fuzzer])])
|
||||
AM_CONDITIONAL([HAVE_FUZZ_LOG_COMPILER], [test -n "$FUZZ_LOG_COMPILER"])
|
||||
AC_SUBST([FUZZ_LOG_COMPILER])
|
||||
@@ -973,66 +976,39 @@ AS_IF([test "$enable_tcp_fastopen" = "yes"],
|
||||
#
|
||||
AC_CHECK_FUNCS([strlcpy strlcat])
|
||||
|
||||
AC_SUBST(READLINE_LIB)
|
||||
AC_ARG_WITH(readline,
|
||||
AS_HELP_STRING([--with-readline[=LIBSPEC]],
|
||||
[specify readline library [default auto]]),
|
||||
use_readline="$withval", use_readline="auto")
|
||||
case "$use_readline" in
|
||||
no) ;;
|
||||
*)
|
||||
saved_LIBS="$LIBS"
|
||||
case "$use_readline" in
|
||||
yes|auto) try_readline="-ledit"; or_readline="-lreadline" ;;
|
||||
*) try_readline="$use_readline"
|
||||
esac
|
||||
for readline in "$try_readline" $or_readline
|
||||
do
|
||||
LIBS="$readline"
|
||||
AC_MSG_NOTICE(checking for readline with $readline)
|
||||
AC_CHECK_FUNCS(readline)
|
||||
if test "yes" = "$ac_cv_func_readline"
|
||||
then
|
||||
READLINE_LIB="$readline"
|
||||
break
|
||||
fi
|
||||
for lib in -lterminfo -ltermcap -lncurses -lcurses
|
||||
do
|
||||
AC_MSG_NOTICE(checking for readline with $readline $lib)
|
||||
unset ac_cv_func_readline
|
||||
LIBS="$readline $lib"
|
||||
AC_CHECK_FUNCS(readline)
|
||||
if test "yes" = "$ac_cv_func_readline"
|
||||
then
|
||||
READLINE_LIB="$readline $lib"
|
||||
break
|
||||
fi
|
||||
done
|
||||
if test "yes" = "$ac_cv_func_readline"
|
||||
then
|
||||
break
|
||||
fi
|
||||
done
|
||||
if test "auto" != "$use_readline" &&
|
||||
test "X$READLINE_LIB" = "X"
|
||||
then
|
||||
AC_MSG_ERROR([The readline library was not found.])
|
||||
fi
|
||||
LIBS="$saved_LIBS"
|
||||
;;
|
||||
esac
|
||||
if test "yes" = "$ac_cv_func_readline"
|
||||
then
|
||||
case "$READLINE_LIB" in
|
||||
*edit*)
|
||||
AC_CHECK_HEADERS(editline/readline.h)
|
||||
AC_CHECK_HEADERS(edit/readline/readline.h)
|
||||
AC_CHECK_HEADERS(edit/readline/history.h)
|
||||
;;
|
||||
esac
|
||||
AC_CHECK_HEADERS(readline/readline.h)
|
||||
AC_CHECK_HEADERS(readline/history.h)
|
||||
fi
|
||||
#
|
||||
# Check for readline support
|
||||
#
|
||||
|
||||
AC_ARG_WITH([readline],
|
||||
[AS_HELP_STRING([--with-readline=yes|no|libedit|readline],
|
||||
[specify readline library [default auto]])],
|
||||
[], [with_readline="auto"])
|
||||
|
||||
AS_CASE([$with_readline],
|
||||
[no],[],
|
||||
[auto],
|
||||
[PKG_CHECK_MODULES([READLINE], [libedit],
|
||||
[AC_DEFINE([HAVE_READLINE_LIBEDIT], [1], [Build with libedit support])],
|
||||
[PKG_CHECK_MODULES([READLINE], [editline],
|
||||
[AC_DEFINE([HAVE_READLINE_EDITLINE], [1], [Build with editline support.])],
|
||||
[PKG_CHECK_MODULES([READLINE], [readline],
|
||||
[AC_DEFINE([HAVE_READLINE_READLINE], [1], [Build with readline support.])],
|
||||
[AS_IF([test "$with_readline" = "yes"],
|
||||
[AC_MSG_ERROR([readline support requested, but none of the libraries have been found.])])])])])],
|
||||
[libedit],
|
||||
[PKG_CHECK_MODULES([READLINE], [libedit],
|
||||
[AC_DEFINE([HAVE_READLINE_LIBEDIT], [1], [Build with libedit support])])],
|
||||
[editline],
|
||||
[PKG_CHECK_MODULES([READLINE], [editline],
|
||||
[AC_DEFINE([HAVE_READLINE_EDITLINE], [1], [Build with editline support])])],
|
||||
[readline],
|
||||
[PKG_CHECK_MODULES([READLINE], [readline],
|
||||
[AC_DEFINE([HAVE_READLINE_READLINE], [1], [Build with readline support])])],
|
||||
[AC_MSG_ERROR([Unknown readline '$with_readline' library requested.])])
|
||||
AM_CONDITIONAL([HAVE_READLINE], [test -n "$READLINE_LIBS"])
|
||||
AC_SUBST([READLINE_CFLAGS])
|
||||
AC_SUBST([READLINE_LIBS])
|
||||
|
||||
#
|
||||
# Security Stuff
|
||||
|
||||
@@ -1327,7 +1327,7 @@ default is used.
|
||||
If all supported algorithms are disabled, the zones covered by the
|
||||
``disable-algorithms`` setting are treated as insecure.
|
||||
|
||||
Configured trust anchors in ``trusted-anchors`` (or ``managed-keys`` or
|
||||
Configured trust anchors in ``trust-anchors`` (or ``managed-keys`` or
|
||||
``trusted-keys``) that match a disabled algorithm are ignored and treated
|
||||
as if they were not configured.
|
||||
|
||||
@@ -4901,12 +4901,6 @@ The following options can be specified in a ``dnssec-policy`` statement:
|
||||
is served by all of the parent zone's name servers.
|
||||
The default is ``PT1H`` (1 hour).
|
||||
|
||||
``parent-registration-delay``
|
||||
This is the expected registration delay from the time when a DS
|
||||
RRset change is requested to the time when the DS RRset
|
||||
is updated in the parent zone. The default is
|
||||
``P1D`` (1 day).
|
||||
|
||||
.. _managed-keys:
|
||||
|
||||
``managed-keys`` Statement Grammar
|
||||
|
||||
@@ -39,7 +39,7 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
|
||||
.sp
|
||||
\fBdnssec\-importkey\fP reads a public DNSKEY record and generates a pair
|
||||
of .key/.private files. The DNSKEY record may be read from an existing
|
||||
.key file, in which case a corresponding .private file is
|
||||
\&.key file, in which case a corresponding .private file is
|
||||
generated, or it may be read from any other file or from the standard
|
||||
input, in which case both .key and .private files are generated.
|
||||
.sp
|
||||
|
||||
@@ -107,7 +107,6 @@ dnssec\-policy string {
|
||||
max\-zone\-ttl duration;
|
||||
parent\-ds\-ttl duration;
|
||||
parent\-propagation\-delay duration;
|
||||
parent\-registration\-delay duration;
|
||||
publish\-safety duration;
|
||||
retire\-safety duration;
|
||||
signatures\-refresh duration;
|
||||
|
||||
+15
-3
@@ -161,9 +161,21 @@ recreated. To remove it permanently, it must also be removed from
|
||||
.sp
|
||||
See also \fBrndc addzone\fP and \fBrndc modzone\fP\&.
|
||||
.TP
|
||||
\fBdnssec\fP [\fB\-status\fP \fIzone\fP [\fIclass\fP [\fIview\fP]]
|
||||
Show the DNSSEC signing state for the specified zone. Requires the
|
||||
zone to have a "dnssec\-policy".
|
||||
\fBdnssec\fP ( \fB\-status\fP | \fB\-checkds\fP [\fB\-key\fP \fIid\fP [\fB\-alg\fP \fIalgorithm\fP]] [\fB\-when\fP \fItime\fP] ( \fIpublished\fP | \fIwithdrawn\fP )) \fIzone\fP [\fIclass\fP [\fIview\fP]]
|
||||
This command allows you to interact with the "dnssec\-policy" of a given
|
||||
zone.
|
||||
.sp
|
||||
\fBrndc dnssec \-status\fP show the DNSSEC signing state for the specified
|
||||
zone.
|
||||
.sp
|
||||
\fBrndc dnssec \-checkds\fP will let \fBnamed\fP know that the DS for the given
|
||||
key has been seen published into or withdrawn from the parent. This is
|
||||
required in order to complete a KSK rollover. If the \fB\-key id\fP argument
|
||||
is specified, look for the key with the given identifier, otherwise if there
|
||||
is only one key acting as a KSK in the zone, assume the DS of that key (if
|
||||
there are multiple keys with the same tag, use \fB\-alg algorithm\fP to
|
||||
select the correct algorithm). The time that the DS has been published or
|
||||
withdrawn is set to now, unless otherwise specified with the argument \fB\-when time\fP\&.
|
||||
.TP
|
||||
\fBdnstap\fP ( \fB\-reopen\fP | \fB\-roll\fP [\fInumber\fP] )
|
||||
This command closes and re\-opens DNSTAP output files. \fBrndc dnstap \-reopen\fP allows
|
||||
|
||||
@@ -20,6 +20,5 @@ dnssec-policy "default" {
|
||||
|
||||
// Parent parameters
|
||||
parent-ds-ttl 86400;
|
||||
parent-registration-delay 24h;
|
||||
parent-propagation-delay 1h;
|
||||
};
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
max-zone-ttl <duration>;
|
||||
parent-ds-ttl <duration>;
|
||||
parent-propagation-delay <duration>;
|
||||
parent-registration-delay <duration>;
|
||||
publish-safety <duration>;
|
||||
retire-safety <duration>;
|
||||
signatures-refresh <duration>;
|
||||
|
||||
@@ -78,7 +78,6 @@ DNSSEC-POLICY
|
||||
max-zone-ttl duration;
|
||||
parent-ds-ttl duration;
|
||||
parent-propagation-delay duration;
|
||||
parent-registration-delay duration;
|
||||
publish-safety duration;
|
||||
retire-safety duration;
|
||||
signatures-refresh duration;
|
||||
|
||||
+1
-1
@@ -28,7 +28,7 @@ dnssec-policy <string> {
|
||||
max-zone-ttl <duration>;
|
||||
parent-ds-ttl <duration>;
|
||||
parent-propagation-delay <duration>;
|
||||
parent-registration-delay <duration>;
|
||||
parent-registration-delay <duration>; // obsolete
|
||||
publish-safety <duration>;
|
||||
retire-safety <duration>;
|
||||
signatures-refresh <duration>;
|
||||
|
||||
@@ -28,7 +28,6 @@ dnssec-policy <string> {
|
||||
max-zone-ttl <duration>;
|
||||
parent-ds-ttl <duration>;
|
||||
parent-propagation-delay <duration>;
|
||||
parent-registration-delay <duration>;
|
||||
publish-safety <duration>;
|
||||
retire-safety <duration>;
|
||||
signatures-refresh <duration>;
|
||||
|
||||
@@ -24,6 +24,11 @@ Known Issues
|
||||
New Features
|
||||
~~~~~~~~~~~~
|
||||
|
||||
- New ``rndc`` command ``rndc dnssec -checkds`` to tell ``named``
|
||||
that a DS record for a given zone or key has been published or withdrawn
|
||||
from the parent. Replaces the time-based ``parent-registration-delay``
|
||||
configuration option. [GL #1613]
|
||||
|
||||
- ``rndc`` has been updated to use the new BIND network manager API.
|
||||
This change had the side effect of altering the TCP timeout for RNDC
|
||||
connections from 60 seconds to the ``tcp-idle-timeout`` value, which
|
||||
|
||||
@@ -20,6 +20,8 @@
|
||||
|
||||
#include "fuzz.h"
|
||||
|
||||
bool debug = false;
|
||||
|
||||
static isc_mem_t *mctx = NULL;
|
||||
|
||||
int
|
||||
|
||||
@@ -28,6 +28,8 @@
|
||||
|
||||
#include "fuzz.h"
|
||||
|
||||
bool debug = false;
|
||||
|
||||
/*
|
||||
* Fuzz input to dns_rdata_fromwire(). Then convert the result
|
||||
* to text, back to wire format, to multiline text, and back to wire
|
||||
@@ -59,13 +61,21 @@ LLVMFuzzerInitialize(int *argc __attribute__((unused)),
|
||||
|
||||
static void
|
||||
nullmsg(dns_rdatacallbacks_t *cb, const char *fmt, ...) {
|
||||
va_list args;
|
||||
|
||||
UNUSED(cb);
|
||||
UNUSED(fmt);
|
||||
|
||||
if (debug) {
|
||||
va_start(args, fmt);
|
||||
vfprintf(stderr, fmt, args);
|
||||
fprintf(stderr, "\n");
|
||||
va_end(args);
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
|
||||
char totext[1024];
|
||||
char totext[64 * 1044 * 4];
|
||||
dns_compress_t cctx;
|
||||
dns_decompress_t dctx;
|
||||
dns_rdatatype_t rdtype;
|
||||
@@ -85,7 +95,11 @@ LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
|
||||
unsigned int classes = (sizeof(classlist) / sizeof(classlist[0]));
|
||||
unsigned int types = 1, flags, t;
|
||||
|
||||
if (size < 2) {
|
||||
/*
|
||||
* First 2 bytes are used to select type and class.
|
||||
* dns_rdata_fromwire() only accepts input up to 2^16-1 octets.
|
||||
*/
|
||||
if (size < 2 || size > 0xffff + 2) {
|
||||
return (0);
|
||||
}
|
||||
|
||||
@@ -113,10 +127,15 @@ LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
|
||||
rdclass = classlist[(*data++) % classes];
|
||||
size--;
|
||||
|
||||
if (debug) {
|
||||
fprintf(stderr, "type=%u, class=%u\n", rdtype, rdclass);
|
||||
}
|
||||
|
||||
dns_rdatacallbacks_init(&callbacks);
|
||||
callbacks.warn = callbacks.error = nullmsg;
|
||||
|
||||
dns_decompress_init(&dctx, -1, DNS_DECOMPRESS_ANY);
|
||||
/* Disallow decompression as we are reading a packet */
|
||||
dns_decompress_init(&dctx, -1, DNS_DECOMPRESS_NONE);
|
||||
|
||||
isc_buffer_constinit(&source, data, size);
|
||||
isc_buffer_add(&source, size);
|
||||
@@ -129,14 +148,20 @@ LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
|
||||
*/
|
||||
CHECK(dns_rdata_fromwire(&rdata1, rdclass, rdtype, &source, &dctx, 0,
|
||||
&target));
|
||||
assert(rdata1.length == size);
|
||||
|
||||
/*
|
||||
* Convert to text from wire.
|
||||
*/
|
||||
isc_buffer_init(&target, totext, sizeof(totext));
|
||||
isc_buffer_init(&target, totext, sizeof(totext) - 1);
|
||||
result = dns_rdata_totext(&rdata1, NULL, &target);
|
||||
assert(result == ISC_R_SUCCESS);
|
||||
|
||||
/*
|
||||
* Make debugging easier by NUL terminating.
|
||||
*/
|
||||
totext[isc_buffer_usedlength(&target)] = 0;
|
||||
|
||||
/*
|
||||
* Convert to wire from text.
|
||||
*/
|
||||
@@ -147,6 +172,9 @@ LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
|
||||
isc_buffer_init(&target, fromtext, sizeof(fromtext));
|
||||
result = dns_rdata_fromtext(&rdata2, rdclass, rdtype, lex, dns_rootname,
|
||||
0, mctx, &target, &callbacks);
|
||||
if (debug && result != ISC_R_SUCCESS) {
|
||||
fprintf(stderr, "'%s'\n", totext);
|
||||
}
|
||||
assert(result == ISC_R_SUCCESS);
|
||||
assert(rdata2.length == size);
|
||||
assert(!memcmp(rdata2.data, data, size));
|
||||
@@ -178,7 +206,7 @@ LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
|
||||
* Convert rdata back to wire.
|
||||
*/
|
||||
CHECK(dns_compress_init(&cctx, -1, mctx));
|
||||
dns_compress_setsensitive(&cctx, true);
|
||||
dns_compress_disable(&cctx);
|
||||
isc_buffer_init(&target, towire, sizeof(towire));
|
||||
result = dns_rdata_towire(&rdata1, &cctx, &target);
|
||||
dns_compress_invalidate(&cctx);
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1 @@
|
||||
,000
|
||||
@@ -0,0 +1 @@
|
||||
モ0オ0琿00
|
||||
@@ -0,0 +1 @@
|
||||
0000000000000000000À
|
||||
Binary file not shown.
@@ -0,0 +1 @@
|
||||
�000000000000000000000000��00�0�00000000000000000000�00�0000
|
||||
Binary file not shown.
@@ -0,0 +1 @@
|
||||
d000��
|
||||
Binary file not shown.
@@ -0,0 +1 @@
|
||||
�0�
|
||||
Binary file not shown.
Binary file not shown.
@@ -0,0 +1 @@
|
||||
�0�
|
||||
@@ -0,0 +1 @@
|
||||
�000000000��000
|
||||
@@ -0,0 +1 @@
|
||||
i00000000000000000000
|
||||
@@ -0,0 +1 @@
|
||||
%00
|
||||
@@ -0,0 +1 @@
|
||||
�00
|
||||
@@ -0,0 +1 @@
|
||||
�0�
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1 @@
|
||||
�00
|
||||
@@ -0,0 +1 @@
|
||||
�000|
|
||||
@@ -0,0 +1 @@
|
||||
�000000
|
||||
@@ -0,0 +1 @@
|
||||
0000
|
||||
@@ -0,0 +1 @@
|
||||
�00�00000000000000000000000000000000�000000000000
|
||||
@@ -0,0 +1 @@
|
||||
�00
|
||||
Binary file not shown.
@@ -0,0 +1 @@
|
||||
簯0000000000000000000
|
||||
Binary file not shown.
@@ -0,0 +1 @@
|
||||
o0000000000000000000000000000»΅00000000000β000ο0»00»0θ°ο�000��000�0
|
||||
@@ -0,0 +1 @@
|
||||
�0�00�0000�
|
||||
Binary file not shown.
@@ -0,0 +1 @@
|
||||
,000
|
||||
Binary file not shown.
Binary file not shown.
@@ -0,0 +1 @@
|
||||
10000000000000000000000000000000000000000000�������������
|
||||
Binary file not shown.
@@ -1 +1 @@
|
||||
�-�e�<
|
||||
�00000
|
||||
@@ -1 +1 @@
|
||||
|�|8
|
||||
|0000
|
||||
@@ -23,6 +23,8 @@
|
||||
|
||||
ISC_LANG_BEGINDECLS
|
||||
|
||||
extern bool debug;
|
||||
|
||||
int
|
||||
LLVMFuzzerInitialize(int *argc __attribute__((unused)),
|
||||
char ***argv __attribute__((unused)));
|
||||
|
||||
@@ -15,10 +15,13 @@
|
||||
#include <isc/buffer.h>
|
||||
#include <isc/lex.h>
|
||||
#include <isc/mem.h>
|
||||
#include <isc/string.h>
|
||||
#include <isc/util.h>
|
||||
|
||||
#include "fuzz.h"
|
||||
|
||||
bool debug = false;
|
||||
|
||||
int
|
||||
LLVMFuzzerInitialize(int *argc __attribute__((unused)),
|
||||
char ***argv __attribute__((unused)));
|
||||
@@ -46,6 +49,21 @@ int
|
||||
LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
|
||||
isc_buffer_t buf;
|
||||
isc_result_t result;
|
||||
isc_token_t token;
|
||||
isc_tokentype_t expect;
|
||||
bool eol;
|
||||
|
||||
if (size < sizeof(expect) + sizeof(eol)) {
|
||||
return (0);
|
||||
}
|
||||
|
||||
(void)memmove(&expect, data, sizeof(expect));
|
||||
data += sizeof(expect);
|
||||
size -= sizeof(expect);
|
||||
|
||||
eol = *data != 0;
|
||||
data += 1;
|
||||
size -= 1;
|
||||
|
||||
isc_buffer_constinit(&buf, data, size);
|
||||
isc_buffer_add(&buf, size);
|
||||
@@ -54,9 +72,8 @@ LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
|
||||
CHECK(isc_lex_openbuffer(lex, &buf));
|
||||
|
||||
do {
|
||||
isc_token_t token;
|
||||
result = isc_lex_gettoken(lex, 0, &token);
|
||||
} while (result == ISC_R_SUCCESS);
|
||||
result = isc_lex_getmastertoken(lex, &token, expect, eol);
|
||||
} while (result == ISC_R_SUCCESS && token.type != isc_tokentype_eof);
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -19,6 +19,8 @@
|
||||
|
||||
#include "fuzz.h"
|
||||
|
||||
bool debug = false;
|
||||
|
||||
static isc_mem_t *mctx = NULL;
|
||||
static isc_lex_t *lex = NULL;
|
||||
|
||||
|
||||
+58
-43
@@ -24,6 +24,48 @@
|
||||
|
||||
#include <dirent.h>
|
||||
|
||||
static void
|
||||
test_one_file(const char *filename) {
|
||||
int fd;
|
||||
struct stat st;
|
||||
char *data;
|
||||
ssize_t n;
|
||||
|
||||
if ((fd = open(filename, O_RDONLY)) == -1) {
|
||||
fprintf(stderr, "Failed to open %s: %s\n", filename,
|
||||
strerror(errno));
|
||||
return;
|
||||
}
|
||||
|
||||
if (fstat(fd, &st) != 0) {
|
||||
fprintf(stderr, "Failed to stat %s: %s\n", filename,
|
||||
strerror(errno));
|
||||
goto closefd;
|
||||
}
|
||||
|
||||
data = malloc(st.st_size);
|
||||
n = read(fd, data, st.st_size);
|
||||
if (n == st.st_size) {
|
||||
printf("testing %zd bytes from %s\n", n, filename);
|
||||
fflush(stdout);
|
||||
LLVMFuzzerTestOneInput((const uint8_t *)data, n);
|
||||
fflush(stderr);
|
||||
} else {
|
||||
if (n < 0) {
|
||||
fprintf(stderr,
|
||||
"Failed to read %zd bytes from %s: %s\n",
|
||||
(ssize_t)st.st_size, filename, strerror(errno));
|
||||
} else {
|
||||
fprintf(stderr,
|
||||
"Failed to read %zd bytes from %s, got %zd\n",
|
||||
(ssize_t)st.st_size, filename, n);
|
||||
}
|
||||
}
|
||||
free(data);
|
||||
closefd:
|
||||
close(fd);
|
||||
}
|
||||
|
||||
static void
|
||||
test_all_from(const char *dirname) {
|
||||
DIR *dirp;
|
||||
@@ -36,53 +78,13 @@ test_all_from(const char *dirname) {
|
||||
|
||||
while ((dp = readdir(dirp)) != NULL) {
|
||||
char filename[strlen(dirname) + strlen(dp->d_name) + 2];
|
||||
int fd;
|
||||
struct stat st;
|
||||
char *data;
|
||||
ssize_t n;
|
||||
|
||||
if (dp->d_name[0] == '.') {
|
||||
continue;
|
||||
}
|
||||
snprintf(filename, sizeof(filename), "%s/%s", dirname,
|
||||
dp->d_name);
|
||||
|
||||
if ((fd = open(filename, O_RDONLY)) == -1) {
|
||||
fprintf(stderr, "Failed to open %s: %s\n", filename,
|
||||
strerror(errno));
|
||||
continue;
|
||||
}
|
||||
|
||||
if (fstat(fd, &st) != 0) {
|
||||
fprintf(stderr, "Failed to stat %s: %s\n", filename,
|
||||
strerror(errno));
|
||||
goto closefd;
|
||||
}
|
||||
|
||||
data = malloc(st.st_size);
|
||||
n = read(fd, data, st.st_size);
|
||||
if (n == st.st_size) {
|
||||
printf("testing %zd bytes from %s\n", n, filename);
|
||||
fflush(stdout);
|
||||
LLVMFuzzerTestOneInput((const uint8_t *)data, n);
|
||||
fflush(stderr);
|
||||
} else {
|
||||
if (n < 0) {
|
||||
fprintf(stderr,
|
||||
"Failed to read %zd bytes from %s: "
|
||||
"%s\n",
|
||||
(ssize_t)st.st_size, filename,
|
||||
strerror(errno));
|
||||
} else {
|
||||
fprintf(stderr,
|
||||
"Failed to read %zd bytes from %s"
|
||||
", got %zd\n",
|
||||
(ssize_t)st.st_size, filename, n);
|
||||
}
|
||||
}
|
||||
free(data);
|
||||
closefd:
|
||||
close(fd);
|
||||
test_one_file(filename);
|
||||
}
|
||||
|
||||
closedir(dirp);
|
||||
@@ -95,8 +97,21 @@ main(int argc, char **argv) {
|
||||
|
||||
(void)LLVMFuzzerInitialize(&argc, &argv);
|
||||
|
||||
UNUSED(argc);
|
||||
UNUSED(argv);
|
||||
if (argv[1] != NULL && strcmp(argv[1], "-d") == 0) {
|
||||
debug = true;
|
||||
argv++;
|
||||
argc--;
|
||||
}
|
||||
|
||||
if (argv[1] != NULL) {
|
||||
while (argv[1] != NULL) {
|
||||
test_one_file(argv[1]);
|
||||
argv++;
|
||||
argc--;
|
||||
}
|
||||
POST(argc);
|
||||
return (0);
|
||||
}
|
||||
|
||||
target = (target != NULL) ? target + 1 : argv[0];
|
||||
if (strncmp(target, "lt-", 3) == 0) {
|
||||
|
||||
+6
-3
@@ -110,7 +110,9 @@ static const char *timingtags[TIMING_NTAGS] = {
|
||||
|
||||
"DSPublish:", "SyncPublish:", "SyncDelete:",
|
||||
|
||||
"DNSKEYChange:", "ZRRSIGChange:", "KRRSIGChange:", "DSChange:"
|
||||
"DNSKEYChange:", "ZRRSIGChange:", "KRRSIGChange:", "DSChange:",
|
||||
|
||||
"DSRemoved:"
|
||||
};
|
||||
|
||||
#define KEYSTATES_NTAGS (DST_MAX_KEYSTATES + 1)
|
||||
@@ -1923,8 +1925,7 @@ printtime(const dst_key_t *key, int type, const char *tag, FILE *stream) {
|
||||
}
|
||||
|
||||
isc_buffer_usedregion(&b, &r);
|
||||
fprintf(stream, "%s: %.*s (%.*s)\n", tag, (int)r.length, r.base,
|
||||
(int)strlen(output) - 1, output);
|
||||
fprintf(stream, "%s: %.*s (%s)\n", tag, (int)r.length, r.base, output);
|
||||
return;
|
||||
|
||||
error:
|
||||
@@ -2009,6 +2010,8 @@ write_key_state(const dst_key_t *key, int type, const char *directory) {
|
||||
printtime(key, DST_TIME_INACTIVE, "Retired", fp);
|
||||
printtime(key, DST_TIME_REVOKE, "Revoked", fp);
|
||||
printtime(key, DST_TIME_DELETE, "Removed", fp);
|
||||
printtime(key, DST_TIME_DSPUBLISH, "DSPublish", fp);
|
||||
printtime(key, DST_TIME_DSDELETE, "DSRemoved", fp);
|
||||
printtime(key, DST_TIME_SYNCPUBLISH, "PublishCDS", fp);
|
||||
printtime(key, DST_TIME_SYNCDELETE, "DeleteCDS", fp);
|
||||
|
||||
|
||||
@@ -779,7 +779,6 @@ main(int argc, char **argv) {
|
||||
* Add in reserved/special types. This will let us
|
||||
* sort them without special cases.
|
||||
*/
|
||||
insert_into_typenames(0, "reserved0", RESERVED);
|
||||
insert_into_typenames(100, "uinfo", RESERVEDNAME);
|
||||
insert_into_typenames(101, "uid", RESERVEDNAME);
|
||||
insert_into_typenames(102, "gid", RESERVEDNAME);
|
||||
|
||||
@@ -86,7 +86,6 @@ struct dns_kasp {
|
||||
/* Parent settings */
|
||||
dns_ttl_t parent_ds_ttl;
|
||||
uint32_t parent_propagation_delay;
|
||||
uint32_t parent_registration_delay;
|
||||
|
||||
/* TODO: The rest of the KASP configuration */
|
||||
};
|
||||
@@ -105,7 +104,6 @@ struct dns_kasp {
|
||||
#define DNS_KASP_ZONE_MAXTTL (86400)
|
||||
#define DNS_KASP_ZONE_PROPDELAY (300)
|
||||
#define DNS_KASP_PARENT_PROPDELAY (3600)
|
||||
#define DNS_KASP_PARENT_REGDELAY (86400)
|
||||
|
||||
/* Key roles */
|
||||
#define DNS_KASP_KEY_ROLE_KSK 0x01
|
||||
@@ -443,30 +441,6 @@ dns_kasp_setparentpropagationdelay(dns_kasp_t *kasp, uint32_t value);
|
||||
*\li 'kasp' is a valid, thawed kasp.
|
||||
*/
|
||||
|
||||
uint32_t
|
||||
dns_kasp_parentregistrationdelay(dns_kasp_t *kasp);
|
||||
/*%<
|
||||
* Get parent registration delay for submitting new DS.
|
||||
*
|
||||
* Requires:
|
||||
*
|
||||
*\li 'kasp' is a valid, frozen kasp.
|
||||
*
|
||||
* Returns:
|
||||
*
|
||||
*\li Parent registration delay.
|
||||
*/
|
||||
|
||||
void
|
||||
dns_kasp_setparentregistrationdelay(dns_kasp_t *kasp, uint32_t value);
|
||||
/*%<
|
||||
* Set parent registration delay.
|
||||
*
|
||||
* Requires:
|
||||
*
|
||||
*\li 'kasp' is a valid, thawed kasp.
|
||||
*/
|
||||
|
||||
isc_result_t
|
||||
dns_kasplist_find(dns_kasplist_t *list, const char *name, dns_kasp_t **kaspp);
|
||||
/*%<
|
||||
|
||||
@@ -51,6 +51,32 @@ dns_keymgr_run(const dns_name_t *origin, dns_rdataclass_t rdclass,
|
||||
*\li On error, keypool is unchanged
|
||||
*/
|
||||
|
||||
isc_result_t
|
||||
dns_keymgr_checkds(dns_kasp_t *kasp, dns_dnsseckeylist_t *keyring,
|
||||
const char *directory, isc_stdtime_t now, bool dspublish);
|
||||
isc_result_t
|
||||
dns_keymgr_checkds_id(dns_kasp_t *kasp, dns_dnsseckeylist_t *keyring,
|
||||
const char *directory, isc_stdtime_t now, bool dspublish,
|
||||
dns_keytag_t id, unsigned int algorithm);
|
||||
/*%<
|
||||
* Check DS for one key in 'keyring'. The key must have the KSK role.
|
||||
* If 'dspublish' is set to true, set the DS Publish time to 'now'.
|
||||
* If 'dspublish' is set to false, set the DS Removed time to 'now'.
|
||||
* If a specific key 'id' is given it must match the keytag.
|
||||
* If the 'algorithm' is non-zero, it must match the key's algorithm.
|
||||
* The result is stored in the key state file.
|
||||
*
|
||||
* Requires:
|
||||
*\li 'kasp' is not NULL.
|
||||
*\li 'keyring' is not NULL.
|
||||
*
|
||||
* Returns:
|
||||
*\li #ISC_R_SUCCESS (No error).
|
||||
*\li #ISC_R_FAILURE (More than one matching KSK found).
|
||||
*\li #ISC_R_NOTFOUND (No matching KSK found).
|
||||
*
|
||||
*/
|
||||
|
||||
void
|
||||
dns_keymgr_status(dns_kasp_t *kasp, dns_dnsseckeylist_t *keyring,
|
||||
isc_stdtime_t now, char *out, size_t out_len);
|
||||
|
||||
@@ -54,6 +54,7 @@ struct dns_ntatable {
|
||||
isc_refcount_t references;
|
||||
/* Locked by rwlock. */
|
||||
dns_rbt_t *table;
|
||||
bool shuttingdown;
|
||||
};
|
||||
|
||||
#define NTATABLE_MAGIC ISC_MAGIC('N', 'T', 'A', 't')
|
||||
@@ -197,6 +198,13 @@ dns_ntatable_save(dns_ntatable_t *ntatable, FILE *fp);
|
||||
/*%<
|
||||
* Save the NTA table to the file opened as 'fp', for later loading.
|
||||
*/
|
||||
|
||||
void
|
||||
dns_ntatable_shutdown(dns_ntatable_t *ntatable);
|
||||
/*%<
|
||||
* Cancel future checks to see if NTAs can be removed.
|
||||
*/
|
||||
|
||||
ISC_LANG_ENDDECLS
|
||||
|
||||
#endif /* DNS_NTA_H */
|
||||
|
||||
@@ -133,7 +133,8 @@ typedef enum dst_key_state {
|
||||
#define DST_TIME_ZRRSIG 10
|
||||
#define DST_TIME_KRRSIG 11
|
||||
#define DST_TIME_DS 12
|
||||
#define DST_MAX_TIMES 12
|
||||
#define DST_TIME_DSDELETE 13
|
||||
#define DST_MAX_TIMES 13
|
||||
|
||||
/* Numeric metadata definitions */
|
||||
#define DST_NUM_PREDECESSOR 0
|
||||
|
||||
@@ -57,7 +57,6 @@ dns_kasp_create(isc_mem_t *mctx, const char *name, dns_kasp_t **kaspp) {
|
||||
|
||||
kasp->parent_ds_ttl = DNS_KASP_DS_TTL;
|
||||
kasp->parent_propagation_delay = DNS_KASP_PARENT_PROPDELAY;
|
||||
kasp->parent_registration_delay = DNS_KASP_PARENT_REGDELAY;
|
||||
|
||||
/* TODO: The rest of the KASP configuration */
|
||||
|
||||
@@ -298,22 +297,6 @@ dns_kasp_setparentpropagationdelay(dns_kasp_t *kasp, uint32_t value) {
|
||||
kasp->parent_propagation_delay = value;
|
||||
}
|
||||
|
||||
uint32_t
|
||||
dns_kasp_parentregistrationdelay(dns_kasp_t *kasp) {
|
||||
REQUIRE(DNS_KASP_VALID(kasp));
|
||||
REQUIRE(kasp->frozen);
|
||||
|
||||
return (kasp->parent_registration_delay);
|
||||
}
|
||||
|
||||
void
|
||||
dns_kasp_setparentregistrationdelay(dns_kasp_t *kasp, uint32_t value) {
|
||||
REQUIRE(DNS_KASP_VALID(kasp));
|
||||
REQUIRE(!kasp->frozen);
|
||||
|
||||
kasp->parent_registration_delay = value;
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
dns_kasplist_find(dns_kasplist_t *list, const char *name, dns_kasp_t **kaspp) {
|
||||
dns_kasp_t *kasp = NULL;
|
||||
|
||||
+117
-21
@@ -128,9 +128,6 @@ keymgr_settime_remove(dns_dnsseckey_t *key, dns_kasp_t *kasp) {
|
||||
dns_kasp_parentpropagationdelay(kasp) +
|
||||
dns_kasp_retiresafety(kasp);
|
||||
}
|
||||
if (zsk && ksk) {
|
||||
ksk_remove += dns_kasp_parentregistrationdelay(kasp);
|
||||
}
|
||||
|
||||
remove = ksk_remove > zsk_remove ? ksk_remove : zsk_remove;
|
||||
dst_key_settime(key->key, DST_TIME_DELETE, remove);
|
||||
@@ -263,12 +260,6 @@ keymgr_prepublication_time(dns_dnsseckey_t *key, dns_kasp_t *kasp,
|
||||
* so ignore the result code.
|
||||
*/
|
||||
(void)dst_key_getbool(key->key, DST_BOOL_ZSK, &zsk);
|
||||
if (!zsk && ksk) {
|
||||
/*
|
||||
* Include registration delay in prepublication time.
|
||||
*/
|
||||
prepub += dns_kasp_parentregistrationdelay(kasp);
|
||||
}
|
||||
|
||||
ret = dst_key_gettime(key->key, DST_TIME_INACTIVE, &retire);
|
||||
if (ret != ISC_R_SUCCESS) {
|
||||
@@ -965,10 +956,14 @@ keymgr_have_rrsig(dns_dnsseckeylist_t *keyring, dns_dnsseckey_t *key, int type,
|
||||
* - First introduce the DNSKEY record, as well as the KRRSIG records.
|
||||
* - Only if the DNSKEY record is OMNIPRESENT, suggest to introduce the DS.
|
||||
*
|
||||
* Also check the DS Publish or Delete times, to see if the DS record
|
||||
* already reached the parent.
|
||||
*/
|
||||
static bool
|
||||
keymgr_policy_approval(dns_dnsseckeylist_t *keyring, dns_dnsseckey_t *key,
|
||||
int type, dst_key_state_t next) {
|
||||
int type, dst_key_state_t next, isc_stdtime_t now) {
|
||||
isc_result_t ret;
|
||||
isc_stdtime_t dstime;
|
||||
dst_key_state_t dnskeystate = HIDDEN;
|
||||
dst_key_state_t ksk_present[4] = { OMNIPRESENT, NA, OMNIPRESENT,
|
||||
OMNIPRESENT };
|
||||
@@ -980,10 +975,10 @@ keymgr_policy_approval(dns_dnsseckeylist_t *keyring, dns_dnsseckey_t *key,
|
||||
dst_key_state_t ksk_retired[4] = { UNRETENTIVE, NA, NA, OMNIPRESENT };
|
||||
dst_key_state_t na[4] = { NA, NA, NA, NA }; /* successor n/a */
|
||||
|
||||
if (next != RUMOURED) {
|
||||
if (next != RUMOURED && next != UNRETENTIVE) {
|
||||
/*
|
||||
* Local policy only adds an extra barrier on transitions to
|
||||
* the RUMOURED state.
|
||||
* the RUMOURED and UNRETENTIVE states.
|
||||
*/
|
||||
return (true);
|
||||
}
|
||||
@@ -993,6 +988,9 @@ keymgr_policy_approval(dns_dnsseckeylist_t *keyring, dns_dnsseckey_t *key,
|
||||
/* No restrictions. */
|
||||
return (true);
|
||||
case DST_KEY_ZRRSIG:
|
||||
if (next != RUMOURED) {
|
||||
return (true);
|
||||
}
|
||||
/* Make sure the DNSKEY record is OMNIPRESENT. */
|
||||
(void)dst_key_getstate(key->key, DST_KEY_DNSKEY, &dnskeystate);
|
||||
if (dnskeystate == OMNIPRESENT) {
|
||||
@@ -1013,13 +1011,35 @@ keymgr_policy_approval(dns_dnsseckeylist_t *keyring, dns_dnsseckey_t *key,
|
||||
keyring, key, type, next, ksk_retired,
|
||||
ksk_rumoured, true, true)));
|
||||
case DST_KEY_KRRSIG:
|
||||
if (next != RUMOURED) {
|
||||
return (true);
|
||||
}
|
||||
/* Only introduce if the DNSKEY is also introduced. */
|
||||
(void)dst_key_getstate(key->key, DST_KEY_DNSKEY, &dnskeystate);
|
||||
return (dnskeystate != HIDDEN);
|
||||
case DST_KEY_DS:
|
||||
/* Make sure the DNSKEY record is OMNIPRESENT. */
|
||||
(void)dst_key_getstate(key->key, DST_KEY_DNSKEY, &dnskeystate);
|
||||
return (dnskeystate == OMNIPRESENT);
|
||||
if (next == RUMOURED) {
|
||||
/* Make sure the DNSKEY record is OMNIPRESENT. */
|
||||
(void)dst_key_getstate(key->key, DST_KEY_DNSKEY,
|
||||
&dnskeystate);
|
||||
if (dnskeystate != OMNIPRESENT) {
|
||||
return (false);
|
||||
}
|
||||
/* Make sure DS has been seen in the parent. */
|
||||
ret = dst_key_gettime(key->key, DST_TIME_DSPUBLISH,
|
||||
&dstime);
|
||||
if (ret != ISC_R_SUCCESS || dstime > now) {
|
||||
return (false);
|
||||
}
|
||||
} else if (next == UNRETENTIVE) {
|
||||
/* Make sure DS has been withdrawn from the parent. */
|
||||
ret = dst_key_gettime(key->key, DST_TIME_DSDELETE,
|
||||
&dstime);
|
||||
if (ret != ISC_R_SUCCESS || dstime > now) {
|
||||
return (false);
|
||||
}
|
||||
}
|
||||
return (true);
|
||||
default:
|
||||
return (false);
|
||||
}
|
||||
@@ -1203,16 +1223,13 @@ keymgr_transition_time(dns_dnsseckey_t *key, int type,
|
||||
*
|
||||
* Iret = DprpP + TTLds
|
||||
*
|
||||
* So we need to wait Dreg + Iret before the DS becomes
|
||||
* OMNIPRESENT. This translates to:
|
||||
* This translates to:
|
||||
*
|
||||
* parent-registration-delay +
|
||||
* parent-propagation-delay + parent-ds-ttl.
|
||||
*
|
||||
* We will also add the retire-safety interval.
|
||||
*/
|
||||
nexttime = lastchange + dns_kasp_dsttl(kasp) +
|
||||
dns_kasp_parentregistrationdelay(kasp) +
|
||||
dns_kasp_parentpropagationdelay(kasp) +
|
||||
dns_kasp_retiresafety(kasp);
|
||||
break;
|
||||
@@ -1302,7 +1319,7 @@ transition:
|
||||
|
||||
/* Is the transition allowed according to policy? */
|
||||
if (!keymgr_policy_approval(keyring, dkey, i,
|
||||
next_state)) {
|
||||
next_state, now)) {
|
||||
/* No, please respect rollover methods. */
|
||||
isc_log_write(
|
||||
dns_lctx, DNS_LOGCATEGORY_DNSSEC,
|
||||
@@ -1433,7 +1450,6 @@ keymgr_key_init(dns_dnsseckey_t *key, dns_kasp_t *kasp, isc_stdtime_t now) {
|
||||
ret = dst_key_gettime(key->key, DST_TIME_SYNCPUBLISH, &syncpub);
|
||||
if (syncpub <= now && ret == ISC_R_SUCCESS) {
|
||||
dns_ttl_t ds_ttl = dns_kasp_dsttl(kasp);
|
||||
ds_ttl += dns_kasp_parentregistrationdelay(kasp);
|
||||
ds_ttl += dns_kasp_parentpropagationdelay(kasp);
|
||||
if ((syncpub + ds_ttl) <= now) {
|
||||
ds_state = OMNIPRESENT;
|
||||
@@ -1854,6 +1870,86 @@ failure:
|
||||
return (result);
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
keymgr_checkds(dns_kasp_t *kasp, dns_dnsseckeylist_t *keyring,
|
||||
const char *directory, isc_stdtime_t now, bool dspublish,
|
||||
dns_keytag_t id, unsigned int alg, bool check_id) {
|
||||
int options = (DST_TYPE_PRIVATE | DST_TYPE_PUBLIC | DST_TYPE_STATE);
|
||||
isc_dir_t dir;
|
||||
isc_result_t result;
|
||||
dns_dnsseckey_t *ksk_key = NULL;
|
||||
|
||||
REQUIRE(DNS_KASP_VALID(kasp));
|
||||
REQUIRE(keyring != NULL);
|
||||
|
||||
for (dns_dnsseckey_t *dkey = ISC_LIST_HEAD(*keyring); dkey != NULL;
|
||||
dkey = ISC_LIST_NEXT(dkey, link))
|
||||
{
|
||||
isc_result_t ret;
|
||||
bool ksk = false;
|
||||
|
||||
ret = dst_key_getbool(dkey->key, DST_BOOL_KSK, &ksk);
|
||||
if (ret == ISC_R_SUCCESS && ksk) {
|
||||
if (check_id && dst_key_id(dkey->key) != id) {
|
||||
continue;
|
||||
}
|
||||
if (alg > 0 && dst_key_alg(dkey->key) != alg) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (ksk_key != NULL) {
|
||||
/*
|
||||
* Only checkds for one key at a time.
|
||||
*/
|
||||
return (ISC_R_FAILURE);
|
||||
}
|
||||
|
||||
ksk_key = dkey;
|
||||
}
|
||||
}
|
||||
|
||||
if (ksk_key == NULL) {
|
||||
return (ISC_R_NOTFOUND);
|
||||
}
|
||||
|
||||
if (dspublish) {
|
||||
dst_key_settime(ksk_key->key, DST_TIME_DSPUBLISH, now);
|
||||
} else {
|
||||
dst_key_settime(ksk_key->key, DST_TIME_DSDELETE, now);
|
||||
}
|
||||
|
||||
/* Store key state and update hints. */
|
||||
isc_dir_init(&dir);
|
||||
if (directory == NULL) {
|
||||
directory = ".";
|
||||
}
|
||||
result = isc_dir_open(&dir, directory);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
return result;
|
||||
}
|
||||
|
||||
dns_dnssec_get_hints(ksk_key, now);
|
||||
result = dst_key_tofile(ksk_key->key, options, directory);
|
||||
isc_dir_close(&dir);
|
||||
|
||||
return (result);
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
dns_keymgr_checkds(dns_kasp_t *kasp, dns_dnsseckeylist_t *keyring,
|
||||
const char *directory, isc_stdtime_t now, bool dspublish) {
|
||||
return (keymgr_checkds(kasp, keyring, directory, now, dspublish, 0, 0,
|
||||
false));
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
dns_keymgr_checkds_id(dns_kasp_t *kasp, dns_dnsseckeylist_t *keyring,
|
||||
const char *directory, isc_stdtime_t now, bool dspublish,
|
||||
dns_keytag_t id, unsigned int alg) {
|
||||
return (keymgr_checkds(kasp, keyring, directory, now, dspublish, id,
|
||||
alg, true));
|
||||
}
|
||||
|
||||
static void
|
||||
keytime_status(dst_key_t *key, isc_stdtime_t now, isc_buffer_t *buf,
|
||||
const char *pre, int ks, int kt) {
|
||||
|
||||
+44
-5
@@ -128,6 +128,7 @@ dns_ntatable_create(dns_view_t *view, isc_taskmgr_t *taskmgr,
|
||||
goto cleanup_rbt;
|
||||
}
|
||||
|
||||
ntatable->shuttingdown = false;
|
||||
ntatable->timermgr = timermgr;
|
||||
ntatable->taskmgr = taskmgr;
|
||||
|
||||
@@ -239,13 +240,14 @@ fetch_done(isc_task_t *task, isc_event_t *event) {
|
||||
NULL, true);
|
||||
}
|
||||
nta_detach(view->mctx, &nta);
|
||||
dns_view_weakdetach(&view);
|
||||
}
|
||||
|
||||
static void
|
||||
checkbogus(isc_task_t *task, isc_event_t *event) {
|
||||
dns_nta_t *nta = event->ev_arg;
|
||||
dns_ntatable_t *ntatable = nta->ntatable;
|
||||
dns_view_t *view = ntatable->view;
|
||||
dns_view_t *view = NULL;
|
||||
isc_result_t result;
|
||||
|
||||
if (nta->fetch != NULL) {
|
||||
@@ -262,11 +264,13 @@ checkbogus(isc_task_t *task, isc_event_t *event) {
|
||||
isc_event_free(&event);
|
||||
|
||||
nta_ref(nta);
|
||||
dns_view_weakattach(ntatable->view, &view);
|
||||
result = dns_resolver_createfetch(
|
||||
view->resolver, nta->name, dns_rdatatype_nsec, NULL, NULL, NULL,
|
||||
NULL, 0, DNS_FETCHOPT_NONTA, 0, NULL, task, fetch_done, nta,
|
||||
&nta->rdataset, &nta->sigrdataset, &nta->fetch);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
dns_view_weakdetach(&view);
|
||||
nta_detach(view->mctx, &nta);
|
||||
}
|
||||
}
|
||||
@@ -330,7 +334,7 @@ nta_create(dns_ntatable_t *ntatable, const dns_name_t *name,
|
||||
isc_result_t
|
||||
dns_ntatable_add(dns_ntatable_t *ntatable, const dns_name_t *name, bool force,
|
||||
isc_stdtime_t now, uint32_t lifetime) {
|
||||
isc_result_t result;
|
||||
isc_result_t result = ISC_R_SUCCESS;
|
||||
dns_nta_t *nta = NULL;
|
||||
dns_rbtnode_t *node;
|
||||
dns_view_t *view;
|
||||
@@ -339,16 +343,20 @@ dns_ntatable_add(dns_ntatable_t *ntatable, const dns_name_t *name, bool force,
|
||||
|
||||
view = ntatable->view;
|
||||
|
||||
RWLOCK(&ntatable->rwlock, isc_rwlocktype_write);
|
||||
|
||||
if (ntatable->shuttingdown) {
|
||||
goto unlock;
|
||||
}
|
||||
|
||||
result = nta_create(ntatable, name, &nta);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
return (result);
|
||||
goto unlock;
|
||||
}
|
||||
|
||||
nta->expiry = now + lifetime;
|
||||
nta->forced = force;
|
||||
|
||||
RWLOCK(&ntatable->rwlock, isc_rwlocktype_write);
|
||||
|
||||
node = NULL;
|
||||
result = dns_rbt_addnode(ntatable->table, name, &node);
|
||||
if (result == ISC_R_SUCCESS) {
|
||||
@@ -372,6 +380,7 @@ dns_ntatable_add(dns_ntatable_t *ntatable, const dns_name_t *name, bool force,
|
||||
result = ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
unlock:
|
||||
RWUNLOCK(&ntatable->rwlock, isc_rwlocktype_write);
|
||||
|
||||
if (nta != NULL) {
|
||||
@@ -663,3 +672,33 @@ cleanup:
|
||||
return (written ? ISC_R_SUCCESS : ISC_R_NOTFOUND);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
dns_ntatable_shutdown(dns_ntatable_t *ntatable) {
|
||||
isc_result_t result;
|
||||
dns_rbtnode_t *node;
|
||||
dns_rbtnodechain_t chain;
|
||||
|
||||
REQUIRE(VALID_NTATABLE(ntatable));
|
||||
|
||||
RWLOCK(&ntatable->rwlock, isc_rwlocktype_write);
|
||||
ntatable->shuttingdown = true;
|
||||
|
||||
dns_rbtnodechain_init(&chain);
|
||||
result = dns_rbtnodechain_first(&chain, ntatable->table, NULL, NULL);
|
||||
while (result == ISC_R_SUCCESS || result == DNS_R_NEWORIGIN) {
|
||||
dns_rbtnodechain_current(&chain, NULL, NULL, &node);
|
||||
if (node->data != NULL) {
|
||||
dns_nta_t *nta = (dns_nta_t *)node->data;
|
||||
if (nta->timer != NULL) {
|
||||
(void)isc_timer_reset(nta->timer,
|
||||
isc_timertype_inactive,
|
||||
NULL, NULL, true);
|
||||
}
|
||||
}
|
||||
result = dns_rbtnodechain_next(&chain, NULL, NULL);
|
||||
}
|
||||
|
||||
dns_rbtnodechain_invalidate(&chain);
|
||||
RWUNLOCK(&ntatable->rwlock, isc_rwlocktype_write);
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user