--- 9.6.1 released ---
-2608. [func] Perform post signing verification checks in
- dnssec-signzone. These can be disabled with -P.
-
- The post sign verification test ensures that for each
- algorithm in use there is at least one non revoked
- self signed KSK key. That all revoked KSK keys are
- self signed. That all records in the zone are signed
- by the algorithm. [RT #19653]
-
2607. [bug] named could incorrectly delete NSEC3 records for
empty nodes when processing a update request.
[RT #19749]
--- /dev/null
+dnssec-signzone was designed so that it could sign a zone partially, using
+only a subset of the DNSSEC keys needed to produce a fully-signed zone.
+This permits a zone administrator, for example, to sign a zone with one
+key on one machine, move the resulting partially-signed zone to a second
+machine, and sign it again with a second key.
+
+An unfortunate side-effect of this flexibility is that dnssec-signzone
+does not check to make sure it's signing a zone with any valid keys at
+all; an attempt to sign a zone with no keys may appear to have succeeded.
+
+This will be corrected in the next release. In the meantime, ISC
+recommends examining the output of dnssec-signzone to confirm that
+the zone is properly signed by all keys.
-.\" Copyright (C) 2004-2009 Internet Systems Consortium, Inc. ("ISC")
+.\" Copyright (C) 2004-2008 Internet Systems Consortium, Inc. ("ISC")
.\" Copyright (C) 2000-2003 Internet Software Consortium.
.\"
.\" Permission to use, copy, modify, and distribute this software for any
.\" OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
.\" PERFORMANCE OF THIS SOFTWARE.
.\"
-.\" $Id: dnssec-signzone.8,v 1.47.44.2 2009/06/07 01:53:42 tbox Exp $
+.\" $Id: dnssec-signzone.8,v 1.47.44.3 2009/06/08 22:23:06 each Exp $
.\"
.hy 0
.ad l
-.\" Title: dnssec\-signzone
-.\" Author:
-.\" Generator: DocBook XSL Stylesheets v1.71.1 <http://docbook.sf.net/>
-.\" Date: June 05, 2009
-.\" Manual: BIND9
-.\" Source: BIND9
-.\"
-.TH "DNSSEC\-SIGNZONE" "8" "June 05, 2009" "BIND9" "BIND9"
-.\" disable hyphenation
-.nh
-.\" disable justification (adjust text to left margin only)
-.ad l
-.SH "NAME"
-dnssec\-signzone \- DNSSEC zone signing tool
+.\"Generated by db2man.xsl. Don't modify this, modify the source.
+.de Sh \" Subsection
+.br
+.if t .Sp
+.ne 5
+.PP
+\fB\\$1\fR
+.PP
+..
+.de Sp \" Vertical space (when we can't use .PP)
+.if t .sp .5v
+.if n .sp
+..
+.de Ip \" List item
+.br
+.ie \\n(.$>=3 .ne \\$3
+.el .ne 3
+.IP "\\$1" \\$2
+..
+.TH "DNSSEC-SIGNZONE" 8 "June 05, 2009" "" ""
+.SH NAME
+dnssec-signzone \- DNSSEC zone signing tool
.SH "SYNOPSIS"
.HP 16
-\fBdnssec\-signzone\fR [\fB\-a\fR] [\fB\-c\ \fR\fB\fIclass\fR\fR] [\fB\-d\ \fR\fB\fIdirectory\fR\fR] [\fB\-e\ \fR\fB\fIend\-time\fR\fR] [\fB\-f\ \fR\fB\fIoutput\-file\fR\fR] [\fB\-g\fR] [\fB\-h\fR] [\fB\-k\ \fR\fB\fIkey\fR\fR] [\fB\-l\ \fR\fB\fIdomain\fR\fR] [\fB\-i\ \fR\fB\fIinterval\fR\fR] [\fB\-I\ \fR\fB\fIinput\-format\fR\fR] [\fB\-j\ \fR\fB\fIjitter\fR\fR] [\fB\-N\ \fR\fB\fIsoa\-serial\-format\fR\fR] [\fB\-o\ \fR\fB\fIorigin\fR\fR] [\fB\-O\ \fR\fB\fIoutput\-format\fR\fR] [\fB\-p\fR] [\fB\-P\fR] [\fB\-r\ \fR\fB\fIrandomdev\fR\fR] [\fB\-s\ \fR\fB\fIstart\-time\fR\fR] [\fB\-t\fR] [\fB\-v\ \fR\fB\fIlevel\fR\fR] [\fB\-z\fR] [\fB\-3\ \fR\fB\fIsalt\fR\fR] [\fB\-H\ \fR\fB\fIiterations\fR\fR] [\fB\-A\fR] {zonefile} [key...]
+\fBdnssec\-signzone\fR [\fB\-a\fR] [\fB\-c\ \fIclass\fR\fR] [\fB\-d\ \fIdirectory\fR\fR] [\fB\-e\ \fIend\-time\fR\fR] [\fB\-f\ \fIoutput\-file\fR\fR] [\fB\-g\fR] [\fB\-h\fR] [\fB\-k\ \fIkey\fR\fR] [\fB\-l\ \fIdomain\fR\fR] [\fB\-i\ \fIinterval\fR\fR] [\fB\-I\ \fIinput\-format\fR\fR] [\fB\-j\ \fIjitter\fR\fR] [\fB\-N\ \fIsoa\-serial\-format\fR\fR] [\fB\-o\ \fIorigin\fR\fR] [\fB\-O\ \fIoutput\-format\fR\fR] [\fB\-p\fR] [\fB\-r\ \fIrandomdev\fR\fR] [\fB\-s\ \fIstart\-time\fR\fR] [\fB\-t\fR] [\fB\-v\ \fIlevel\fR\fR] [\fB\-z\fR] [\fB\-3\ \fIsalt\fR\fR] [\fB\-H\ \fIiterations\fR\fR] [\fB\-A\fR] {zonefile} [key...]
.SH "DESCRIPTION"
.PP
-\fBdnssec\-signzone\fR
-signs a zone. It generates NSEC and RRSIG records and produces a signed version of the zone. The security status of delegations from the signed zone (that is, whether the child zones are secure or not) is determined by the presence or absence of a
-\fIkeyset\fR
-file for each child zone.
+\fBdnssec\-signzone\fR signs a zone\&. It generates NSEC and RRSIG records and produces a signed version of the zone\&. The security status of delegations from the signed zone (that is, whether the child zones are secure or not) is determined by the presence or absence of a \fIkeyset\fR file for each child zone\&.
.SH "OPTIONS"
-.PP
+.TP
\-a
-.RS 4
-Verify all generated signatures.
-.RE
-.PP
+Verify all generated signatures\&.
+.TP
\-c \fIclass\fR
-.RS 4
-Specifies the DNS class of the zone.
-.RE
-.PP
+Specifies the DNS class of the zone\&.
+.TP
\-k \fIkey\fR
-.RS 4
-Treat specified key as a key signing key ignoring any key flags. This option may be specified multiple times.
-.RE
-.PP
+Treat specified key as a key signing key ignoring any key flags\&. This option may be specified multiple times\&.
+.TP
\-l \fIdomain\fR
-.RS 4
-Generate a DLV set in addition to the key (DNSKEY) and DS sets. The domain is appended to the name of the records.
-.RE
-.PP
+Generate a DLV set in addition to the key (DNSKEY) and DS sets\&. The domain is appended to the name of the records\&.
+.TP
\-d \fIdirectory\fR
-.RS 4
-Look for
-\fIkeyset\fR
-files in
-\fBdirectory\fR
-as the directory
-.RE
-.PP
+Look for \fIkeyset\fR files in \fBdirectory\fR as the directory
+.TP
\-g
-.RS 4
-Generate DS records for child zones from keyset files. Existing DS records will be removed.
-.RE
-.PP
+Generate DS records for child zones from keyset files\&. Existing DS records will be removed\&.
+.TP
\-s \fIstart\-time\fR
-.RS 4
-Specify the date and time when the generated RRSIG records become valid. This can be either an absolute or relative time. An absolute start time is indicated by a number in YYYYMMDDHHMMSS notation; 20000530144500 denotes 14:45:00 UTC on May 30th, 2000. A relative start time is indicated by +N, which is N seconds from the current time. If no
-\fBstart\-time\fR
-is specified, the current time minus 1 hour (to allow for clock skew) is used.
-.RE
-.PP
+Specify the date and time when the generated RRSIG records become valid\&. This can be either an absolute or relative time\&. An absolute start time is indicated by a number in YYYYMMDDHHMMSS notation; 20000530144500 denotes 14:45:00 UTC on May 30th, 2000\&. A relative start time is indicated by +N, which is N seconds from the current time\&. If no \fBstart\-time\fR is specified, the current time minus 1 hour (to allow for clock skew) is used\&.
+.TP
\-e \fIend\-time\fR
-.RS 4
-Specify the date and time when the generated RRSIG records expire. As with
-\fBstart\-time\fR, an absolute time is indicated in YYYYMMDDHHMMSS notation. A time relative to the start time is indicated with +N, which is N seconds from the start time. A time relative to the current time is indicated with now+N. If no
-\fBend\-time\fR
-is specified, 30 days from the start time is used as a default.
-.RE
-.PP
+Specify the date and time when the generated RRSIG records expire\&. As with \fBstart\-time\fR, an absolute time is indicated in YYYYMMDDHHMMSS notation\&. A time relative to the start time is indicated with +N, which is N seconds from the start time\&. A time relative to the current time is indicated with now+N\&. If no \fBend\-time\fR is specified, 30 days from the start time is used as a default\&.
+.TP
\-f \fIoutput\-file\fR
-.RS 4
-The name of the output file containing the signed zone. The default is to append
-\fI.signed\fR
-to the input filename.
-.RE
-.PP
+The name of the output file containing the signed zone\&. The default is to append \fI\&.signed\fR to the input filename\&.
+.TP
\-h
-.RS 4
-Prints a short summary of the options and arguments to
-\fBdnssec\-signzone\fR.
-.RE
-.PP
+Prints a short summary of the options and arguments to \fBdnssec\-signzone\fR\&.
+.TP
\-i \fIinterval\fR
-.RS 4
-When a previously\-signed zone is passed as input, records may be resigned. The
-\fBinterval\fR
-option specifies the cycle interval as an offset from the current time (in seconds). If a RRSIG record expires after the cycle interval, it is retained. Otherwise, it is considered to be expiring soon, and it will be replaced.
-.sp
-The default cycle interval is one quarter of the difference between the signature end and start times. So if neither
-\fBend\-time\fR
-or
-\fBstart\-time\fR
-are specified,
-\fBdnssec\-signzone\fR
-generates signatures that are valid for 30 days, with a cycle interval of 7.5 days. Therefore, if any existing RRSIG records are due to expire in less than 7.5 days, they would be replaced.
-.RE
-.PP
+When a previously\-signed zone is passed as input, records may be resigned\&. The \fBinterval\fR option specifies the cycle interval as an offset from the current time (in seconds)\&. If a RRSIG record expires after the cycle interval, it is retained\&. Otherwise, it is considered to be expiring soon, and it will be replaced\&.
+The default cycle interval is one quarter of the difference between the signature end and start times\&. So if neither \fBend\-time\fR or \fBstart\-time\fR are specified, \fBdnssec\-signzone\fR generates signatures that are valid for 30 days, with a cycle interval of 7\&.5 days\&. Therefore, if any existing RRSIG records are due to expire in less than 7\&.5 days, they would be replaced\&.
+.TP
\-I \fIinput\-format\fR
-.RS 4
-The format of the input zone file. Possible formats are
-\fB"text"\fR
-(default) and
-\fB"raw"\fR. This option is primarily intended to be used for dynamic signed zones so that the dumped zone file in a non\-text format containing updates can be signed directly. The use of this option does not make much sense for non\-dynamic zones.
-.RE
-.PP
+The format of the input zone file\&. Possible formats are \fB"text"\fR (default) and \fB"raw"\fR\&. This option is primarily intended to be used for dynamic signed zones so that the dumped zone file in a non\-text format containing updates can be signed directly\&. The use of this option does not make much sense for non\-dynamic zones\&.
+.TP
\-j \fIjitter\fR
-.RS 4
-When signing a zone with a fixed signature lifetime, all RRSIG records issued at the time of signing expires simultaneously. If the zone is incrementally signed, i.e. a previously\-signed zone is passed as input to the signer, all expired signatures have to be regenerated at about the same time. The
-\fBjitter\fR
-option specifies a jitter window that will be used to randomize the signature expire time, thus spreading incremental signature regeneration over time.
-.sp
-Signature lifetime jitter also to some extent benefits validators and servers by spreading out cache expiration, i.e. if large numbers of RRSIGs don't expire at the same time from all caches there will be less congestion than if all validators need to refetch at mostly the same time.
-.RE
-.PP
+When signing a zone with a fixed signature lifetime, all RRSIG records issued at the time of signing expires simultaneously\&. If the zone is incrementally signed, i\&.e\&. a previously\-signed zone is passed as input to the signer, all expired signatures have to be regenerated at about the same time\&. The \fBjitter\fR option specifies a jitter window that will be used to randomize the signature expire time, thus spreading incremental signature regeneration over time\&.
+Signature lifetime jitter also to some extent benefits validators and servers by spreading out cache expiration, i\&.e\&. if large numbers of RRSIGs don't expire at the same time from all caches there will be less congestion than if all validators need to refetch at mostly the same time\&.
+.TP
\-n \fIncpus\fR
-.RS 4
-Specifies the number of threads to use. By default, one thread is started for each detected CPU.
-.RE
-.PP
+Specifies the number of threads to use\&. By default, one thread is started for each detected CPU\&.
+.TP
\-N \fIsoa\-serial\-format\fR
-.RS 4
-The SOA serial number format of the signed zone. Possible formats are
-\fB"keep"\fR
-(default),
-\fB"increment"\fR
-and
-\fB"unixtime"\fR.
-.RS 4
-.PP
+The SOA serial number format of the signed zone\&. Possible formats are \fB"keep"\fR (default), \fB"increment"\fR and \fB"unixtime"\fR\&.
+.RS
+.TP
\fB"keep"\fR
-.RS 4
-Do not modify the SOA serial number.
-.RE
-.PP
+Do not modify the SOA serial number\&.
+.TP
\fB"increment"\fR
-.RS 4
-Increment the SOA serial number using RFC 1982 arithmetics.
-.RE
-.PP
+Increment the SOA serial number using RFC 1982 arithmetics\&.
+.TP
\fB"unixtime"\fR
-.RS 4
-Set the SOA serial number to the number of seconds since epoch.
+Set the SOA serial number to the number of seconds since epoch\&.
.RE
-.RE
-.RE
-.PP
+.IP
+.TP
\-o \fIorigin\fR
-.RS 4
-The zone origin. If not specified, the name of the zone file is assumed to be the origin.
-.RE
-.PP
+The zone origin\&. If not specified, the name of the zone file is assumed to be the origin\&.
+.TP
\-O \fIoutput\-format\fR
-.RS 4
-The format of the output file containing the signed zone. Possible formats are
-\fB"text"\fR
-(default) and
-\fB"raw"\fR.
-.RE
-.PP
+The format of the output file containing the signed zone\&. Possible formats are \fB"text"\fR (default) and \fB"raw"\fR\&.
+.TP
\-p
-.RS 4
-Use pseudo\-random data when signing the zone. This is faster, but less secure, than using real random data. This option may be useful when signing large zones or when the entropy source is limited.
-.RE
-.PP
-\-P
-.RS 4
-Disable post sign verification tests.
-.sp
-The post sign verification test ensures that for each algorithm in use there is at least one non revoked self signed KSK key, that all revoked KSK keys are self signed, and that all records in the zone are signed by the algorithm. This option skips these tests.
-.RE
-.PP
+Use pseudo\-random data when signing the zone\&. This is faster, but less secure, than using real random data\&. This option may be useful when signing large zones or when the entropy source is limited\&.
+.TP
\-r \fIrandomdev\fR
-.RS 4
-Specifies the source of randomness. If the operating system does not provide a
-\fI/dev/random\fR
-or equivalent device, the default source of randomness is keyboard input.
-\fIrandomdev\fR
-specifies the name of a character device or file containing random data to be used instead of the default. The special value
-\fIkeyboard\fR
-indicates that keyboard input should be used.
-.RE
-.PP
+Specifies the source of randomness\&. If the operating system does not provide a \fI/dev/random\fR or equivalent device, the default source of randomness is keyboard input\&. \fIrandomdev\fR specifies the name of a character device or file containing random data to be used instead of the default\&. The special value \fIkeyboard\fR indicates that keyboard input should be used\&.
+.TP
\-t
-.RS 4
-Print statistics at completion.
-.RE
-.PP
+Print statistics at completion\&.
+.TP
\-v \fIlevel\fR
-.RS 4
-Sets the debugging level.
-.RE
-.PP
+Sets the debugging level\&.
+.TP
\-z
-.RS 4
-Ignore KSK flag on key when determining what to sign.
-.RE
-.PP
+Ignore KSK flag on key when determining what to sign\&.
+.TP
\-3 \fIsalt\fR
-.RS 4
-Generate a NSEC3 chain with the given hex encoded salt. A dash (\fIsalt\fR) can be used to indicate that no salt is to be used when generating the NSEC3 chain.
-.RE
-.PP
+Generate a NSEC3 chain with the given hex encoded salt\&. A dash (\fIsalt\fR) can be used to indicate that no salt is to be used when generating the NSEC3 chain\&.
+.TP
\-H \fIiterations\fR
-.RS 4
-When generating a NSEC3 chain use this many interations. The default is 100.
-.RE
-.PP
+When generating a NSEC3 chain use this many interations\&. The default is 100\&.
+.TP
\-A
-.RS 4
-When generating a NSEC3 chain set the OPTOUT flag on all NSEC3 records and do not generate NSEC3 records for insecure delegations.
-.RE
-.PP
+When generating a NSEC3 chain set the OPTOUT flag on all NSEC3 records and do not generate NSEC3 records for insecure delegations\&.
+.TP
zonefile
-.RS 4
-The file containing the zone to be signed.
-.RE
-.PP
+The file containing the zone to be signed\&.
+.TP
key
-.RS 4
-Specify which keys should be used to sign the zone. If no keys are specified, then the zone will be examined for DNSKEY records at the zone apex. If these are found and there are matching private keys, in the current directory, then these will be used for signing.
-.RE
+Specify which keys should be used to sign the zone\&. If no keys are specified, then the zone will be examined for DNSKEY records at the zone apex\&. If these are found and there are matching private keys, in the current directory, then these will be used for signing\&.
.SH "EXAMPLE"
.PP
-The following command signs the
-\fBexample.com\fR
-zone with the DSA key generated by
-\fBdnssec\-keygen\fR
-(Kexample.com.+003+17247). The zone's keys must be in the master file (\fIdb.example.com\fR). This invocation looks for
-\fIkeyset\fR
-files, in the current directory, so that DS records can be generated from them (\fB\-g\fR).
-.sp
-.RS 4
+The following command signs the \fBexample\&.com\fR zone with the DSA key generated by \fBdnssec\-keygen\fR (Kexample\&.com\&.+003+17247)\&. The zone's keys must be in the master file (\fIdb\&.example\&.com\fR)\&. This invocation looks for \fIkeyset\fR files, in the current directory, so that DS records can be generated from them (\fB\-g\fR)\&.
.nf
-% dnssec\-signzone \-g \-o example.com db.example.com \\
-Kexample.com.+003+17247
-db.example.com.signed
+% dnssec\-signzone \-g \-o example\&.com db\&.example\&.com \\
+Kexample\&.com\&.+003+17247
+db\&.example\&.com\&.signed
%
.fi
-.RE
.PP
-In the above example,
-\fBdnssec\-signzone\fR
-creates the file
-\fIdb.example.com.signed\fR. This file should be referenced in a zone statement in a
-\fInamed.conf\fR
-file.
+In the above example, \fBdnssec\-signzone\fR creates the file \fIdb\&.example\&.com\&.signed\fR\&. This file should be referenced in a zone statement in a \fInamed\&.conf\fR file\&.
.PP
-This example re\-signs a previously signed zone with default parameters. The private keys are assumed to be in the current directory.
-.sp
-.RS 4
+This example re\-signs a previously signed zone with default parameters\&. The private keys are assumed to be in the current directory\&.
.nf
-% cp db.example.com.signed db.example.com
-% dnssec\-signzone \-o example.com db.example.com
-db.example.com.signed
+% cp db\&.example\&.com\&.signed db\&.example\&.com
+% dnssec\-signzone \-o example\&.com db\&.example\&.com
+db\&.example\&.com\&.signed
%
.fi
-.RE
.SH "SEE ALSO"
.PP
-\fBdnssec\-keygen\fR(8),
-BIND 9 Administrator Reference Manual,
-RFC 4033.
+\fBdnssec\-keygen\fR(8), BIND 9 Administrator Reference Manual, RFC 4033\&.
.SH "AUTHOR"
.PP
-Internet Systems Consortium
-.SH "COPYRIGHT"
-Copyright \(co 2004\-2009 Internet Systems Consortium, Inc. ("ISC")
-.br
-Copyright \(co 2000\-2003 Internet Software Consortium.
-.br
+Internet Systems Consortium
* IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: dnssec-signzone.c,v 1.209.12.7 2009/06/05 06:56:40 marka Exp $ */
+/* $Id: dnssec-signzone.c,v 1.209.12.8 2009/06/08 22:23:06 each Exp $ */
/*! \file */
#include <isc/os.h>
#include <isc/print.h>
#include <isc/random.h>
-#include <isc/rwlock.h>
#include <isc/serial.h>
#include <isc/stdio.h>
#include <isc/stdlib.h>
isc_boolean_t issigningkey;
isc_boolean_t isdsk;
isc_boolean_t isksk;
- isc_boolean_t wasused;
- isc_boolean_t commandline;
unsigned int position;
ISC_LINK(signer_key_t) link;
};
static ISC_LIST(signer_key_t) keylist;
static unsigned int keycount = 0;
-isc_rwlock_t keylist_lock;
static isc_stdtime_t starttime = 0, endtime = 0, now;
static int cycle = -1;
static int jitter = 0;
static unsigned int serialformat = SOA_SERIAL_KEEP;
static unsigned int hash_length = 0;
static isc_boolean_t unknownalg = ISC_FALSE;
-static isc_boolean_t disable_zone_check = ISC_FALSE;
#define INCSTAT(counter) \
if (printstats) { \
key->isksk = ISC_FALSE;
key->isdsk = ISC_TRUE;
}
- key->wasused = ISC_FALSE;
- key->commandline = ISC_FALSE;
key->position = keycount++;
ISC_LINK_INIT(key, link);
return (key);
}
/*%
- * Find the key if it is in our list. If it is, return it, otherwise null.
- * No locking is performed here, this must be done by the caller.
+ * Finds the key that generated a RRSIG, if possible. First look at the keys
+ * that we've loaded already, and then see if there's a key on disk.
*/
static signer_key_t *
-keythatsigned_unlocked(dns_rdata_rrsig_t *rrsig) {
+keythatsigned(dns_rdata_rrsig_t *rrsig) {
+ isc_result_t result;
+ dst_key_t *pubkey = NULL, *privkey = NULL;
signer_key_t *key;
key = ISC_LIST_HEAD(keylist);
if (rrsig->keyid == dst_key_id(key->key) &&
rrsig->algorithm == dst_key_alg(key->key) &&
dns_name_equal(&rrsig->signer, dst_key_name(key->key)))
- return (key);
+ return key;
key = ISC_LIST_NEXT(key, link);
}
- return (NULL);
-}
-
-/*%
- * Finds the key that generated a RRSIG, if possible. First look at the keys
- * that we've loaded already, and then see if there's a key on disk.
- */
-static signer_key_t *
-keythatsigned(dns_rdata_rrsig_t *rrsig) {
- isc_result_t result;
- dst_key_t *pubkey = NULL, *privkey = NULL;
- signer_key_t *key;
-
- isc_rwlock_lock(&keylist_lock, isc_rwlocktype_read);
- key = keythatsigned_unlocked(rrsig);
- isc_rwlock_unlock(&keylist_lock, isc_rwlocktype_read);
- if (key != NULL)
- return (key);
-
- /*
- * We did not find the key in our list. Get a write lock now, since
- * we may be modifying the bits. We could do the tryupgrade() dance,
- * but instead just get a write lock and check once again to see if
- * it is on our list. It's possible someone else may have added it
- * after all.
- */
- isc_rwlock_lock(&keylist_lock, isc_rwlocktype_write);
-
- key = keythatsigned_unlocked(rrsig);
- if (key != NULL) {
- isc_rwlock_unlock(&keylist_lock, isc_rwlocktype_write);
- return (key);
- }
result = dst_key_fromfile(&rrsig->signer, rrsig->keyid,
rrsig->algorithm, DST_TYPE_PUBLIC,
NULL, mctx, &pubkey);
- if (result != ISC_R_SUCCESS) {
- isc_rwlock_unlock(&keylist_lock, isc_rwlocktype_write);
+ if (result != ISC_R_SUCCESS)
return (NULL);
- }
result = dst_key_fromfile(&rrsig->signer, rrsig->keyid,
rrsig->algorithm,
} else
key = newkeystruct(pubkey, ISC_FALSE);
ISC_LIST_APPEND(keylist, key, link);
-
- isc_rwlock_unlock(&keylist_lock, isc_rwlocktype_write);
return (key);
}
keep = ISC_TRUE;
wassignedby[key->position] = ISC_TRUE;
nowsignedby[key->position] = ISC_TRUE;
- key->wasused = ISC_TRUE;
} else {
vbprintf(2, "\trrsig by %s dropped - %s\n",
sigstr,
keep = ISC_TRUE;
wassignedby[key->position] = ISC_TRUE;
nowsignedby[key->position] = ISC_TRUE;
- key->wasused = ISC_TRUE;
} else {
vbprintf(2, "\trrsig by %s dropped - %s\n",
sigstr,
isc_buffer_init(&b, array, sizeof(array));
signwithkey(name, set, &trdata, key->key, &b);
nowsignedby[key->position] = ISC_TRUE;
- key->wasused = ISC_TRUE;
tuple = NULL;
result = dns_difftuple_create(mctx, DNS_DIFFOP_ADD,
name, ttl, &trdata,
dns_rdata_init(&trdata);
isc_buffer_init(&b, array, sizeof(array));
signwithkey(name, set, &trdata, key->key, &b);
- key->wasused = ISC_TRUE;
tuple = NULL;
result = dns_difftuple_create(mctx, DNS_DIFFOP_ADD, name,
ttl, &trdata, &tuple);
dns_rdataset_t set;
isc_result_t result, dresult;
- if (outputformat != dns_masterformat_text || !disable_zone_check)
+ if (outputformat != dns_masterformat_text)
return;
dns_rdataset_init(&set);
dns_dbiterator_destroy(&gdbiter);
}
-static isc_boolean_t
-goodsig(dns_rdata_t *sigrdata, dns_name_t *name, dns_rdataset_t *keyrdataset,
- dns_rdataset_t *rdataset)
-{
- dns_rdata_dnskey_t key;
- dns_rdata_rrsig_t sig;
- dst_key_t *dstkey = NULL;
- isc_result_t result;
-
- dns_rdata_tostruct(sigrdata, &sig, NULL);
-
- for (result = dns_rdataset_first(keyrdataset);
- result == ISC_R_SUCCESS;
- result = dns_rdataset_next(keyrdataset)) {
- dns_rdata_t rdata = DNS_RDATA_INIT;
- dns_rdataset_current(keyrdataset, &rdata);
- dns_rdata_tostruct(&rdata, &key, NULL);
- result = dns_dnssec_keyfromrdata(gorigin, &rdata, mctx,
- &dstkey);
- if (result != ISC_R_SUCCESS)
- return (ISC_FALSE);
- if (sig.algorithm != key.algorithm ||
- sig.keyid != dst_key_id(dstkey) ||
- !dns_name_equal(&sig.signer, gorigin)) {
- dst_key_free(&dstkey);
- continue;
- }
- result = dns_dnssec_verify(name, rdataset, dstkey, ISC_FALSE,
- mctx, sigrdata);
- dst_key_free(&dstkey);
- if (result == ISC_R_SUCCESS)
- return(ISC_TRUE);
- }
- return (ISC_FALSE);
-}
-
-static void
-verifyset(dns_rdataset_t *rdataset, dns_name_t *name, dns_dbnode_t *node,
- dns_rdataset_t *keyrdataset, unsigned char *ksk_algorithms,
- char *bad_algorithms)
-{
- unsigned char set_algorithms[256];
- char namebuf[DNS_NAME_FORMATSIZE];
- char algbuf[80];
- char typebuf[80];
- dns_rdataset_t sigrdataset;
- dns_rdatasetiter_t *rdsiter = NULL;
- isc_result_t result;
- int i;
-
- dns_rdataset_init(&sigrdataset);
- result = dns_db_allrdatasets(gdb, node, gversion, 0, &rdsiter);
- check_result(result, "dns_db_allrdatasets()");
- for (result = dns_rdatasetiter_first(rdsiter);
- result == ISC_R_SUCCESS;
- result = dns_rdatasetiter_next(rdsiter)) {
- dns_rdatasetiter_current(rdsiter, &sigrdataset);
- if (sigrdataset.type == dns_rdatatype_rrsig &&
- sigrdataset.covers == rdataset->type)
- break;
- dns_rdataset_disassociate(&sigrdataset);
- }
- if (result != ISC_R_SUCCESS) {
- dns_name_format(name, namebuf, sizeof(namebuf));
- type_format(rdataset->type, typebuf, sizeof(typebuf));
- fprintf(stderr, "no signatures for %s/%s\n", namebuf, typebuf);
- for (i = 0; i < 256; i++)
- if (ksk_algorithms[i])
- bad_algorithms[i] = 1;
- return;
- }
-
- memset(set_algorithms, 0, sizeof(set_algorithms));
- for (result = dns_rdataset_first(&sigrdataset);
- result == ISC_R_SUCCESS;
- result = dns_rdataset_next(&sigrdataset)) {
- dns_rdata_t rdata = DNS_RDATA_INIT;
- dns_rdata_rrsig_t sig;
-
- dns_rdataset_current(&sigrdataset, &rdata);
- dns_rdata_tostruct(&rdata, &sig, NULL);
- if (set_algorithms[sig.algorithm] ||
- !ksk_algorithms[sig.algorithm])
- continue;
- if (goodsig(&rdata, name, keyrdataset, rdataset))
- set_algorithms[sig.algorithm] = 1;
- }
- dns_rdatasetiter_destroy(&rdsiter);
- if (memcmp(set_algorithms, ksk_algorithms, sizeof(set_algorithms))) {
- dns_name_format(name, namebuf, sizeof(namebuf));
- type_format(rdataset->type, typebuf, sizeof(typebuf));
- for (i = 0; i < 256; i++)
- if (ksk_algorithms[i] && !set_algorithms[i]) {
- alg_format(i, algbuf, sizeof(algbuf));
- fprintf(stderr, "Missing %s signature for "
- "%s %s\n", algbuf, namebuf, typebuf);
- bad_algorithms[i] = 1;
- }
- }
- dns_rdataset_disassociate(&sigrdataset);
-}
-
-static void
-verifynode(dns_name_t *name, dns_dbnode_t *node, isc_boolean_t delegation,
- dns_rdataset_t *keyrdataset, unsigned char *ksk_algorithms,
- unsigned char *bad_algorithms)
-{
- dns_rdataset_t rdataset;
- dns_rdatasetiter_t *rdsiter = NULL;
- isc_result_t result;
-
- result = dns_db_allrdatasets(gdb, node, gversion, 0, &rdsiter);
- check_result(result, "dns_db_allrdatasets()");
- result = dns_rdatasetiter_first(rdsiter);
- dns_rdataset_init(&rdataset);
- while (result == ISC_R_SUCCESS) {
- dns_rdatasetiter_current(rdsiter, &rdataset);
- if (rdataset.type != dns_rdatatype_rrsig &&
- rdataset.type != dns_rdatatype_dnskey &&
- (!delegation || rdataset.type == dns_rdatatype_ds ||
- rdataset.type == dns_rdatatype_nsec)) {
- verifyset(&rdataset, name, node, keyrdataset,
- ksk_algorithms, bad_algorithms);
- }
- dns_rdataset_disassociate(&rdataset);
- result = dns_rdatasetiter_next(rdsiter);
- }
- if (result != ISC_R_NOMORE)
- fatal("rdataset iteration failed: %s",
- isc_result_totext(result));
- dns_rdatasetiter_destroy(&rdsiter);
-}
-
-/*%
- * Verify that certain things are sane:
- *
- * The apex has a DNSKEY record with at least one KSK and at least
- * one ZSK.
- *
- * The DNSKEY record was signed with at least one of the KSKs in this
- * set.
- *
- * The rest of the zone was signed with at least one of the ZSKs
- * present in the DNSKEY RRSET.
- */
-static void
-verifyzone(void) {
- char algbuf[80];
- dns_dbiterator_t *dbiter = NULL;
- dns_dbnode_t *node = NULL, *nextnode = NULL;
- dns_fixedname_t fname, fnextname, fzonecut;
- dns_name_t *name, *nextname, *zonecut;
- dns_rdata_dnskey_t dnskey;
- dns_rdata_t rdata = DNS_RDATA_INIT;
- dns_rdataset_t rdataset;
- dns_rdataset_t sigrdataset;
- int i;
- isc_boolean_t done = ISC_FALSE;
- isc_boolean_t first = ISC_TRUE;
- isc_boolean_t goodksk = ISC_FALSE;
- isc_boolean_t goodzsk = ISC_FALSE;
- isc_result_t result;
- unsigned char revoked[256];
- unsigned char standby[256];
- unsigned char ksk_algorithms[256];
- unsigned char zsk_algorithms[256];
- unsigned char bad_algorithms[256];
-#ifdef ALLOW_KSKLESS_ZONES
- isc_boolean_t allzsksigned = ISC_TRUE;
- unsigned char self_algorithms[256];
-#endif
-
- if (disable_zone_check)
- return;
-
- result = dns_db_findnode(gdb, gorigin, ISC_FALSE, &node);
- if (result != ISC_R_SUCCESS)
- fatal("failed to find the zone's origin: %s",
- isc_result_totext(result));
-
- dns_rdataset_init(&rdataset);
- dns_rdataset_init(&sigrdataset);
- result = dns_db_findrdataset(gdb, node, gversion,
- dns_rdatatype_dnskey,
- 0, 0, &rdataset, &sigrdataset);
- dns_db_detachnode(gdb, &node);
- if (result != ISC_R_SUCCESS)
- fatal("cannot find DNSKEY rrset\n");
-
- if (!dns_rdataset_isassociated(&sigrdataset))
- fatal("cannot find DNSKEY RRSIGs\n");
-
- memset(revoked, 0, sizeof(revoked));
- memset(standby, 0, sizeof(revoked));
- memset(ksk_algorithms, 0, sizeof(ksk_algorithms));
- memset(zsk_algorithms, 0, sizeof(zsk_algorithms));
- memset(bad_algorithms, 0, sizeof(bad_algorithms));
-#ifdef ALLOW_KSKLESS_ZONES
- memset(self_algorithms, 0, sizeof(self_algorithms));
-#endif
-
- /*
- * Check that the DNSKEY RR has at least one self signing KSK and
- * one ZSK per algorithm in it.
- */
- for (result = dns_rdataset_first(&rdataset);
- result == ISC_R_SUCCESS;
- result = dns_rdataset_next(&rdataset)) {
- dns_rdataset_current(&rdataset, &rdata);
- result = dns_rdata_tostruct(&rdata, &dnskey, NULL);
- check_result(result, "dns_rdata_tostruct");
-
- if ((dnskey.flags & DNS_KEYOWNER_ZONE) == 0)
- ;
- else if ((dnskey.flags & DNS_KEYFLAG_REVOKE) != 0) {
- if ((dnskey.flags & DNS_KEYFLAG_KSK) != 0 &&
- !dns_dnssec_selfsigns(&rdata, gorigin, &rdataset,
- &sigrdataset, ISC_FALSE,
- mctx)) {
- char namebuf[DNS_NAME_FORMATSIZE];
- char buffer[1024];
- isc_buffer_t buf;
-
- dns_name_format(gorigin, namebuf,
- sizeof(namebuf));
- isc_buffer_init(&buf, buffer, sizeof(buffer));
- result = dns_rdata_totext(&rdata, NULL, &buf);
- check_result(result, "dns_rdata_totext");
- fatal("revoked KSK is not self signed:\n"
- "%s DNSKEY %.*s", namebuf,
- (int)isc_buffer_usedlength(&buf), buffer);
- }
- if ((dnskey.flags & DNS_KEYFLAG_KSK) != 0 &&
- revoked[dnskey.algorithm] != 255)
- revoked[dnskey.algorithm]++;
- } else if ((dnskey.flags & DNS_KEYFLAG_KSK) != 0) {
- if (dns_dnssec_selfsigns(&rdata, gorigin, &rdataset,
- &sigrdataset, ISC_FALSE, mctx)) {
- if (ksk_algorithms[dnskey.algorithm] != 255)
- ksk_algorithms[dnskey.algorithm]++;
- goodksk = ISC_TRUE;
- } else {
- if (standby[dnskey.algorithm] != 255)
- standby[dnskey.algorithm]++;
- }
- } else if (dns_dnssec_selfsigns(&rdata, gorigin, &rdataset,
- &sigrdataset, ISC_FALSE,
- mctx)) {
-#ifdef ALLOW_KSKLESS_ZONES
- if (self_algorithms[dnskey.algorithm] != 255)
- self_algorithms[dnskey.algorithm]++;
-#endif
- if (zsk_algorithms[dnskey.algorithm] != 255)
- zsk_algorithms[dnskey.algorithm]++;
- goodzsk = ISC_TRUE;
- } else {
- if (zsk_algorithms[dnskey.algorithm] != 255)
- zsk_algorithms[dnskey.algorithm]++;
-#ifdef ALLOW_KSKLESS_ZONES
- allzsksigned = ISC_FALSE;
-#endif
- }
- dns_rdata_freestruct(&dnskey);
- dns_rdata_reset(&rdata);
- }
- dns_rdataset_disassociate(&sigrdataset);
-
- if (!goodksk) {
-#ifdef ALLOW_KSKLESS_ZONES
- if (!goodzsk)
- fatal("no self signing keys found");
- fprintf(stderr, "No self signing KSK found. Using self signed "
- "ZSK's for active algorithm list.\n");
- memcpy(ksk_algorithms, self_algorithms, sizeof(ksk_algorithms));
- if (!allzsksigned)
- fprintf(stderr, "warning: not all ZSK's are self "
- "signed.\n");
-#else
- fatal("no self signed KSK's found");
-#endif
- }
-
- fprintf(stderr, "Verifying the zone using the following algorithms:");
- for (i = 0; i < 256; i++) {
- if (ksk_algorithms[i]) {
- alg_format(i, algbuf, sizeof(algbuf));
- fprintf(stderr, " %s", algbuf);
- }
- }
- fprintf(stderr, ".\n");
-
- if (memcmp(ksk_algorithms, zsk_algorithms, sizeof(ksk_algorithms))) {
- for (i = 0; i < 256; i++) {
- if (ksk_algorithms[i] == zsk_algorithms[i])
- continue;
- alg_format(i, algbuf, sizeof(algbuf));
- fprintf(stderr, "Missing %s for algorithm %s\n",
- ksk_algorithms[i] ? "ZSK" : "self signing KSK",
- algbuf);
- bad_algorithms[i] = 1;
- }
- }
-
- /*
- * Check that all the other records were signed by keys that are
- * present in the DNSKEY RRSET.
- */
-
- dns_fixedname_init(&fname);
- name = dns_fixedname_name(&fname);
- dns_fixedname_init(&fnextname);
- nextname = dns_fixedname_name(&fnextname);
- dns_fixedname_init(&fzonecut);
- zonecut = NULL;
-
- result = dns_db_createiterator(gdb, DNS_DB_NONSEC3, &dbiter);
- check_result(result, "dns_db_createiterator()");
-
- result = dns_dbiterator_first(dbiter);
- check_result(result, "dns_dbiterator_first()");
-
- while (!done) {
- isc_boolean_t isdelegation = ISC_FALSE;
-
- dns_dbiterator_current(dbiter, &node, name);
- if (delegation(name, node, NULL)) {
- zonecut = dns_fixedname_name(&fzonecut);
- dns_name_copy(name, zonecut, NULL);
- isdelegation = ISC_TRUE;
- }
- verifynode(name, node, isdelegation, &rdataset,
- ksk_algorithms, bad_algorithms);
- result = dns_dbiterator_next(dbiter);
- nextnode = NULL;
- while (result == ISC_R_SUCCESS) {
- result = dns_dbiterator_current(dbiter, &nextnode,
- nextname);
- if (result != ISC_R_SUCCESS)
- break;
- if (!dns_name_issubdomain(nextname, gorigin) ||
- (zonecut != NULL &&
- dns_name_issubdomain(nextname, zonecut)))
- {
- dns_db_detachnode(gdb, &nextnode);
- result = dns_dbiterator_next(dbiter);
- continue;
- }
- dns_db_detachnode(gdb, &nextnode);
- break;
- }
- if (result == ISC_R_NOMORE) {
- done = ISC_TRUE;
- } else if (result != ISC_R_SUCCESS)
- fatal("iterating through the database failed: %s",
- isc_result_totext(result));
- dns_db_detachnode(gdb, &node);
- }
-
- dns_dbiterator_destroy(&dbiter);
-
- result = dns_db_createiterator(gdb, DNS_DB_NSEC3ONLY, &dbiter);
- check_result(result, "dns_db_createiterator()");
-
- for (result = dns_dbiterator_first(dbiter);
- result == ISC_R_SUCCESS;
- result = dns_dbiterator_next(dbiter) ) {
- dns_dbiterator_current(dbiter, &node, name);
- verifynode(name, node, ISC_FALSE, &rdataset,
- ksk_algorithms, bad_algorithms);
- dns_db_detachnode(gdb, &node);
- }
- dns_dbiterator_destroy(&dbiter);
-
- dns_rdataset_disassociate(&rdataset);
-
- /*
- * If we made it this far, we have what we consider a properly signed
- * zone. Set the good flag.
- */
- for (i = 0; i < 256; i++) {
- if (bad_algorithms[i]) {
- if (first)
- fprintf(stderr, "The zone is not fully signed "
- "for the following algorithms:");
- alg_format(i, algbuf, sizeof(algbuf));
- fprintf(stderr, " %s", algbuf);
- first = ISC_FALSE;
- }
- }
- if (!first) {
- fprintf(stderr, ".\n");
- fatal("DNSSEC completeness test failed.");
- }
-
- if (goodksk) {
- /*
- * Print the success summary.
- */
- fprintf(stderr, "Zone signing complete:\n");
- for (i = 0; i < 256; i++) {
- if (zsk_algorithms[i] || ksk_algorithms[i] ||
- revoked[i] || standby[i]) {
- alg_format(i, algbuf, sizeof(algbuf));
- fprintf(stderr, "Algorithm: %s: ZSKs: %u, "
- "KSKs: %u active, %u revoked, %u "
- "stand-by\n", algbuf,
- zsk_algorithms[i], ksk_algorithms[i],
- revoked[i], standby[i]);
- }
- }
- }
-}
-
/*%
* Sign the apex of the zone.
* Note the origin may not be the first node if there are out of zone
result = dns_rdataset_next(&rdataset)) {
dns_rdata_init(&rdata);
dns_rdataset_current(&rdataset, &rdata);
- result = dns_rdata_tostruct(&rdata, &nsec3, NULL);
- check_result(result, "dns_rdata_tostruct");
+ dns_rdata_tostruct(&rdata, &nsec3, NULL);
if (nsec3.hash == hashalg &&
nsec3.iterations == iterations &&
nsec3.salt_length == salt_length &&
dns_rdataset_t rdataset;
dns_rdata_t rdata = DNS_RDATA_INIT;
isc_result_t result;
- dns_rdata_dnskey_t dnskey;
+ dns_rdata_key_t key;
isc_boolean_t have_non_ksk = ISC_FALSE;
dns_db_currentversion(db, ¤tversion);
while (result == ISC_R_SUCCESS) {
dns_rdata_reset(&rdata);
dns_rdataset_current(&rdataset, &rdata);
- result = dns_rdata_tostruct(&rdata, &dnskey, NULL);
+ result = dns_rdata_tostruct(&rdata, &key, NULL);
check_result(result, "dns_rdata_tostruct");
- if ((dnskey.flags & DNS_KEYFLAG_KSK) == 0) {
+ if ((key.flags & DNS_KEYFLAG_KSK) == 0) {
have_non_ksk = ISC_TRUE;
result = ISC_R_NOMORE;
} else
result = dns_rdataset_next(&rdataset);
- dns_rdata_freestruct(&dnskey);
}
dns_rdataset_disassociate(&rdataset);
dns_db_detachnode(db, &node);
dns_db_closeversion(db, ¤tversion, ISC_FALSE);
- if (!have_non_ksk && !ignoreksk) {
- if (disable_zone_check)
- fprintf(stderr, "%s: warning: No non-KSK dnskey found. "
- "Supply non-KSK dnskey or use '-z'.\n",
- program);
- else
- fatal("No non-KSK dnskey found. "
- "Supply non-KSK dnskey or use '-z'.");
- }
+ if (!have_non_ksk && !ignoreksk)
+ fprintf(stderr, "%s: warning: No non-KSK dnskey found. "
+ "Supply non-KSK dnskey or use '-z'.\n",
+ program);
}
static void
fprintf(stderr, "verify generated signatures\n");
fprintf(stderr, "\t-p:\t");
fprintf(stderr, "use pseudorandom data (faster but less secure)\n");
- fprintf(stderr, "\t-P:\t");
- fprintf(stderr, "disable post-sign verification\n");
fprintf(stderr, "\t-t:\t");
fprintf(stderr, "print statistics\n");
fprintf(stderr, "\t-n ncpus (number of cpus present)\n");
unsigned char saltbuf[255];
hashlist_t hashlist;
-#define CMDLINE_FLAGS "3:aAc:d:e:f:ghH:i:I:j:k:l:m:n:N:o:O:pPr:s:StUv:z"
+#define CMDLINE_FLAGS "3:aAc:d:e:f:ghH:i:I:j:k:l:m:n:N:o:O:pr:s:StUv:z"
/*
* Process memory debugging argument first.
generateds = ISC_TRUE;
break;
- case 'H':
- iterations = strtoul(isc_commandline_argument,
- &endp, 0);
- if (*endp != '\0')
- fatal("iterations must be numeric");
- if (iterations > 0xffffU)
- fatal("iterations too big");
- break;
-
+ case '?':
+ if (isc_commandline_option != '?')
+ fprintf(stderr, "%s: invalid argument -%c\n",
+ program, isc_commandline_option);
case 'h':
usage();
break;
+ default:
+ fprintf(stderr, "%s: unhandled option -%c\n",
+ program, isc_commandline_option);
+ exit(1);
+
case 'i':
endp = NULL;
cycle = strtol(isc_commandline_argument, &endp, 0);
fatal("jitter must be numeric and positive");
break;
- case 'k':
- if (ndskeys == MAXDSKEYS)
- fatal("too many key-signing keys specified");
- dskeyfile[ndskeys++] = isc_commandline_argument;
- break;
-
case 'l':
+ dns_fixedname_init(&dlv_fixed);
len = strlen(isc_commandline_argument);
isc_buffer_init(&b, isc_commandline_argument, len);
isc_buffer_add(&b, len);
check_result(result, "dns_name_fromtext(dlv)");
break;
+ case 'k':
+ if (ndskeys == MAXDSKEYS)
+ fatal("too many key-signing keys specified");
+ dskeyfile[ndskeys++] = isc_commandline_argument;
+ break;
+
case 'm':
break;
serialformatstr = isc_commandline_argument;
break;
+ case 'H':
+ iterations = strtoul(isc_commandline_argument,
+ &endp, 0);
+ if (*endp != '\0')
+ fatal("iterations must be numeric");
+ if (iterations > 0xffffU)
+ fatal("iterations too big");
+ break;
+
case 'o':
origin = isc_commandline_argument;
break;
pseudorandom = ISC_TRUE;
break;
- case 'P':
- disable_zone_check = ISC_TRUE;
- break;
-
case 'r':
setup_entropy(mctx, isc_commandline_argument, &ectx);
break;
case 'z':
ignoreksk = ISC_TRUE;
break;
-
- case '?':
- if (isc_commandline_option != '?')
- fprintf(stderr, "%s: invalid argument -%c\n",
- program, isc_commandline_option);
- usage();
- break;
-
- default:
- fprintf(stderr, "%s: unhandled option -%c\n",
- program, isc_commandline_option);
- exit(1);
}
}
"NSEC only DNSKEY");
}
- /*
- * We need to do this early on, as we start messing with the list
- * of keys rather early.
- */
ISC_LIST_INIT(keylist);
- isc_rwlock_init(&keylist_lock, 0, 0);
if (argc == 0) {
loadzonekeys(gdb);
}
if (key == NULL) {
key = newkeystruct(newkey, ISC_TRUE);
- key->commandline = ISC_TRUE;
ISC_LIST_APPEND(keylist, key, link);
} else
dst_key_free(&newkey);
}
if (ISC_LIST_EMPTY(keylist)) {
- if (disable_zone_check)
- fprintf(stderr, "%s: warning: No keys specified or found\n",
- program);
- else
- fatal("No signing keys specified or found.");
+ fprintf(stderr, "%s: warning: No keys specified or found\n",
+ program);
nokeys = ISC_TRUE;
}
isc_taskmgr_destroy(&taskmgr);
isc_mem_put(mctx, tasks, ntasks * sizeof(isc_task_t *));
postsign();
- verifyzone();
if (outputformat != dns_masterformat_text) {
result = dns_master_dumptostream2(mctx, gdb, gversion,
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
[<!ENTITY mdash "—">]>
<!--
- - Copyright (C) 2004-2009 Internet Systems Consortium, Inc. ("ISC")
+ - Copyright (C) 2004-2008 Internet Systems Consortium, Inc. ("ISC")
- Copyright (C) 2000-2003 Internet Software Consortium.
-
- Permission to use, copy, modify, and/or distribute this software for any
- PERFORMANCE OF THIS SOFTWARE.
-->
-<!-- $Id: dnssec-signzone.docbook,v 1.31.44.3 2009/06/06 01:46:54 jreed Exp $ -->
+<!-- $Id: dnssec-signzone.docbook,v 1.31.44.4 2009/06/08 22:23:06 each Exp $ -->
<refentry id="man.dnssec-signzone">
<refentryinfo>
<date>June 05, 2009</date>
<year>2006</year>
<year>2007</year>
<year>2008</year>
- <year>2009</year>
<holder>Internet Systems Consortium, Inc. ("ISC")</holder>
</copyright>
<copyright>
<arg><option>-o <replaceable class="parameter">origin</replaceable></option></arg>
<arg><option>-O <replaceable class="parameter">output-format</replaceable></option></arg>
<arg><option>-p</option></arg>
- <arg><option>-P</option></arg>
<arg><option>-r <replaceable class="parameter">randomdev</replaceable></option></arg>
<arg><option>-s <replaceable class="parameter">start-time</replaceable></option></arg>
<arg><option>-t</option></arg>
</listitem>
</varlistentry>
- <varlistentry>
- <term>-P</term>
- <listitem>
- <para>
- Disable post sign verification tests.
- </para>
- <para>
- The post sign verification test ensures that for each algorithm
- in use there is at least one non revoked self signed KSK key,
- that all revoked KSK keys are self signed, and that all records
- in the zone are signed by the algorithm.
- This option skips these tests.
- </para>
- </listitem>
- </varlistentry>
-
<varlistentry>
<term>-r <replaceable class="parameter">randomdev</replaceable></term>
<listitem>
<!--
- - Copyright (C) 2004-2009 Internet Systems Consortium, Inc. ("ISC")
+ - Copyright (C) 2004-2008 Internet Systems Consortium, Inc. ("ISC")
- Copyright (C) 2000-2003 Internet Software Consortium.
-
- Permission to use, copy, modify, and distribute this software for any
- OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- PERFORMANCE OF THIS SOFTWARE.
-->
-<!-- $Id: dnssec-signzone.html,v 1.33.44.2 2009/06/07 01:53:42 tbox Exp $ -->
+<!-- $Id: dnssec-signzone.html,v 1.33.44.3 2009/06/08 22:23:07 each Exp $ -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>dnssec-signzone</title>
-<meta name="generator" content="DocBook XSL Stylesheets V1.71.1">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.2">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="refentry" lang="en">
<a name="man.dnssec-signzone"></a><div class="titlepage"></div>
</div>
<div class="refsynopsisdiv">
<h2>Synopsis</h2>
-<div class="cmdsynopsis"><p><code class="command">dnssec-signzone</code> [<code class="option">-a</code>] [<code class="option">-c <em class="replaceable"><code>class</code></em></code>] [<code class="option">-d <em class="replaceable"><code>directory</code></em></code>] [<code class="option">-e <em class="replaceable"><code>end-time</code></em></code>] [<code class="option">-f <em class="replaceable"><code>output-file</code></em></code>] [<code class="option">-g</code>] [<code class="option">-h</code>] [<code class="option">-k <em class="replaceable"><code>key</code></em></code>] [<code class="option">-l <em class="replaceable"><code>domain</code></em></code>] [<code class="option">-i <em class="replaceable"><code>interval</code></em></code>] [<code class="option">-I <em class="replaceable"><code>input-format</code></em></code>] [<code class="option">-j <em class="replaceable"><code>jitter</code></em></code>] [<code class="option">-N <em class="replaceable"><code>soa-serial-format</code></em></code>] [<code class="option">-o <em class="replaceable"><code>origin</code></em></code>] [<code class="option">-O <em class="replaceable"><code>output-format</code></em></code>] [<code class="option">-p</code>] [<code class="option">-P</code>] [<code class="option">-r <em class="replaceable"><code>randomdev</code></em></code>] [<code class="option">-s <em class="replaceable"><code>start-time</code></em></code>] [<code class="option">-t</code>] [<code class="option">-v <em class="replaceable"><code>level</code></em></code>] [<code class="option">-z</code>] [<code class="option">-3 <em class="replaceable"><code>salt</code></em></code>] [<code class="option">-H <em class="replaceable"><code>iterations</code></em></code>] [<code class="option">-A</code>] {zonefile} [key...]</p></div>
+<div class="cmdsynopsis"><p><code class="command">dnssec-signzone</code> [<code class="option">-a</code>] [<code class="option">-c <em class="replaceable"><code>class</code></em></code>] [<code class="option">-d <em class="replaceable"><code>directory</code></em></code>] [<code class="option">-e <em class="replaceable"><code>end-time</code></em></code>] [<code class="option">-f <em class="replaceable"><code>output-file</code></em></code>] [<code class="option">-g</code>] [<code class="option">-h</code>] [<code class="option">-k <em class="replaceable"><code>key</code></em></code>] [<code class="option">-l <em class="replaceable"><code>domain</code></em></code>] [<code class="option">-i <em class="replaceable"><code>interval</code></em></code>] [<code class="option">-I <em class="replaceable"><code>input-format</code></em></code>] [<code class="option">-j <em class="replaceable"><code>jitter</code></em></code>] [<code class="option">-N <em class="replaceable"><code>soa-serial-format</code></em></code>] [<code class="option">-o <em class="replaceable"><code>origin</code></em></code>] [<code class="option">-O <em class="replaceable"><code>output-format</code></em></code>] [<code class="option">-p</code>] [<code class="option">-r <em class="replaceable"><code>randomdev</code></em></code>] [<code class="option">-s <em class="replaceable"><code>start-time</code></em></code>] [<code class="option">-t</code>] [<code class="option">-v <em class="replaceable"><code>level</code></em></code>] [<code class="option">-z</code>] [<code class="option">-3 <em class="replaceable"><code>salt</code></em></code>] [<code class="option">-H <em class="replaceable"><code>iterations</code></em></code>] [<code class="option">-A</code>] {zonefile} [key...]</p></div>
</div>
<div class="refsect1" lang="en">
-<a name="id2543558"></a><h2>DESCRIPTION</h2>
+<a name="id215233"></a><h2>DESCRIPTION</h2>
<p><span><strong class="command">dnssec-signzone</strong></span>
signs a zone. It generates
NSEC and RRSIG records and produces a signed version of the
</p>
</div>
<div class="refsect1" lang="en">
-<a name="id2543573"></a><h2>OPTIONS</h2>
+<a name="id215250"></a><h2>OPTIONS</h2>
<div class="variablelist"><dl>
<dt><span class="term">-a</span></dt>
<dd><p>
may be useful when signing large zones or when the entropy
source is limited.
</p></dd>
-<dt><span class="term">-P</span></dt>
-<dd>
-<p>
- Disable post sign verification tests.
- </p>
-<p>
- The post sign verification test ensures that for each algorithm
- in use there is at least one non revoked self signed KSK key,
- that all revoked KSK keys are self signed, and that all records
- in the zone are signed by the algorithm.
- This option skips these tests.
- </p>
-</dd>
<dt><span class="term">-r <em class="replaceable"><code>randomdev</code></em></span></dt>
<dd><p>
Specifies the source of randomness. If the operating
</dl></div>
</div>
<div class="refsect1" lang="en">
-<a name="id2544428"></a><h2>EXAMPLE</h2>
+<a name="id216041"></a><h2>EXAMPLE</h2>
<p>
The following command signs the <strong class="userinput"><code>example.com</code></strong>
zone with the DSA key generated by <span><strong class="command">dnssec-keygen</strong></span>
%</pre>
</div>
<div class="refsect1" lang="en">
-<a name="id2544548"></a><h2>SEE ALSO</h2>
+<a name="id216094"></a><h2>SEE ALSO</h2>
<p><span class="citerefentry"><span class="refentrytitle">dnssec-keygen</span>(8)</span>,
<em class="citetitle">BIND 9 Administrator Reference Manual</em>,
<em class="citetitle">RFC 4033</em>.
</p>
</div>
<div class="refsect1" lang="en">
-<a name="id2544641"></a><h2>AUTHOR</h2>
+<a name="id216118"></a><h2>AUTHOR</h2>
<p><span class="corpauthor">Internet Systems Consortium</span>
</p>
</div>
/*
- * Copyright (C) 2004, 2005, 2007, 2009 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 2000, 2001, 2003 Internet Software Consortium.
*
* Permission to use, copy, modify, and/or distribute this software for any
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: dnssectool.c,v 1.45.334.2 2009/06/04 02:56:14 tbox Exp $ */
+/* $Id: dnssectool.c,v 1.45.334.3 2009/06/08 22:23:07 each Exp $ */
/*! \file */
fatal(const char *format, ...) {
va_list args;
- fprintf(stderr, "%s: fatal: ", program);
+ fprintf(stderr, "%s: ", program);
va_start(args, format);
vfprintf(stderr, format, args);
va_end(args);
int usekeyboard = ISC_ENTROPY_KEYBOARDMAYBE;
REQUIRE(ectx != NULL);
-
+
if (*ectx == NULL) {
result = isc_entropy_create(mctx, ectx);
if (result != ISC_R_SUCCESS)
+++ /dev/null
-example.com. IN DNSKEY 256 3 5 AwEAAaF0z17DdkBAKiYScVNqzsqXw7Vz/Cx5OCw7T/6RnU/KiGv815kl H2obywRZX2ZcEg9R8SUzQiP9ygY0s1xF5IFYi32HsWftNV7V/gNwNrMn GC0gV2e3OawsQ2CYWZZVwObr/fmcKIXuY6eRdJtyOilMRhlvroJdXZw1 CQdicxpZ
+++ /dev/null
-Private-key-format: v1.2
-Algorithm: 5 (RSASHA1)
-Modulus: oXTPXsN2QEAqJhJxU2rOypfDtXP8LHk4LDtP/pGdT8qIa/zXmSUfahvLBFlfZlwSD1HxJTNCI/3KBjSzXEXkgViLfYexZ+01XtX+A3A2sycYLSBXZ7c5rCxDYJhZllXA5uv9+Zwohe5jp5F0m3I6KUxGGW+ugl1dnDUJB2JzGlk=
-PublicExponent: AQAB
-PrivateExponent: QrbJmRabHiFlSSYFvbo8iGn9bFTotlfAZkZ732y72+SMSlLHo3g7atThJoLncJxKuhnZ0s1DXyvW9omAM3iN2lxfVDW58at1amj/lWRDYkjI0fM8z6eyrF4U2lHKDM2YEstg+sGAAs5DUZBbli4Y7+zHjhxSKLYvRf4AJvX8aoE=
-Prime1: 0259CgdF0JW+miedRZXC6tn3FijZJ4/j5edzd8IpTpdUSZupQg9hMP1ot7crreNq7MnzO0Z2ImbowUx8CDOuXQ==
-Prime2: w31/WLM2275Z1tsHEOhrntUQCUk55B4PNOCmM4hjp0vAvA/SVSgAYRNb7rc/ujaLf0DnxnDsnVsFAS2PmvQELQ==
-Exponent1: yKPhJNMh/X8dEUzmglJMVnHheLXq3RA/RL0PZmZqrJoO8os1Y+sUYFkaNr0sRie6IFrE50tGb/8YgdcDHQVuQQ==
-Exponent2: lVhDuGy5RSjnk1eiz0zwIthctutlOZupPFk/P3E7yGv74vAnXH0BxSe3/Oer3MOc0GuyZYyRhyko6px28AbpRQ==
-Coefficient: Hjup1nDnPFkQrxU2qLQBJrDz+ipw0RkNhsjWs6IgAq1Mq4sFV50bR9hOTLDd9oNhhtAwVjF+Oc0WIq+M1Mi6Ow==
+++ /dev/null
-example.com. IN DNSKEY 257 3 5 AwEAAbuWh5W3eGwixISqPwxszotQ0246KqhUB2Mb6JqNMJd6cWR66IrX YnevpIHsb6oanqJmVzOcJ6Yj3rXOIYtYYXgLbT7EJ8x7BNCZPHxG+w5C 7I1WsDbT6eGf//FLn2c4odKLOXaWCVITeNy61w43IlteIT9Q1egKdt+8 a7X9605j
+++ /dev/null
-Private-key-format: v1.2
-Algorithm: 5 (RSASHA1)
-Modulus: u5aHlbd4bCLEhKo/DGzOi1DTbjoqqFQHYxvomo0wl3pxZHroitdid6+kgexvqhqeomZXM5wnpiPetc4hi1hheAttPsQnzHsE0Jk8fEb7DkLsjVawNtPp4Z//8UufZzih0os5dpYJUhN43LrXDjciW14hP1DV6Ap237xrtf3rTmM=
-PublicExponent: AQAB
-PrivateExponent: XZSssv3CL3/wtZYQuewV5d4+e8C8wxiYTtL/aQqCcS7+HnhKRelJEBgpYz9GPX/mH3Iakn6WMQW39s6MYW2HwXUnqhsvHoyabGX0Dbc/1LcY4J2VPgzVHwSXYm+j4unOByOOS4KoBtUAQxJsTBokVZrZ5pKsLUK9X2gdywYw+PE=
-Prime1: 9fB7PaygjKoT1nbbeEMy1KYNqetg3zmN49Mk6ilEWxzJXKSSjTIhdkiLGXtYmE8rDBLBiYm8YWNe7YdA9PbQ7Q==
-Prime2: w0L7mTOLDecH3XAkC/wvALv8K9KSoZ31ajidKBxV15u8awj5AxDG7gjerYgCLjU1fq1GulMr11j8r4ftQn3Cjw==
-Exponent1: Up52yEE1rgt0npdPIxdv+//Ml0h7QoITKHXF8OPsEq+Y9YZTtRsiIpo8IFNPb9somuWyHoImxpCbUzAcoi5IAQ==
-Exponent2: uYTbvYx+UsAt9dOFPCnnkqAJEK3qCUomET0m/CQn30mldGC7DpGTIDgnMeLmh3agk/IYIBHDtsBinHfeEe2guw==
-Coefficient: FiHAet8On9Yaz1ksEAlCWulwck3zPWIsgqJBM2J4kHhgHTm17mZyxtVxIzLAMBNMIBcFl40FCpmPmTLY5QK5mw==
+++ /dev/null
-;
-; This is a bogus key. It will not have a .private file.
-;
-; This will be key id 7091
-;
-example.com. IN DNSKEY 257 3 5 AwEAAaF0z17DdkBAKiYScVNqzsqXw7Vz/Cx5OCw7T/6RnU/KiGv815kl H2obywRZX2ZcEg9R8SUzQiP9ygY0s1xF5IFYi32HsWftNV7V/gNwNrMn GC0gV2e3OawsQ2CYWZZVwObr/fmcKIXuY6eRdJtyOilMRhlvroJdXZw1 CQdicxpz
+++ /dev/null
-;
-; This is a bogus key. It will not have a .private file.
-;
-; This will be key id 7092
-;
-example.com. IN DNSKEY 256 3 5 AwEAAaF0z17DdkBAKiYScVNqzsqXw7Vz/Cx5OCw7T/6RnU/KiGv815kl H2obywRZX2ZcEg9R8SUzQiP9ygY0s1xF5IFYi32HsWftNV7V/gNwNrMn GC0gV2e3OawsQ2CYWZZVwObr/fmcKIXuY6eRdJtyOilMRhlvroJdXZw1 CQdicxpz
+++ /dev/null
-#!/bin/sh
-#
-# Copyright (C) 2009 Internet Systems Consortium, Inc. ("ISC")
-#
-# Permission to use, copy, modify, and/or distribute this software for any
-# purpose with or without fee is hereby granted, provided that the above
-# copyright notice and this permission notice appear in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
-# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-# AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
-# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
-# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
-# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-# PERFORMANCE OF THIS SOFTWARE.
-
-# $Id: run-test.sh,v 1.2.2.2 2009/06/04 02:56:14 tbox Exp $
-
-
-sign="../../dnssec/dnssec-signzone -f signed.zone -o example.com."
-
-signit() {
- rm -f signed.zone
- grep '^;' $zone
- $sign $zone
-}
-
-expect_success() {
- if ! test -f signed.zone ; then
- echo "Error: expected success, but sign failed for $zone."
- else
- echo "Success: Sign succeeded for $zone."
- fi
-}
-
-expect_failure() {
- if test -f signed.zone ; then
- echo "Error: expected failure, but sign succeeded for $zone."
- else
- echo "Success: Sign failed (expected) for $zone"
- fi
-}
-
-zone="test1.zone" ; signit ; expect_success
-zone="test2.zone" ; signit ; expect_failure
-zone="test3.zone" ; signit ; expect_failure
-zone="test4.zone" ; signit ; expect_success
-zone="test5.zone" ; signit ; expect_failure
-zone="test6.zone" ; signit ; expect_failure
-zone="test7.zone" ; signit ; expect_failure
-zone="test8.zone" ; signit ; expect_failure
+++ /dev/null
-;
-; This is a zone which has two DNSKEY records, both of which have
-; existing private key files available. They should be loaded automatically
-; and the zone correctly signed.
-;
-$TTL 3600
-example.com. IN SOA ns hostmaster 00090000 1200 3600 604800 300
-$include Kexample.com.+005+07065.key
-$include Kexample.com.+005+23362.key
+++ /dev/null
-;
-; This is a zone which has one non-KSK DNSKEY record for which the
-; private key file exists. It should be loaded automatically and the zone
-; correctly signed.
-;
-$TTL 3600
-example.com. IN SOA ns hostmaster 00090000 1200 3600 604800 300
-$include Kexample.com.+005+07065.key
+++ /dev/null
-;
-; This is a zone which has one KSK DNSKEY record for which the
-; private key file exists. It should be loaded automatically. As there
-; is no non-KSK DNSKEY the resulting zone should be rejected.
-;
-$TTL 3600
-example.com. IN SOA ns hostmaster 00090000 1200 3600 604800 300
-$include Kexample.com.+005+23362.key
+++ /dev/null
-;
-; This is a zone which has three DNSKEY records, two (KSK + ZSK) of
-; which have existing private key files available. The third is a
-; pre-published ZSK.
-;
-$TTL 3600
-example.com. IN SOA ns hostmaster 00090000 1200 3600 604800 300
-$include Kexample.com.+005+07065.key
-$include Kexample.com.+005+23362.key
-$include bogus-zsk.key
+++ /dev/null
-;
-; This is a zone which has three DNSKEY records, two (KSK +ZSK) of which
-; have existing private key files available. The third is a KSK.
-;
-$TTL 3600
-example.com. IN SOA ns hostmaster 00090000 1200 3600 604800 300
-$include Kexample.com.+005+07065.key
-$include Kexample.com.+005+23362.key
-$include bogus-ksk.key
+++ /dev/null
-;
-; This is a zone which has four DNSKEY records, two (KK + ZSK) of which
-; have existing private key files available. There are also a KSK and ZSK
-; for which there will be no signatures.
-;
-$TTL 3600
-example.com. IN SOA ns hostmaster 00090000 1200 3600 604800 300
-$include Kexample.com.+005+07065.key
-$include Kexample.com.+005+23362.key
-$include bogus-ksk.key
-$include bogus-zsk.key
+++ /dev/null
-;
-; This is a zone which has two DNSKEY records, none of which have
-; existing private key files available. The resulting zone should fail
-; the consistancy tests.
-;
-$TTL 3600
-example.com. IN SOA ns hostmaster 00090000 1200 3600 604800 300
-$include bogus-ksk.key
-$include bogus-zsk.key
+++ /dev/null
-;
-; This is a zone which has two DNSKEY records, one of which,
-; the KSK, has a private key. The resulting zone should be rejected as
-; it has no ZSK signatures.
-;
-$TTL 3600
-example.com. IN SOA ns hostmaster 00090000 1200 3600 604800 300
-$include Kexample.com.+005+23362.key
-$include bogus-zsk.key
#!/bin/sh
#
-# Copyright (C) 2004, 2006-2009 Internet Systems Consortium, Inc. ("ISC")
+# Copyright (C) 2004, 2006-2008 Internet Systems Consortium, Inc. ("ISC")
# Copyright (C) 2000-2003 Internet Software Consortium.
#
# Permission to use, copy, modify, and/or distribute this software for any
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
-# $Id: sign.sh,v 1.25.48.2 2009/06/04 02:56:14 tbox Exp $
+# $Id: sign.sh,v 1.25.48.3 2009/06/08 22:23:07 each Exp $
SYSTEMTESTTOP=../..
. $SYSTEMTESTTOP/conf.sh
cat $infile $keyname.key > $zonefile
-$SIGNER -P -g -r $RANDFILE -o $zone $zonefile > /dev/null
+echo $SIGNER -g -r $RANDFILE -o $zone $zonefile
+$SIGNER -g -r $RANDFILE -o $zone $zonefile > /dev/null
# Configure the resolving server with a trusted key.
#!/bin/sh
#
-# Copyright (C) 2004, 2006-2009 Internet Systems Consortium, Inc. ("ISC")
+# Copyright (C) 2004, 2006-2008 Internet Systems Consortium, Inc. ("ISC")
# Copyright (C) 2000-2003 Internet Software Consortium.
#
# Permission to use, copy, modify, and/or distribute this software for any
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
-# $Id: sign.sh,v 1.30.48.2 2009/06/04 02:56:14 tbox Exp $
+# $Id: sign.sh,v 1.30.48.3 2009/06/08 22:23:07 each Exp $
SYSTEMTESTTOP=../..
. $SYSTEMTESTTOP/conf.sh
cat $infile $keyname1.key $keyname2.key >$zonefile
-$SIGNER -P -g -r $RANDFILE -o $zone -k $keyname1 $zonefile $keyname2 > /dev/null
+$SIGNER -g -r $RANDFILE -o $zone -k $keyname1 $zonefile $keyname2 > /dev/null
# Sign the privately secure file
cat $privinfile $privkeyname.key >$privzonefile
-$SIGNER -P -g -r $RANDFILE -o $privzone -l dlv $privzonefile > /dev/null
+$SIGNER -g -r $RANDFILE -o $privzone -l dlv $privzonefile > /dev/null
# Sign the DLV secure zone.
cat $dlvinfile $dlvkeyname.key dlvset-$privzone > $dlvzonefile
-$SIGNER -P -g -r $RANDFILE -o $dlvzone $dlvzonefile > /dev/null
+$SIGNER -g -r $RANDFILE -o $dlvzone $dlvzonefile > /dev/null
#!/bin/sh
#
-# Copyright (C) 2004, 2006-2009 Internet Systems Consortium, Inc. ("ISC")
+# Copyright (C) 2004, 2006-2008 Internet Systems Consortium, Inc. ("ISC")
# Copyright (C) 2000-2002 Internet Software Consortium.
#
# Permission to use, copy, modify, and/or distribute this software for any
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
-# $Id: sign.sh,v 1.25.48.2 2009/06/04 02:56:14 tbox Exp $
+# $Id: sign.sh,v 1.25.48.3 2009/06/08 22:23:07 each Exp $
SYSTEMTESTTOP=../..
. $SYSTEMTESTTOP/conf.sh
cat $infile $keyname.key >$zonefile
-$SIGNER -P -r $RANDFILE -o $zone $zonefile > /dev/null
+$SIGNER -r $RANDFILE -o $zone $zonefile > /dev/null
zone=bogus.example.
infile=bogus.example.db.in
cat $infile $keyname.key >$zonefile
-$SIGNER -P -r $RANDFILE -o $zone $zonefile > /dev/null
+$SIGNER -r $RANDFILE -o $zone $zonefile > /dev/null
zone=dynamic.example.
infile=dynamic.example.db.in
cat $infile $keyname1.key $keyname2.key >$zonefile
-$SIGNER -P -r $RANDFILE -o $zone $zonefile > /dev/null
+$SIGNER -r $RANDFILE -o $zone $zonefile > /dev/null
zone=keyless.example.
infile=keyless.example.db.in
cat $infile $keyname.key >$zonefile
-$SIGNER -P -r $RANDFILE -o $zone $zonefile > /dev/null
+$SIGNER -r $RANDFILE -o $zone $zonefile > /dev/null
# Change the signer field of the a.b.keyless.example SIG A
# to point to a provably nonexistent KEY record.
cat $infile $keyname.key >$zonefile
-$SIGNER -P -r $RANDFILE -o $zone $zonefile > /dev/null
+$SIGNER -r $RANDFILE -o $zone $zonefile > /dev/null
#
# NSEC3/NSEC3 test zone
cat $infile $keyname.key >$zonefile
-$SIGNER -P -3 - -r $RANDFILE -o $zone $zonefile > /dev/null
+$SIGNER -3 - -r $RANDFILE -o $zone $zonefile > /dev/null
#
# OPTOUT/NSEC3 test zone
cat $infile $keyname.key >$zonefile
-$SIGNER -P -3 - -A -r $RANDFILE -o $zone $zonefile > /dev/null
+$SIGNER -3 - -A -r $RANDFILE -o $zone $zonefile > /dev/null
#
# A nsec3 zone (non-optout).
cat $infile $keyname.key >$zonefile
-$SIGNER -P -g -3 - -r $RANDFILE -o $zone $zonefile > /dev/null
+$SIGNER -g -3 - -r $RANDFILE -o $zone $zonefile > /dev/null
#
# OPTOUT/NSEC test zone
cat $infile $keyname.key >$zonefile
-$SIGNER -P -r $RANDFILE -o $zone $zonefile > /dev/null
+$SIGNER -r $RANDFILE -o $zone $zonefile > /dev/null
#
# OPTOUT/NSEC3 test zone
cat $infile $keyname.key >$zonefile
-$SIGNER -P -3 - -r $RANDFILE -o $zone $zonefile > /dev/null
+$SIGNER -3 - -r $RANDFILE -o $zone $zonefile > /dev/null
#
# OPTOUT/OPTOUT test zone
cat $infile $keyname.key >$zonefile
-$SIGNER -P -3 - -A -r $RANDFILE -o $zone $zonefile > /dev/null
+$SIGNER -3 - -A -r $RANDFILE -o $zone $zonefile > /dev/null
#
# A optout nsec3 zone.
cat $infile $keyname.key >$zonefile
-$SIGNER -P -g -3 - -A -r $RANDFILE -o $zone $zonefile > /dev/null
+$SIGNER -g -3 - -A -r $RANDFILE -o $zone $zonefile > /dev/null
#
# A nsec3 zone (non-optout) with unknown hash algorithm.
cat $infile $keyname.key >$zonefile
-$SIGNER -P -3 - -U -r $RANDFILE -o $zone $zonefile > /dev/null
+$SIGNER -3 - -U -r $RANDFILE -o $zone $zonefile > /dev/null
#
# A optout nsec3 zone.
cat $infile $keyname.key >$zonefile
-$SIGNER -P -3 - -U -A -r $RANDFILE -o $zone $zonefile > /dev/null
+$SIGNER -3 - -U -A -r $RANDFILE -o $zone $zonefile > /dev/null
#
# A multiple parameter nsec3 zone.
cat $infile $keyname.key >$zonefile
-$SIGNER -P -r $RANDFILE -o $zone $zonefile > /dev/null
+$SIGNER -r $RANDFILE -o $zone $zonefile > /dev/null
mv $zonefile.signed $zonefile
-$SIGNER -P -3 - -r $RANDFILE -o $zone $zonefile > /dev/null
+$SIGNER -3 - -r $RANDFILE -o $zone $zonefile > /dev/null
mv $zonefile.signed $zonefile
-$SIGNER -P -3 AAAA -r $RANDFILE -o $zone $zonefile > /dev/null
+$SIGNER -3 AAAA -r $RANDFILE -o $zone $zonefile > /dev/null
mv $zonefile.signed $zonefile
-$SIGNER -P -3 BBBB -r $RANDFILE -o $zone $zonefile > /dev/null
+$SIGNER -3 BBBB -r $RANDFILE -o $zone $zonefile > /dev/null
mv $zonefile.signed $zonefile
-$SIGNER -P -3 CCCC -r $RANDFILE -o $zone $zonefile > /dev/null
+$SIGNER -3 CCCC -r $RANDFILE -o $zone $zonefile > /dev/null
mv $zonefile.signed $zonefile
-$SIGNER -P -3 DDDD -r $RANDFILE -o $zone $zonefile > /dev/null
+$SIGNER -3 DDDD -r $RANDFILE -o $zone $zonefile > /dev/null
- OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- PERFORMANCE OF THIS SOFTWARE.
-->
-<!-- $Id: man.dnssec-signzone.html,v 1.94.14.9 2009/06/07 01:53:42 tbox Exp $ -->
+<!-- $Id: man.dnssec-signzone.html,v 1.94.14.10 2009/06/08 22:23:07 each Exp $ -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
</div>
<div class="refsynopsisdiv">
<h2>Synopsis</h2>
-<div class="cmdsynopsis"><p><code class="command">dnssec-signzone</code> [<code class="option">-a</code>] [<code class="option">-c <em class="replaceable"><code>class</code></em></code>] [<code class="option">-d <em class="replaceable"><code>directory</code></em></code>] [<code class="option">-e <em class="replaceable"><code>end-time</code></em></code>] [<code class="option">-f <em class="replaceable"><code>output-file</code></em></code>] [<code class="option">-g</code>] [<code class="option">-h</code>] [<code class="option">-k <em class="replaceable"><code>key</code></em></code>] [<code class="option">-l <em class="replaceable"><code>domain</code></em></code>] [<code class="option">-i <em class="replaceable"><code>interval</code></em></code>] [<code class="option">-I <em class="replaceable"><code>input-format</code></em></code>] [<code class="option">-j <em class="replaceable"><code>jitter</code></em></code>] [<code class="option">-N <em class="replaceable"><code>soa-serial-format</code></em></code>] [<code class="option">-o <em class="replaceable"><code>origin</code></em></code>] [<code class="option">-O <em class="replaceable"><code>output-format</code></em></code>] [<code class="option">-p</code>] [<code class="option">-P</code>] [<code class="option">-r <em class="replaceable"><code>randomdev</code></em></code>] [<code class="option">-s <em class="replaceable"><code>start-time</code></em></code>] [<code class="option">-t</code>] [<code class="option">-v <em class="replaceable"><code>level</code></em></code>] [<code class="option">-z</code>] [<code class="option">-3 <em class="replaceable"><code>salt</code></em></code>] [<code class="option">-H <em class="replaceable"><code>iterations</code></em></code>] [<code class="option">-A</code>] {zonefile} [key...]</p></div>
+<div class="cmdsynopsis"><p><code class="command">dnssec-signzone</code> [<code class="option">-a</code>] [<code class="option">-c <em class="replaceable"><code>class</code></em></code>] [<code class="option">-d <em class="replaceable"><code>directory</code></em></code>] [<code class="option">-e <em class="replaceable"><code>end-time</code></em></code>] [<code class="option">-f <em class="replaceable"><code>output-file</code></em></code>] [<code class="option">-g</code>] [<code class="option">-h</code>] [<code class="option">-k <em class="replaceable"><code>key</code></em></code>] [<code class="option">-l <em class="replaceable"><code>domain</code></em></code>] [<code class="option">-i <em class="replaceable"><code>interval</code></em></code>] [<code class="option">-I <em class="replaceable"><code>input-format</code></em></code>] [<code class="option">-j <em class="replaceable"><code>jitter</code></em></code>] [<code class="option">-N <em class="replaceable"><code>soa-serial-format</code></em></code>] [<code class="option">-o <em class="replaceable"><code>origin</code></em></code>] [<code class="option">-O <em class="replaceable"><code>output-format</code></em></code>] [<code class="option">-p</code>] [<code class="option">-r <em class="replaceable"><code>randomdev</code></em></code>] [<code class="option">-s <em class="replaceable"><code>start-time</code></em></code>] [<code class="option">-t</code>] [<code class="option">-v <em class="replaceable"><code>level</code></em></code>] [<code class="option">-z</code>] [<code class="option">-3 <em class="replaceable"><code>salt</code></em></code>] [<code class="option">-H <em class="replaceable"><code>iterations</code></em></code>] [<code class="option">-A</code>] {zonefile} [key...]</p></div>
</div>
<div class="refsect1" lang="en">
-<a name="id2607822"></a><h2>DESCRIPTION</h2>
+<a name="id2608094"></a><h2>DESCRIPTION</h2>
<p><span><strong class="command">dnssec-signzone</strong></span>
signs a zone. It generates
NSEC and RRSIG records and produces a signed version of the
</p>
</div>
<div class="refsect1" lang="en">
-<a name="id2607842"></a><h2>OPTIONS</h2>
+<a name="id2608114"></a><h2>OPTIONS</h2>
<div class="variablelist"><dl>
<dt><span class="term">-a</span></dt>
<dd><p>
may be useful when signing large zones or when the entropy
source is limited.
</p></dd>
-<dt><span class="term">-P</span></dt>
-<dd>
-<p>
- Disable post sign verification tests.
- </p>
-<p>
- The post sign verification test ensures that for each algorithm
- in use there is at least one non revoked self signed KSK key,
- that all revoked KSK keys are self signed, and that all records
- in the zone are signed by the algorithm.
- This option skips these tests.
- </p>
-</dd>
<dt><span class="term">-r <em class="replaceable"><code>randomdev</code></em></span></dt>
<dd><p>
Specifies the source of randomness. If the operating
</dl></div>
</div>
<div class="refsect1" lang="en">
-<a name="id2659182"></a><h2>EXAMPLE</h2>
+<a name="id2659164"></a><h2>EXAMPLE</h2>
<p>
The following command signs the <strong class="userinput"><code>example.com</code></strong>
zone with the DSA key generated by <span><strong class="command">dnssec-keygen</strong></span>
%</pre>
</div>
<div class="refsect1" lang="en">
-<a name="id2659323"></a><h2>SEE ALSO</h2>
+<a name="id2659237"></a><h2>SEE ALSO</h2>
<p><span class="citerefentry"><span class="refentrytitle">dnssec-keygen</span>(8)</span>,
<em class="citetitle">BIND 9 Administrator Reference Manual</em>,
<em class="citetitle">RFC 4033</em>.
</p>
</div>
<div class="refsect1" lang="en">
-<a name="id2659348"></a><h2>AUTHOR</h2>
+<a name="id2659330"></a><h2>AUTHOR</h2>
<p><span class="corpauthor">Internet Systems Consortium</span>
</p>
</div>
/*
- * Copyright (C) 2004-2009 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004-2008 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 1999-2003 Internet Software Consortium.
*
* Permission to use, copy, modify, and/or distribute this software for any
*/
/*
- * $Id: dnssec.c,v 1.93.12.2 2009/06/04 02:56:14 tbox Exp $
+ * $Id: dnssec.c,v 1.93.12.3 2009/06/08 22:23:07 each Exp $
*/
/*! \file */
isc_result_t ret;
int i = 0, n;
dns_rdata_t *data;
- dns_rdataset_t rdataset;
n = dns_rdataset_count(set);
if (data == NULL)
return (ISC_R_NOMEMORY);
- dns_rdataset_init(&rdataset);
- dns_rdataset_clone(set, &rdataset);
- ret = dns_rdataset_first(&rdataset);
+ ret = dns_rdataset_first(set);
if (ret != ISC_R_SUCCESS) {
- dns_rdataset_disassociate(&rdataset);
isc_mem_put(mctx, data, n * sizeof(dns_rdata_t));
return (ret);
}
*/
do {
dns_rdata_init(&data[i]);
- dns_rdataset_current(&rdataset, &data[i++]);
- } while (dns_rdataset_next(&rdataset) == ISC_R_SUCCESS);
+ dns_rdataset_current(set, &data[i++]);
+ } while (dns_rdataset_next(set) == ISC_R_SUCCESS);
/*
* Sort the array.
qsort(data, n, sizeof(dns_rdata_t), rdata_compare_wrapper);
*rdata = data;
*nrdata = n;
- dns_rdataset_disassociate(&rdataset);
return (ISC_R_SUCCESS);
}
return (result);
}
-
-/*%
- * Does this key ('rdata') self sign the rrset ('rdataset')?
- */
-isc_boolean_t
-dns_dnssec_selfsigns(dns_rdata_t *rdata, dns_name_t *name,
- dns_rdataset_t *rdataset, dns_rdataset_t *sigrdataset,
- isc_boolean_t ignoretime, isc_mem_t *mctx)
-{
- dst_key_t *dstkey = NULL;
- dns_keytag_t keytag;
- dns_rdata_dnskey_t key;
- dns_rdata_rrsig_t sig;
- dns_rdata_t sigrdata = DNS_RDATA_INIT;
- isc_result_t result;
-
- INSIST(rdataset->type == dns_rdatatype_key ||
- rdataset->type == dns_rdatatype_dnskey);
- if (rdataset->type == dns_rdatatype_key) {
- INSIST(sigrdataset->type == dns_rdatatype_sig);
- INSIST(sigrdataset->covers == dns_rdatatype_key);
- } else {
- INSIST(sigrdataset->type == dns_rdatatype_rrsig);
- INSIST(sigrdataset->covers == dns_rdatatype_dnskey);
- }
-
- result = dns_dnssec_keyfromrdata(name, rdata, mctx, &dstkey);
- if (result != ISC_R_SUCCESS)
- return (ISC_FALSE);
- result = dns_rdata_tostruct(rdata, &key, NULL);
- RUNTIME_CHECK(result == ISC_R_SUCCESS);
-
- keytag = dst_key_id(dstkey);
- for (result = dns_rdataset_first(sigrdataset);
- result == ISC_R_SUCCESS;
- result = dns_rdataset_next(sigrdataset))
- {
- dns_rdata_reset(&sigrdata);
- dns_rdataset_current(sigrdataset, &sigrdata);
- result = dns_rdata_tostruct(&sigrdata, &sig, NULL);
- RUNTIME_CHECK(result == ISC_R_SUCCESS);
-
- if (sig.algorithm == key.algorithm &&
- sig.keyid == keytag) {
- result = dns_dnssec_verify2(name, rdataset, dstkey,
- ignoretime, mctx,
- &sigrdata, NULL);
- if (result == ISC_R_SUCCESS) {
- dst_key_free(&dstkey);
- return (ISC_TRUE);
- }
- }
- }
- dst_key_free(&dstkey);
- return (ISC_FALSE);
-}
/*
- * Copyright (C) 2004-2007, 2009 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 1999-2002 Internet Software Consortium.
*
* Permission to use, copy, modify, and/or distribute this software for any
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: dnssec.h,v 1.32.332.2 2009/06/04 02:56:14 tbox Exp $ */
+/* $Id: dnssec.h,v 1.32.332.3 2009/06/08 22:23:07 each Exp $ */
#ifndef DNS_DNSSEC_H
#define DNS_DNSSEC_H 1
*\li DST_R_*
*/
-isc_boolean_t
-dns_dnssec_selfsigns(dns_rdata_t *rdata, dns_name_t *name,
- dns_rdataset_t *rdataset, dns_rdataset_t *sigrdataset,
- isc_boolean_t ignoretime, isc_mem_t *mctx);
-
-
ISC_LANG_ENDDECLS
#endif /* DNS_DNSSEC_H */
dns_dnssec_findzonekeys
dns_dnssec_findzonekeys2
dns_dnssec_keyfromrdata
-dns_dnssec_selfsigns
dns_dnssec_sign
dns_dnssec_signmessage
dns_dnssec_verify