2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-29 21:47:59 +00:00

2612. [func] Add default values for the arguments to

dnssec-keygen.  Without arguments, it will now
			generate a 1024-bit RSASHA1 zone-signing key,
			or with the -f KSK option, a 2048-bit RSASHA1
			key-signing key. [RT #19300]

2611.	[func]		Add -l option to dnssec-dsfromkey to generate
			DLV records instead of DS records. [RT #19300]
This commit is contained in:
Evan Hunt 2009-06-17 06:51:44 +00:00
parent b577875266
commit b272d38cc5
11 changed files with 344 additions and 339 deletions

11
CHANGES
View File

@ -1,3 +1,14 @@
--- 9.7.0a1 released ---
2612. [func] Add default values for the arguments to
dnssec-keygen. Without arguments, it will now
generate a 1024-bit RSASHA1 zone-signing key,
or with the -f KSK option, a 2048-bit RSASHA1
key-signing key. [RT #19300]
2611. [func] Add -l option to dnssec-dsfromkey to generate
DLV records instead of DS records. [RT #19300]
2610. [port] sunos: Change #2363 was not complete. [RT #19796] 2610. [port] sunos: Change #2363 was not complete. [RT #19796]
2609. [func] Simplify the configuration of dynamic zones: 2609. [func] Simplify the configuration of dynamic zones:

28
README
View File

@ -45,23 +45,27 @@ BIND 9
BIND 9.7.0 BIND 9.7.0
BIND 9.7.0 includes a number of changes from BIND 9.6 and earlier BIND 9.7.0 includes a number of changes from BIND 9.6 and earlier
releases, including: releases. Most are intended to simplify DNSSEC configuration.
New features include:
Support for RFC 5011, automated trust anchor maintenance. - Simplified configuration of DNSSEC Lookaside Validation (DLV).
- Simplified configuration of Dynamic DNS, using the "ddns-confgen"
Simplified configuration of DNSSEC Lookaside Validation (DLV). command line tool or the "ddns-autoconf" zone option. (As a side
effect, this also makes it easier to configure automatic zone
Simplified configuration of Dynamic DNS using the "ddns-confgen" re-signing.)
command line tool or the "ddns-autoconf" zone option. - New named option "attach-cache" that allows multiple views to
New named option "attach-cache" that allows multiple views to
share a single cache. share a single cache.
- New logging category "query-errors" to provide detailed
New logging category "query-errors" to provide detailed
internal information about query failures, especially about internal information about query failures, especially about
server failures. server failures.
- DNS rebinding attack prevention.
- New default values for dnssec-keygen parameters.
DNS rebinding attack prevention. Planned but not complete in alpha:
- Support for RFC 5011 (automated trust anchor maintenance)
- Simplified tools for zone signing and key maintenance
- Fully automatic signing of zones by "named"
BIND 9.6.0 BIND 9.6.0

View File

@ -1,6 +1,6 @@
.\" Copyright (C) 2008 Internet Systems Consortium, Inc. ("ISC") .\" Copyright (C) 2008 Internet Systems Consortium, Inc. ("ISC")
.\" .\"
.\" Permission to use, copy, modify, and/or distribute this software for any .\" Permission to use, copy, modify, and distribute this software for any
.\" purpose with or without fee is hereby granted, provided that the above .\" purpose with or without fee is hereby granted, provided that the above
.\" copyright notice and this permission notice appear in all copies. .\" copyright notice and this permission notice appear in all copies.
.\" .\"
@ -12,113 +12,85 @@
.\" OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR .\" OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
.\" PERFORMANCE OF THIS SOFTWARE. .\" PERFORMANCE OF THIS SOFTWARE.
.\" .\"
.\" $Id: dnssec-dsfromkey.8,v 1.5 2008/11/08 01:11:47 tbox Exp $ .\" $Id: dnssec-dsfromkey.8,v 1.6 2009/06/17 06:51:43 each Exp $
.\" .\"
.hy 0 .hy 0
.ad l .ad l
.\" Title: dnssec\-dsfromkey .\"Generated by db2man.xsl. Don't modify this, modify the source.
.\" Author: .de Sh \" Subsection
.\" Generator: DocBook XSL Stylesheets v1.71.1 <http://docbook.sf.net/> .br
.\" Date: November 29, 2008 .if t .Sp
.\" Manual: BIND9 .ne 5
.\" Source: BIND9 .PP
.\" \fB\\$1\fR
.TH "DNSSEC\-DSFROMKEY" "8" "November 29, 2008" "BIND9" "BIND9" .PP
.\" disable hyphenation ..
.nh .de Sp \" Vertical space (when we can't use .PP)
.\" disable justification (adjust text to left margin only) .if t .sp .5v
.ad l .if n .sp
.SH "NAME" ..
dnssec\-dsfromkey \- DNSSEC DS RR generation tool .de Ip \" List item
.br
.ie \\n(.$>=3 .ne \\$3
.el .ne 3
.IP "\\$1" \\$2
..
.TH "DNSSEC-DSFROMKEY" 8 "November 29, 2008" "" ""
.SH NAME
dnssec-dsfromkey \- DNSSEC DS RR generation tool
.SH "SYNOPSIS" .SH "SYNOPSIS"
.HP 17 .HP 17
\fBdnssec\-dsfromkey\fR [\fB\-v\ \fR\fB\fIlevel\fR\fR] [\fB\-1\fR] [\fB\-2\fR] [\fB\-a\ \fR\fB\fIalg\fR\fR] {keyfile} \fBdnssec\-dsfromkey\fR [\fB\-v\ \fIlevel\fR\fR] [\fB\-1\fR] [\fB\-2\fR] [\fB\-a\ \fIalg\fR\fR] {keyfile}
.HP 17 .HP 17
\fBdnssec\-dsfromkey\fR {\-s} [\fB\-v\ \fR\fB\fIlevel\fR\fR] [\fB\-1\fR] [\fB\-2\fR] [\fB\-a\ \fR\fB\fIalg\fR\fR] [\fB\-c\ \fR\fB\fIclass\fR\fR] [\fB\-d\ \fR\fB\fIdir\fR\fR] {dnsname} \fBdnssec\-dsfromkey\fR {\-s} [\fB\-v\ \fIlevel\fR\fR] [\fB\-1\fR] [\fB\-2\fR] [\fB\-a\ \fIalg\fR\fR] [\fB\-c\ \fIclass\fR\fR] [\fB\-d\ \fIdir\fR\fR] {dnsname}
.SH "DESCRIPTION" .SH "DESCRIPTION"
.PP .PP
\fBdnssec\-dsfromkey\fR \fBdnssec\-dsfromkey\fR outputs the Delegation Signer (DS) resource record (RR), as defined in RFC 3658 and RFC 4509, for the given key(s)\&.
outputs the Delegation Signer (DS) resource record (RR), as defined in RFC 3658 and RFC 4509, for the given key(s).
.SH "OPTIONS" .SH "OPTIONS"
.PP .TP
\-1 \-1
.RS 4 Use SHA\-1 as the digest algorithm (the default is to use both SHA\-1 and SHA\-256)\&.
Use SHA\-1 as the digest algorithm (the default is to use both SHA\-1 and SHA\-256). .TP
.RE
.PP
\-2 \-2
.RS 4 Use SHA\-256 as the digest algorithm\&.
Use SHA\-256 as the digest algorithm. .TP
.RE
.PP
\-a \fIalgorithm\fR \-a \fIalgorithm\fR
.RS 4 Select the digest algorithm\&. The value of \fBalgorithm\fR must be one of SHA\-1 (SHA1) or SHA\-256 (SHA256)\&. These values are case insensitive\&.
Select the digest algorithm. The value of .TP
\fBalgorithm\fR
must be one of SHA\-1 (SHA1) or SHA\-256 (SHA256). These values are case insensitive.
.RE
.PP
\-v \fIlevel\fR \-v \fIlevel\fR
.RS 4 Sets the debugging level\&.
Sets the debugging level. .TP
.RE \-l \fIdomain\fR
.PP Generate a DLV set instead of a DS set\&. The specified \fBdomain\fR is appended to the name for each record in the set\&.
.TP
\-s \-s
.RS 4 Keyset mode: in place of the keyfile name, the argument is the DNS domain name of a keyset file\&. Following options make sense only in this mode\&.
Keyset mode: in place of the keyfile name, the argument is the DNS domain name of a keyset file. Following options make sense only in this mode. .TP
.RE
.PP
\-c \fIclass\fR \-c \fIclass\fR
.RS 4 Specifies the DNS class (default is IN), useful only in the keyset mode\&.
Specifies the DNS class (default is IN), useful only in the keyset mode. .TP
.RE
.PP
\-d \fIdirectory\fR \-d \fIdirectory\fR
.RS 4 Look for \fIkeyset\fR files in \fBdirectory\fR as the directory, ignored when not in the keyset mode\&.
Look for
\fIkeyset\fR
files in
\fBdirectory\fR
as the directory, ignored when not in the keyset mode.
.RE
.SH "EXAMPLE" .SH "EXAMPLE"
.PP .PP
To build the SHA\-256 DS RR from the To build the SHA\-256 DS RR from the \fBKexample\&.com\&.+003+26160\fR keyfile name, the following command would be issued:
\fBKexample.com.+003+26160\fR
keyfile name, the following command would be issued:
.PP .PP
\fBdnssec\-dsfromkey \-2 Kexample.com.+003+26160\fR \fBdnssec\-dsfromkey \-2 Kexample\&.com\&.+003+26160\fR
.PP .PP
The command would print something like: The command would print something like:
.PP .PP
\fBexample.com. IN DS 26160 5 2 3A1EADA7A74B8D0BA86726B0C227AA85AB8BBD2B2004F41A868A54F0 C5EA0B94\fR \fBexample\&.com\&. IN DS 26160 5 2 3A1EADA7A74B8D0BA86726B0C227AA85AB8BBD2B2004F41A868A54F0 C5EA0B94\fR
.SH "FILES" .SH "FILES"
.PP .PP
The keyfile can be designed by the key identification The keyfile can be designed by the key identification \fIKnnnn\&.+aaa+iiiii\fR or the full file name \fIKnnnn\&.+aaa+iiiii\&.key\fR as generated by dnssec\-keygen(8)\&.
\fIKnnnn.+aaa+iiiii\fR
or the full file name
\fIKnnnn.+aaa+iiiii.key\fR
as generated by
dnssec\-keygen(8).
.PP .PP
The keyset file name is built from the The keyset file name is built from the \fBdirectory\fR, the string \fIkeyset\-\fR and the \fBdnsname\fR\&.
\fBdirectory\fR, the string
\fIkeyset\-\fR
and the
\fBdnsname\fR.
.SH "CAVEAT" .SH "CAVEAT"
.PP .PP
A keyfile error can give a "file not found" even if the file exists. A keyfile error can give a "file not found" even if the file exists\&.
.SH "SEE ALSO" .SH "SEE ALSO"
.PP .PP
\fBdnssec\-keygen\fR(8), \fBdnssec\-keygen\fR(8), \fBdnssec\-signzone\fR(8), BIND 9 Administrator Reference Manual, RFC 3658, RFC 4509\&.
\fBdnssec\-signzone\fR(8),
BIND 9 Administrator Reference Manual,
RFC 3658,
RFC 4509.
.SH "AUTHOR" .SH "AUTHOR"
.PP .PP
Internet Systems Consortium Internet Systems Consortium
.SH "COPYRIGHT"
Copyright \(co 2008 Internet Systems Consortium, Inc. ("ISC")
.br

View File

@ -14,7 +14,7 @@
* PERFORMANCE OF THIS SOFTWARE. * PERFORMANCE OF THIS SOFTWARE.
*/ */
/* $Id: dnssec-dsfromkey.c,v 1.6 2009/05/07 09:33:52 fdupont Exp $ */ /* $Id: dnssec-dsfromkey.c,v 1.7 2009/06/17 06:51:43 each Exp $ */
/*! \file */ /*! \file */
@ -78,10 +78,18 @@ loadkeys(char *dirname, char *setname)
isc_buffer_init(&buf, filename, sizeof(filename)); isc_buffer_init(&buf, filename, sizeof(filename));
if (dirname != NULL) { if (dirname != NULL) {
if (isc_buffer_availablelength(&buf) < strlen(dirname))
fatal("directory name '%s' too long", dirname);
isc_buffer_putstr(&buf, dirname); isc_buffer_putstr(&buf, dirname);
if (dirname[strlen(dirname) - 1] != '/') if (dirname[strlen(dirname) - 1] != '/') {
if (isc_buffer_availablelength(&buf) < 1)
fatal("directory name '%s' too long", dirname);
isc_buffer_putstr(&buf, "/"); isc_buffer_putstr(&buf, "/");
} }
}
if (isc_buffer_availablelength(&buf) < strlen("keyset-"))
fatal("directory name '%s' too long", dirname);
isc_buffer_putstr(&buf, "keyset-"); isc_buffer_putstr(&buf, "keyset-");
result = dns_name_tofilenametext(name, ISC_FALSE, &buf); result = dns_name_tofilenametext(name, ISC_FALSE, &buf);
check_result(result, "dns_name_tofilenametext()"); check_result(result, "dns_name_tofilenametext()");
@ -176,43 +184,63 @@ logkey(dns_rdata_t *rdata)
} }
static void static void
emitds(unsigned int dtype, dns_rdata_t *rdata) emit(unsigned int dtype, dns_rdata_t *rdata, char *lookaside)
{ {
isc_result_t result; isc_result_t result;
unsigned char buf[DNS_DS_BUFFERSIZE]; unsigned char buf[DNS_DS_BUFFERSIZE];
char text_buf[DST_KEY_MAXTEXTSIZE]; char text_buf[DST_KEY_MAXTEXTSIZE];
char name_buf[DNS_NAME_MAXWIRE];
char class_buf[10]; char class_buf[10];
isc_buffer_t textb, classb; isc_buffer_t textb, nameb, classb;
isc_region_t r; isc_region_t r;
dns_rdata_t ds; dns_rdata_t ds;
isc_buffer_init(&textb, text_buf, sizeof(text_buf)); isc_buffer_init(&textb, text_buf, sizeof(text_buf));
isc_buffer_init(&nameb, name_buf, sizeof(name_buf));
isc_buffer_init(&classb, class_buf, sizeof(class_buf)); isc_buffer_init(&classb, class_buf, sizeof(class_buf));
dns_rdata_init(&ds); dns_rdata_init(&ds);
result = dns_ds_buildrdata(name, rdata, dtype, buf, &ds); result = dns_ds_buildrdata(name, rdata, dtype, buf, &ds);
if (result != ISC_R_SUCCESS) if (result != ISC_R_SUCCESS)
fatal("can't build DS"); fatal("can't build record");
result = dns_name_totext(name, ISC_FALSE, &nameb);
if (result != ISC_R_SUCCESS)
fatal("can't print name");
/* Add lookaside origin, if set */
if (lookaside != NULL) {
if (isc_buffer_availablelength(&nameb) < strlen(lookaside))
fatal("DLV origin '%s' is too long", lookaside);
isc_buffer_putstr(&nameb, lookaside);
if (lookaside[strlen(lookaside) - 1] != '.') {
if (isc_buffer_availablelength(&nameb) < 1)
fatal("DLV origin '%s' is too long", lookaside);
isc_buffer_putstr(&nameb, ".");
}
}
result = dns_rdata_totext(&ds, (dns_name_t *) NULL, &textb); result = dns_rdata_totext(&ds, (dns_name_t *) NULL, &textb);
if (result != ISC_R_SUCCESS) if (result != ISC_R_SUCCESS)
fatal("can't print DS rdata"); fatal("can't print rdata");
result = dns_rdataclass_totext(rdclass, &classb); result = dns_rdataclass_totext(rdclass, &classb);
if (result != ISC_R_SUCCESS) if (result != ISC_R_SUCCESS)
fatal("can't print DS class"); fatal("can't print class");
result = dns_name_print(name, stdout); isc_buffer_usedregion(&nameb, &r);
if (result != ISC_R_SUCCESS) fwrite(r.base, 1, r.length, stdout);
fatal("can't print DS name");
putchar(' '); putchar(' ');
isc_buffer_usedregion(&classb, &r); isc_buffer_usedregion(&classb, &r);
fwrite(r.base, 1, r.length, stdout); fwrite(r.base, 1, r.length, stdout);
if (lookaside == NULL)
printf(" DS "); printf(" DS ");
else
printf(" DLV ");
isc_buffer_usedregion(&textb, &r); isc_buffer_usedregion(&textb, &r);
fwrite(r.base, 1, r.length, stdout); fwrite(r.base, 1, r.length, stdout);
@ -223,7 +251,7 @@ static void
usage(void) { usage(void) {
fprintf(stderr, "Usage:\n"); fprintf(stderr, "Usage:\n");
fprintf(stderr, " %s options keyfile\n\n", program); fprintf(stderr, " %s options keyfile\n\n", program);
fprintf(stderr, " %s options [-c class] [-d dir] -s dnsname\n\n", fprintf(stderr, " %s options [-c class] [-d dir] [-l lookaside] -s dnsname\n\n",
program); program);
fprintf(stderr, "Version: %s\n", VERSION); fprintf(stderr, "Version: %s\n", VERSION);
fprintf(stderr, "Options:\n"); fprintf(stderr, "Options:\n");
@ -233,9 +261,10 @@ usage(void) {
fprintf(stderr, " -a algorithm: use algorithm\n"); fprintf(stderr, " -a algorithm: use algorithm\n");
fprintf(stderr, "Keyset options:\n"); fprintf(stderr, "Keyset options:\n");
fprintf(stderr, " -s: keyset mode\n"); fprintf(stderr, " -s: keyset mode\n");
fprintf(stderr, " -l: add lookaside zone and print DLV records\n");
fprintf(stderr, " -c class\n"); fprintf(stderr, " -c class\n");
fprintf(stderr, " -d directory\n"); fprintf(stderr, " -d directory\n");
fprintf(stderr, "Output: DS RRs\n"); fprintf(stderr, "Output: DS or DLV RRs\n");
exit (-1); exit (-1);
} }
@ -243,6 +272,7 @@ usage(void) {
int int
main(int argc, char **argv) { main(int argc, char **argv) {
char *algname = NULL, *classname = NULL, *dirname = NULL; char *algname = NULL, *classname = NULL, *dirname = NULL;
char *lookaside = NULL;
char *endp; char *endp;
int ch; int ch;
unsigned int dtype = DNS_DSDIGEST_SHA1; unsigned int dtype = DNS_DSDIGEST_SHA1;
@ -267,7 +297,7 @@ main(int argc, char **argv) {
isc_commandline_errprint = ISC_FALSE; isc_commandline_errprint = ISC_FALSE;
while ((ch = isc_commandline_parse(argc, argv, while ((ch = isc_commandline_parse(argc, argv,
"12a:c:d:sv:Fh")) != -1) { "12a:c:d:l:sv:Fh")) != -1) {
switch (ch) { switch (ch) {
case '1': case '1':
dtype = DNS_DSDIGEST_SHA1; dtype = DNS_DSDIGEST_SHA1;
@ -286,6 +316,13 @@ main(int argc, char **argv) {
break; break;
case 'd': case 'd':
dirname = isc_commandline_argument; dirname = isc_commandline_argument;
if (strlen(dirname) == 0)
fatal("dir must be a non-empty string");
break;
case 'l':
lookaside = isc_commandline_argument;
if (strlen(lookaside) == 0)
fatal("lookaside must be a non-empty string");
break; break;
case 's': case 's':
usekeyset = ISC_TRUE; usekeyset = ISC_TRUE;
@ -357,10 +394,10 @@ main(int argc, char **argv) {
logkey(&rdata); logkey(&rdata);
if (both) { if (both) {
emitds(DNS_DSDIGEST_SHA1, &rdata); emit(DNS_DSDIGEST_SHA1, &rdata, lookaside);
emitds(DNS_DSDIGEST_SHA256, &rdata); emit(DNS_DSDIGEST_SHA256, &rdata, lookaside);
} else } else
emitds(dtype, &rdata); emit(dtype, &rdata, lookaside);
} }
} else { } else {
unsigned char key_buf[DST_KEY_MAXSIZE]; unsigned char key_buf[DST_KEY_MAXSIZE];
@ -369,10 +406,10 @@ main(int argc, char **argv) {
DST_KEY_MAXSIZE, &rdata); DST_KEY_MAXSIZE, &rdata);
if (both) { if (both) {
emitds(DNS_DSDIGEST_SHA1, &rdata); emit(DNS_DSDIGEST_SHA1, &rdata, lookaside);
emitds(DNS_DSDIGEST_SHA256, &rdata); emit(DNS_DSDIGEST_SHA256, &rdata, lookaside);
} else } else
emitds(dtype, &rdata); emit(dtype, &rdata, lookaside);
} }
if (dns_rdataset_isassociated(&keyset)) if (dns_rdataset_isassociated(&keyset))

View File

@ -17,7 +17,7 @@
- PERFORMANCE OF THIS SOFTWARE. - PERFORMANCE OF THIS SOFTWARE.
--> -->
<!-- $Id: dnssec-dsfromkey.docbook,v 1.6 2008/11/07 13:54:11 jreed Exp $ --> <!-- $Id: dnssec-dsfromkey.docbook,v 1.7 2009/06/17 06:51:43 each Exp $ -->
<refentry id="man.dnssec-dsfromkey"> <refentry id="man.dnssec-dsfromkey">
<refentryinfo> <refentryinfo>
<date>November 29, 2008</date> <date>November 29, 2008</date>
@ -114,6 +114,17 @@
</listitem> </listitem>
</varlistentry> </varlistentry>
<varlistentry>
<term>-l <replaceable class="parameter">domain</replaceable></term>
<listitem>
<para>
Generate a DLV set instead of a DS set. The specified
<option>domain</option> is appended to the name for each
record in the set.
</para>
</listitem>
</varlistentry>
<varlistentry> <varlistentry>
<term>-s</term> <term>-s</term>
<listitem> <listitem>

View File

@ -1,7 +1,7 @@
<!-- <!--
- Copyright (C) 2008 Internet Systems Consortium, Inc. ("ISC") - Copyright (C) 2008 Internet Systems Consortium, Inc. ("ISC")
- -
- Permission to use, copy, modify, and/or distribute this software for any - Permission to use, copy, modify, and distribute this software for any
- purpose with or without fee is hereby granted, provided that the above - purpose with or without fee is hereby granted, provided that the above
- copyright notice and this permission notice appear in all copies. - copyright notice and this permission notice appear in all copies.
- -
@ -13,13 +13,12 @@
- OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- PERFORMANCE OF THIS SOFTWARE. - PERFORMANCE OF THIS SOFTWARE.
--> -->
<!-- $Id: dnssec-dsfromkey.html,v 1.6 2009/06/17 06:51:43 each Exp $ -->
<!-- $Id: dnssec-dsfromkey.html,v 1.5 2008/11/08 01:11:47 tbox Exp $ -->
<html> <html>
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>dnssec-dsfromkey</title> <title>dnssec-dsfromkey</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.71.1"> <meta name="generator" content="DocBook XSL Stylesheets V1.67.2">
</head> </head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="refentry" lang="en"> <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="refentry" lang="en">
<a name="man.dnssec-dsfromkey"></a><div class="titlepage"></div> <a name="man.dnssec-dsfromkey"></a><div class="titlepage"></div>
@ -33,14 +32,14 @@
<div class="cmdsynopsis"><p><code class="command">dnssec-dsfromkey</code> {-s} [<code class="option">-v <em class="replaceable"><code>level</code></em></code>] [<code class="option">-1</code>] [<code class="option">-2</code>] [<code class="option">-a <em class="replaceable"><code>alg</code></em></code>] [<code class="option">-c <em class="replaceable"><code>class</code></em></code>] [<code class="option">-d <em class="replaceable"><code>dir</code></em></code>] {dnsname}</p></div> <div class="cmdsynopsis"><p><code class="command">dnssec-dsfromkey</code> {-s} [<code class="option">-v <em class="replaceable"><code>level</code></em></code>] [<code class="option">-1</code>] [<code class="option">-2</code>] [<code class="option">-a <em class="replaceable"><code>alg</code></em></code>] [<code class="option">-c <em class="replaceable"><code>class</code></em></code>] [<code class="option">-d <em class="replaceable"><code>dir</code></em></code>] {dnsname}</p></div>
</div> </div>
<div class="refsect1" lang="en"> <div class="refsect1" lang="en">
<a name="id2543424"></a><h2>DESCRIPTION</h2> <a name="id215105"></a><h2>DESCRIPTION</h2>
<p><span><strong class="command">dnssec-dsfromkey</strong></span> <p><span><strong class="command">dnssec-dsfromkey</strong></span>
outputs the Delegation Signer (DS) resource record (RR), as defined in outputs the Delegation Signer (DS) resource record (RR), as defined in
RFC 3658 and RFC 4509, for the given key(s). RFC 3658 and RFC 4509, for the given key(s).
</p> </p>
</div> </div>
<div class="refsect1" lang="en"> <div class="refsect1" lang="en">
<a name="id2543435"></a><h2>OPTIONS</h2> <a name="id215118"></a><h2>OPTIONS</h2>
<div class="variablelist"><dl> <div class="variablelist"><dl>
<dt><span class="term">-1</span></dt> <dt><span class="term">-1</span></dt>
<dd><p> <dd><p>
@ -61,6 +60,12 @@
<dd><p> <dd><p>
Sets the debugging level. Sets the debugging level.
</p></dd> </p></dd>
<dt><span class="term">-l <em class="replaceable"><code>domain</code></em></span></dt>
<dd><p>
Generate a DLV set instead of a DS set. The specified
<code class="option">domain</code> is appended to the name for each
record in the set.
</p></dd>
<dt><span class="term">-s</span></dt> <dt><span class="term">-s</span></dt>
<dd><p> <dd><p>
Keyset mode: in place of the keyfile name, the argument is Keyset mode: in place of the keyfile name, the argument is
@ -81,7 +86,7 @@
</dl></div> </dl></div>
</div> </div>
<div class="refsect1" lang="en"> <div class="refsect1" lang="en">
<a name="id2543563"></a><h2>EXAMPLE</h2> <a name="id215271"></a><h2>EXAMPLE</h2>
<p> <p>
To build the SHA-256 DS RR from the To build the SHA-256 DS RR from the
<strong class="userinput"><code>Kexample.com.+003+26160</code></strong> <strong class="userinput"><code>Kexample.com.+003+26160</code></strong>
@ -96,7 +101,7 @@
</p> </p>
</div> </div>
<div class="refsect1" lang="en"> <div class="refsect1" lang="en">
<a name="id2543593"></a><h2>FILES</h2> <a name="id215301"></a><h2>FILES</h2>
<p> <p>
The keyfile can be designed by the key identification The keyfile can be designed by the key identification
<code class="filename">Knnnn.+aaa+iiiii</code> or the full file name <code class="filename">Knnnn.+aaa+iiiii</code> or the full file name
@ -110,13 +115,13 @@
</p> </p>
</div> </div>
<div class="refsect1" lang="en"> <div class="refsect1" lang="en">
<a name="id2543628"></a><h2>CAVEAT</h2> <a name="id215336"></a><h2>CAVEAT</h2>
<p> <p>
A keyfile error can give a "file not found" even if the file exists. A keyfile error can give a "file not found" even if the file exists.
</p> </p>
</div> </div>
<div class="refsect1" lang="en"> <div class="refsect1" lang="en">
<a name="id2543638"></a><h2>SEE ALSO</h2> <a name="id215346"></a><h2>SEE ALSO</h2>
<p><span class="citerefentry"><span class="refentrytitle">dnssec-keygen</span>(8)</span>, <p><span class="citerefentry"><span class="refentrytitle">dnssec-keygen</span>(8)</span>,
<span class="citerefentry"><span class="refentrytitle">dnssec-signzone</span>(8)</span>, <span class="citerefentry"><span class="refentrytitle">dnssec-signzone</span>(8)</span>,
<em class="citetitle">BIND 9 Administrator Reference Manual</em>, <em class="citetitle">BIND 9 Administrator Reference Manual</em>,
@ -125,7 +130,7 @@
</p> </p>
</div> </div>
<div class="refsect1" lang="en"> <div class="refsect1" lang="en">
<a name="id2543674"></a><h2>AUTHOR</h2> <a name="id215382"></a><h2>AUTHOR</h2>
<p><span class="corpauthor">Internet Systems Consortium</span> <p><span class="corpauthor">Internet Systems Consortium</span>
</p> </p>
</div> </div>

View File

@ -13,188 +13,120 @@
.\" OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR .\" OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
.\" PERFORMANCE OF THIS SOFTWARE. .\" PERFORMANCE OF THIS SOFTWARE.
.\" .\"
.\" $Id: dnssec-keygen.8,v 1.40 2008/10/15 01:11:35 tbox Exp $ .\" $Id: dnssec-keygen.8,v 1.41 2009/06/17 06:51:43 each Exp $
.\" .\"
.hy 0 .hy 0
.ad l .ad l
.\" Title: dnssec\-keygen .\"Generated by db2man.xsl. Don't modify this, modify the source.
.\" Author: .de Sh \" Subsection
.\" Generator: DocBook XSL Stylesheets v1.71.1 <http://docbook.sf.net/> .br
.\" Date: June 30, 2000 .if t .Sp
.\" Manual: BIND9 .ne 5
.\" Source: BIND9 .PP
.\" \fB\\$1\fR
.TH "DNSSEC\-KEYGEN" "8" "June 30, 2000" "BIND9" "BIND9" .PP
.\" disable hyphenation ..
.nh .de Sp \" Vertical space (when we can't use .PP)
.\" disable justification (adjust text to left margin only) .if t .sp .5v
.ad l .if n .sp
.SH "NAME" ..
dnssec\-keygen \- DNSSEC key generation tool .de Ip \" List item
.br
.ie \\n(.$>=3 .ne \\$3
.el .ne 3
.IP "\\$1" \\$2
..
.TH "DNSSEC-KEYGEN" 8 "June 30, 2000" "" ""
.SH NAME
dnssec-keygen \- DNSSEC key generation tool
.SH "SYNOPSIS" .SH "SYNOPSIS"
.HP 14 .HP 14
\fBdnssec\-keygen\fR {\-a\ \fIalgorithm\fR} {\-b\ \fIkeysize\fR} {\-n\ \fInametype\fR} [\fB\-c\ \fR\fB\fIclass\fR\fR] [\fB\-e\fR] [\fB\-f\ \fR\fB\fIflag\fR\fR] [\fB\-g\ \fR\fB\fIgenerator\fR\fR] [\fB\-h\fR] [\fB\-k\fR] [\fB\-p\ \fR\fB\fIprotocol\fR\fR] [\fB\-r\ \fR\fB\fIrandomdev\fR\fR] [\fB\-s\ \fR\fB\fIstrength\fR\fR] [\fB\-t\ \fR\fB\fItype\fR\fR] [\fB\-v\ \fR\fB\fIlevel\fR\fR] {name} \fBdnssec\-keygen\fR {\-a\ \fIalgorithm\fR} {\-b\ \fIkeysize\fR} {\-n\ \fInametype\fR} [\fB\-c\ \fIclass\fR\fR] [\fB\-e\fR] [\fB\-f\ \fIflag\fR\fR] [\fB\-g\ \fIgenerator\fR\fR] [\fB\-h\fR] [\fB\-k\fR] [\fB\-p\ \fIprotocol\fR\fR] [\fB\-r\ \fIrandomdev\fR\fR] [\fB\-s\ \fIstrength\fR\fR] [\fB\-t\ \fItype\fR\fR] [\fB\-v\ \fIlevel\fR\fR] {name}
.SH "DESCRIPTION" .SH "DESCRIPTION"
.PP .PP
\fBdnssec\-keygen\fR \fBdnssec\-keygen\fR generates keys for DNSSEC (Secure DNS), as defined in RFC 2535 and RFC 4034\&. It can also generate keys for use with TSIG (Transaction Signatures), as defined in RFC 2845\&.
generates keys for DNSSEC (Secure DNS), as defined in RFC 2535 and RFC 4034. It can also generate keys for use with TSIG (Transaction Signatures), as defined in RFC 2845.
.SH "OPTIONS" .SH "OPTIONS"
.PP .TP
\-a \fIalgorithm\fR \-a \fIalgorithm\fR
.RS 4 Selects the cryptographic algorithm\&. The value of \fBalgorithm\fR must be one of RSAMD5 (RSA) or RSASHA1, DSA, NSEC3RSASHA1, NSEC3DSA, DH (Diffie Hellman), or HMAC\-MD5\&. These values are case insensitive\&. The default is RSASHA1 for DNSSEC key generation\&.
Selects the cryptographic algorithm. The value of Note 1: that for DNSSEC, RSASHA1 is a mandatory to implement algorithm, and DSA is recommended\&. For TSIG, HMAC\-MD5 is mandatory\&.
\fBalgorithm\fR Note 2: HMAC\-MD5 and DH automatically set the \-k flag\&.
must be one of RSAMD5 (RSA) or RSASHA1, DSA, NSEC3RSASHA1, NSEC3DSA, DH (Diffie Hellman), or HMAC\-MD5. These values are case insensitive. .TP
.sp
Note 1: that for DNSSEC, RSASHA1 is a mandatory to implement algorithm, and DSA is recommended. For TSIG, HMAC\-MD5 is mandatory.
.sp
Note 2: HMAC\-MD5 and DH automatically set the \-k flag.
.RE
.PP
\-b \fIkeysize\fR \-b \fIkeysize\fR
.RS 4 Specifies the number of bits in the key\&. The choice of key size depends on the algorithm used\&. RSAMD5 / RSASHA1 keys must be between 512 and 2048 bits\&. Diffie Hellman keys must be between 128 and 4096 bits\&. DSA keys must be between 512 and 1024 bits and an exact multiple of 64\&. HMAC\-MD5 keys must be between 1 and 512 bits\&.
Specifies the number of bits in the key. The choice of key size depends on the algorithm used. RSAMD5 / RSASHA1 keys must be between 512 and 2048 bits. Diffie Hellman keys must be between 128 and 4096 bits. DSA keys must be between 512 and 1024 bits and an exact multiple of 64. HMAC\-MD5 keys must be between 1 and 512 bits. When generating a DNSSEC key with the default algorithm, this
.RE value defaults to 1024, or 2048 if the KSK flag is set\&.
.PP .TP
\-n \fInametype\fR \-n \fInametype\fR
.RS 4 Specifies the owner type of the key\&. The value of \fBnametype\fR must either be ZONE (for a DNSSEC zone key (KEY/DNSKEY)), HOST or ENTITY (for a key associated with a host (KEY)), USER (for a key associated with a user(KEY)) or OTHER (DNSKEY)\&. These values are case insensitive\&. Defaults to ZONE for DNSKEY generation\&.
Specifies the owner type of the key. The value of .TP
\fBnametype\fR
must either be ZONE (for a DNSSEC zone key (KEY/DNSKEY)), HOST or ENTITY (for a key associated with a host (KEY)), USER (for a key associated with a user(KEY)) or OTHER (DNSKEY). These values are case insensitive. Defaults to ZONE for DNSKEY generation.
.RE
.PP
\-c \fIclass\fR \-c \fIclass\fR
.RS 4 Indicates that the DNS record containing the key should have the specified class\&. If not specified, class IN is used\&.
Indicates that the DNS record containing the key should have the specified class. If not specified, class IN is used. .TP
.RE
.PP
\-e \-e
.RS 4 If generating an RSAMD5/RSASHA1 key, use a large exponent\&.
If generating an RSAMD5/RSASHA1 key, use a large exponent. .TP
.RE
.PP
\-f \fIflag\fR \-f \fIflag\fR
.RS 4 Set the specified flag in the flag field of the KEY/DNSKEY record\&. The only recognized flag is KSK (Key Signing Key) DNSKEY\&.
Set the specified flag in the flag field of the KEY/DNSKEY record. The only recognized flag is KSK (Key Signing Key) DNSKEY. .TP
.RE
.PP
\-g \fIgenerator\fR \-g \fIgenerator\fR
.RS 4 If generating a Diffie Hellman key, use this generator\&. Allowed values are 2 and 5\&. If no generator is specified, a known prime from RFC 2539 will be used if possible; otherwise the default is 2\&.
If generating a Diffie Hellman key, use this generator. Allowed values are 2 and 5. If no generator is specified, a known prime from RFC 2539 will be used if possible; otherwise the default is 2. .TP
.RE
.PP
\-h \-h
.RS 4 Prints a short summary of the options and arguments to \fBdnssec\-keygen\fR\&.
Prints a short summary of the options and arguments to .TP
\fBdnssec\-keygen\fR.
.RE
.PP
\-k \-k
.RS 4 Generate KEY records rather than DNSKEY records\&.
Generate KEY records rather than DNSKEY records. .TP
.RE
.PP
\-p \fIprotocol\fR \-p \fIprotocol\fR
.RS 4 Sets the protocol value for the generated key\&. The protocol is a number between 0 and 255\&. The default is 3 (DNSSEC)\&. Other possible values for this argument are listed in RFC 2535 and its successors\&.
Sets the protocol value for the generated key. The protocol is a number between 0 and 255. The default is 3 (DNSSEC). Other possible values for this argument are listed in RFC 2535 and its successors. .TP
.RE
.PP
\-r \fIrandomdev\fR \-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\&.
Specifies the source of randomness. If the operating system does not provide a .TP
\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
\-s \fIstrength\fR \-s \fIstrength\fR
.RS 4 Specifies the strength value of the key\&. The strength is a number between 0 and 15, and currently has no defined purpose in DNSSEC\&.
Specifies the strength value of the key. The strength is a number between 0 and 15, and currently has no defined purpose in DNSSEC. .TP
.RE
.PP
\-t \fItype\fR \-t \fItype\fR
.RS 4 Indicates the use of the key\&. \fBtype\fR must be one of AUTHCONF, NOAUTHCONF, NOAUTH, or NOCONF\&. The default is AUTHCONF\&. AUTH refers to the ability to authenticate data, and CONF the ability to encrypt data\&.
Indicates the use of the key. .TP
\fBtype\fR
must be one of AUTHCONF, NOAUTHCONF, NOAUTH, or NOCONF. The default is AUTHCONF. AUTH refers to the ability to authenticate data, and CONF the ability to encrypt data.
.RE
.PP
\-v \fIlevel\fR \-v \fIlevel\fR
.RS 4 Sets the debugging level\&.
Sets the debugging level.
.RE
.SH "GENERATED KEYS" .SH "GENERATED KEYS"
.PP .PP
When When \fBdnssec\-keygen\fR completes successfully, it prints a string of the form \fIKnnnn\&.+aaa+iiiii\fR to the standard output\&. This is an identification string for the key it has generated\&.
\fBdnssec\-keygen\fR .TP 3
completes successfully, it prints a string of the form
\fIKnnnn.+aaa+iiiii\fR
to the standard output. This is an identification string for the key it has generated.
.TP 4
\(bu \(bu
\fInnnn\fR \fInnnn\fR is the key name\&.
is the key name. .TP
.TP 4
\(bu \(bu
\fIaaa\fR \fIaaa\fR is the numeric representation of the algorithm\&.
is the numeric representation of the algorithm. .TP
.TP 4
\(bu \(bu
\fIiiiii\fR \fIiiiii\fR is the key identifier (or footprint)\&.
is the key identifier (or footprint). .LP
.PP .PP
\fBdnssec\-keygen\fR \fBdnssec\-keygen\fR creates two files, with names based on the printed string\&. \fIKnnnn\&.+aaa+iiiii\&.key\fR contains the public key, and \fIKnnnn\&.+aaa+iiiii\&.private\fR contains the private key\&.
creates two files, with names based on the printed string.
\fIKnnnn.+aaa+iiiii.key\fR
contains the public key, and
\fIKnnnn.+aaa+iiiii.private\fR
contains the private key.
.PP .PP
The The \fI\&.key\fR file contains a DNS KEY record that can be inserted into a zone file (directly or with a $INCLUDE statement)\&.
\fI.key\fR
file contains a DNS KEY record that can be inserted into a zone file (directly or with a $INCLUDE statement).
.PP .PP
The The \fI\&.private\fR file contains algorithm\-specific fields\&. For obvious security reasons, this file does not have general read permission\&.
\fI.private\fR
file contains algorithm\-specific fields. For obvious security reasons, this file does not have general read permission.
.PP .PP
Both Both \fI\&.key\fR and \fI\&.private\fR files are generated for symmetric encryption algorithms such as HMAC\-MD5, even though the public and private key are equivalent\&.
\fI.key\fR
and
\fI.private\fR
files are generated for symmetric encryption algorithms such as HMAC\-MD5, even though the public and private key are equivalent.
.SH "EXAMPLE" .SH "EXAMPLE"
.PP .PP
To generate a 768\-bit DSA key for the domain To generate a 768\-bit DSA key for the domain \fBexample\&.com\fR, the following command would be issued:
\fBexample.com\fR, the following command would be issued:
.PP .PP
\fBdnssec\-keygen \-a DSA \-b 768 \-n ZONE example.com\fR \fBdnssec\-keygen \-a DSA \-b 768 \-n ZONE example\&.com\fR
.PP .PP
The command would print a string of the form: The command would print a string of the form:
.PP .PP
\fBKexample.com.+003+26160\fR \fBKexample\&.com\&.+003+26160\fR
.PP .PP
In this example, In this example, \fBdnssec\-keygen\fR creates the files \fIKexample\&.com\&.+003+26160\&.key\fR and \fIKexample\&.com\&.+003+26160\&.private\fR\&.
\fBdnssec\-keygen\fR
creates the files
\fIKexample.com.+003+26160.key\fR
and
\fIKexample.com.+003+26160.private\fR.
.SH "SEE ALSO" .SH "SEE ALSO"
.PP .PP
\fBdnssec\-signzone\fR(8), \fBdnssec\-signzone\fR(8), BIND 9 Administrator Reference Manual, RFC 2539, RFC 2845, RFC 4033\&.
BIND 9 Administrator Reference Manual,
RFC 2539,
RFC 2845,
RFC 4033.
.SH "AUTHOR" .SH "AUTHOR"
.PP .PP
Internet Systems Consortium Internet Systems Consortium
.SH "COPYRIGHT"
Copyright \(co 2004, 2005, 2007, 2008 Internet Systems Consortium, Inc. ("ISC")
.br
Copyright \(co 2000\-2003 Internet Software Consortium.
.br

View File

@ -29,7 +29,7 @@
* IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/ */
/* $Id: dnssec-keygen.c,v 1.83 2009/05/07 23:47:44 tbox Exp $ */ /* $Id: dnssec-keygen.c,v 1.84 2009/06/17 06:51:43 each Exp $ */
/*! \file */ /*! \file */
@ -67,6 +67,8 @@ static const char *algs = "RSA | RSAMD5 | DH | DSA | RSASHA1 | NSEC3DSA |"
" HMAC-SHA1 | HMAC-SHA224 | HMAC-SHA256 |" " HMAC-SHA1 | HMAC-SHA224 | HMAC-SHA256 |"
" HMAC-SHA384 | HMAC-SHA512"; " HMAC-SHA384 | HMAC-SHA512";
#define DEFAULT_ALGORITHM "RSASHA1"
static isc_boolean_t static isc_boolean_t
dsa_size_ok(int size) { dsa_size_ok(int size) {
return (ISC_TF(size >= 512 && size <= 1024 && size % 64 == 0)); return (ISC_TF(size >= 512 && size <= 1024 && size % 64 == 0));
@ -75,11 +77,12 @@ dsa_size_ok(int size) {
static void static void
usage(void) { usage(void) {
fprintf(stderr, "Usage:\n"); fprintf(stderr, "Usage:\n");
fprintf(stderr, " %s -a alg -b bits [-n type] [options] name\n\n", fprintf(stderr, " %s [options] name\n\n",
program); program);
fprintf(stderr, "Version: %s\n", VERSION); fprintf(stderr, "Version: %s\n", VERSION);
fprintf(stderr, "Required options:\n"); fprintf(stderr, " name: owner of the key\n");
fprintf(stderr, " -a algorithm: %s\n", algs); fprintf(stderr, "Options:\n");
fprintf(stderr, " -a algorithm: %s (default RSASHA1)\n", algs);
fprintf(stderr, " -b key size, in bits:\n"); fprintf(stderr, " -b key size, in bits:\n");
fprintf(stderr, " RSAMD5:\t\t[512..%d]\n", MAX_RSA); fprintf(stderr, " RSAMD5:\t\t[512..%d]\n", MAX_RSA);
fprintf(stderr, " RSASHA1:\t\t[512..%d]\n", MAX_RSA); fprintf(stderr, " RSASHA1:\t\t[512..%d]\n", MAX_RSA);
@ -93,10 +96,9 @@ usage(void) {
fprintf(stderr, " HMAC-SHA256:\t[1..256]\n"); fprintf(stderr, " HMAC-SHA256:\t[1..256]\n");
fprintf(stderr, " HMAC-SHA384:\t[1..384]\n"); fprintf(stderr, " HMAC-SHA384:\t[1..384]\n");
fprintf(stderr, " HMAC-SHA512:\t[1..512]\n"); fprintf(stderr, " HMAC-SHA512:\t[1..512]\n");
fprintf(stderr, " (default 1024 for RSASHA1 ZSK, 2048 for KSK\n");
fprintf(stderr, " -n nametype: ZONE | HOST | ENTITY | USER | OTHER\n"); fprintf(stderr, " -n nametype: ZONE | HOST | ENTITY | USER | OTHER\n");
fprintf(stderr, " (DNSKEY generation defaults to ZONE\n"); fprintf(stderr, " (DNSKEY generation defaults to ZONE)\n");
fprintf(stderr, " name: owner of the key\n");
fprintf(stderr, "Other options:\n");
fprintf(stderr, " -c <class> (default: IN)\n"); fprintf(stderr, " -c <class> (default: IN)\n");
fprintf(stderr, " -d <digest bits> (0 => max, default)\n"); fprintf(stderr, " -d <digest bits> (0 => max, default)\n");
fprintf(stderr, " -e use large exponent (RSAMD5/RSASHA1 only)\n"); fprintf(stderr, " -e use large exponent (RSAMD5/RSASHA1 only)\n");
@ -143,6 +145,7 @@ main(int argc, char **argv) {
dns_rdataclass_t rdclass; dns_rdataclass_t rdclass;
int options = DST_TYPE_PRIVATE | DST_TYPE_PUBLIC; int options = DST_TYPE_PRIVATE | DST_TYPE_PUBLIC;
int dbits = 0; int dbits = 0;
isc_boolean_t use_default = ISC_FALSE;
if (argc == 1) if (argc == 1)
usage(); usage();
@ -252,8 +255,14 @@ main(int argc, char **argv) {
if (argc > isc_commandline_index + 1) if (argc > isc_commandline_index + 1)
fatal("extraneous arguments"); fatal("extraneous arguments");
if (algname == NULL) if (algname == NULL) {
fatal("no algorithm was specified"); algname = strdup(DEFAULT_ALGORITHM);
use_default = ISC_TRUE;
if (verbose > 0)
fprintf(stderr, "no algorithm specified; "
"defaulting to %s\n", algname);
}
if (strcasecmp(algname, "RSA") == 0) { if (strcasecmp(algname, "RSA") == 0) {
fprintf(stderr, "The use of RSA (RSAMD5) is not recommended.\n" fprintf(stderr, "The use of RSA (RSAMD5) is not recommended.\n"
"If you still wish to use RSA (RSAMD5) please " "If you still wish to use RSA (RSAMD5) please "
@ -303,8 +312,16 @@ main(int argc, char **argv) {
fatal("invalid type %s", type); fatal("invalid type %s", type);
} }
if (size < 0) if (size < 0) {
if (use_default) {
size = (ksk != 0) ? 2048 : 1024;
if (verbose > 0)
fprintf(stderr, "key size not specified; "
"defaulting to %d\n", size);
} else {
fatal("key size not specified (-b option)"); fatal("key size not specified (-b option)");
}
}
switch (alg) { switch (alg) {
case DNS_KEYALG_RSAMD5: case DNS_KEYALG_RSAMD5:

View File

@ -18,7 +18,7 @@
- PERFORMANCE OF THIS SOFTWARE. - PERFORMANCE OF THIS SOFTWARE.
--> -->
<!-- $Id: dnssec-keygen.docbook,v 1.22 2008/10/14 14:32:50 jreed Exp $ --> <!-- $Id: dnssec-keygen.docbook,v 1.23 2009/06/17 06:51:43 each Exp $ -->
<refentry id="man.dnssec-keygen"> <refentry id="man.dnssec-keygen">
<refentryinfo> <refentryinfo>
<date>June 30, 2000</date> <date>June 30, 2000</date>
@ -55,9 +55,9 @@
<refsynopsisdiv> <refsynopsisdiv>
<cmdsynopsis> <cmdsynopsis>
<command>dnssec-keygen</command> <command>dnssec-keygen</command>
<arg choice="req">-a <replaceable class="parameter">algorithm</replaceable></arg> <arg><option>-a <replaceable class="parameter">algorithm</replaceable></option></arg>
<arg choice="req">-b <replaceable class="parameter">keysize</replaceable></arg> <arg ><option>-b <replaceable class="parameter">keysize</replaceable></option></arg>
<arg choice="req">-n <replaceable class="parameter">nametype</replaceable></arg> <arg><option>-n <replaceable class="parameter">nametype</replaceable></option></arg>
<arg><option>-c <replaceable class="parameter">class</replaceable></option></arg> <arg><option>-c <replaceable class="parameter">class</replaceable></option></arg>
<arg><option>-e</option></arg> <arg><option>-e</option></arg>
<arg><option>-f <replaceable class="parameter">flag</replaceable></option></arg> <arg><option>-f <replaceable class="parameter">flag</replaceable></option></arg>
@ -93,7 +93,8 @@
Selects the cryptographic algorithm. The value of Selects the cryptographic algorithm. The value of
<option>algorithm</option> must be one of RSAMD5 (RSA) or RSASHA1, <option>algorithm</option> must be one of RSAMD5 (RSA) or RSASHA1,
DSA, NSEC3RSASHA1, NSEC3DSA, DH (Diffie Hellman), or HMAC-MD5. DSA, NSEC3RSASHA1, NSEC3DSA, DH (Diffie Hellman), or HMAC-MD5.
These values are case insensitive. These values are case insensitive. The default is RSASHA1 for
DNSSEC key generation.
</para> </para>
<para> <para>
Note 1: that for DNSSEC, RSASHA1 is a mandatory to implement Note 1: that for DNSSEC, RSASHA1 is a mandatory to implement
@ -112,12 +113,15 @@
<para> <para>
Specifies the number of bits in the key. The choice of key Specifies the number of bits in the key. The choice of key
size depends on the algorithm used. RSAMD5 / RSASHA1 keys must be size depends on the algorithm used. RSAMD5 / RSASHA1 keys must be
between between 512 and 2048 bits. Diffie Hellman keys must be between
512 and 2048 bits. Diffie Hellman keys must be between
128 and 4096 bits. DSA keys must be between 512 and 1024 128 and 4096 bits. DSA keys must be between 512 and 1024
bits and an exact multiple of 64. HMAC-MD5 keys must be bits and an exact multiple of 64. HMAC-MD5 keys must be
between 1 and 512 bits. between 1 and 512 bits.
</para> </para>
When generating a DNSSEC key with the default algorithm, this
value defaults to 1024, or 2048 if the KSK flag is set.
<para>
</para>
</listitem> </listitem>
</varlistentry> </varlistentry>

View File

@ -14,12 +14,12 @@
- OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- PERFORMANCE OF THIS SOFTWARE. - PERFORMANCE OF THIS SOFTWARE.
--> -->
<!-- $Id: dnssec-keygen.html,v 1.32 2008/10/15 01:11:35 tbox Exp $ --> <!-- $Id: dnssec-keygen.html,v 1.33 2009/06/17 06:51:43 each Exp $ -->
<html> <html>
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>dnssec-keygen</title> <title>dnssec-keygen</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.71.1"> <meta name="generator" content="DocBook XSL Stylesheets V1.67.2">
</head> </head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="refentry" lang="en"> <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="refentry" lang="en">
<a name="man.dnssec-keygen"></a><div class="titlepage"></div> <a name="man.dnssec-keygen"></a><div class="titlepage"></div>
@ -32,7 +32,7 @@
<div class="cmdsynopsis"><p><code class="command">dnssec-keygen</code> {-a <em class="replaceable"><code>algorithm</code></em>} {-b <em class="replaceable"><code>keysize</code></em>} {-n <em class="replaceable"><code>nametype</code></em>} [<code class="option">-c <em class="replaceable"><code>class</code></em></code>] [<code class="option">-e</code>] [<code class="option">-f <em class="replaceable"><code>flag</code></em></code>] [<code class="option">-g <em class="replaceable"><code>generator</code></em></code>] [<code class="option">-h</code>] [<code class="option">-k</code>] [<code class="option">-p <em class="replaceable"><code>protocol</code></em></code>] [<code class="option">-r <em class="replaceable"><code>randomdev</code></em></code>] [<code class="option">-s <em class="replaceable"><code>strength</code></em></code>] [<code class="option">-t <em class="replaceable"><code>type</code></em></code>] [<code class="option">-v <em class="replaceable"><code>level</code></em></code>] {name}</p></div> <div class="cmdsynopsis"><p><code class="command">dnssec-keygen</code> {-a <em class="replaceable"><code>algorithm</code></em>} {-b <em class="replaceable"><code>keysize</code></em>} {-n <em class="replaceable"><code>nametype</code></em>} [<code class="option">-c <em class="replaceable"><code>class</code></em></code>] [<code class="option">-e</code>] [<code class="option">-f <em class="replaceable"><code>flag</code></em></code>] [<code class="option">-g <em class="replaceable"><code>generator</code></em></code>] [<code class="option">-h</code>] [<code class="option">-k</code>] [<code class="option">-p <em class="replaceable"><code>protocol</code></em></code>] [<code class="option">-r <em class="replaceable"><code>randomdev</code></em></code>] [<code class="option">-s <em class="replaceable"><code>strength</code></em></code>] [<code class="option">-t <em class="replaceable"><code>type</code></em></code>] [<code class="option">-v <em class="replaceable"><code>level</code></em></code>] {name}</p></div>
</div> </div>
<div class="refsect1" lang="en"> <div class="refsect1" lang="en">
<a name="id2543477"></a><h2>DESCRIPTION</h2> <a name="id215159"></a><h2>DESCRIPTION</h2>
<p><span><strong class="command">dnssec-keygen</strong></span> <p><span><strong class="command">dnssec-keygen</strong></span>
generates keys for DNSSEC (Secure DNS), as defined in RFC 2535 generates keys for DNSSEC (Secure DNS), as defined in RFC 2535
and RFC 4034. It can also generate keys for use with and RFC 4034. It can also generate keys for use with
@ -40,7 +40,7 @@
</p> </p>
</div> </div>
<div class="refsect1" lang="en"> <div class="refsect1" lang="en">
<a name="id2543489"></a><h2>OPTIONS</h2> <a name="id215172"></a><h2>OPTIONS</h2>
<div class="variablelist"><dl> <div class="variablelist"><dl>
<dt><span class="term">-a <em class="replaceable"><code>algorithm</code></em></span></dt> <dt><span class="term">-a <em class="replaceable"><code>algorithm</code></em></span></dt>
<dd> <dd>
@ -48,7 +48,8 @@
Selects the cryptographic algorithm. The value of Selects the cryptographic algorithm. The value of
<code class="option">algorithm</code> must be one of RSAMD5 (RSA) or RSASHA1, <code class="option">algorithm</code> must be one of RSAMD5 (RSA) or RSASHA1,
DSA, NSEC3RSASHA1, NSEC3DSA, DH (Diffie Hellman), or HMAC-MD5. DSA, NSEC3RSASHA1, NSEC3DSA, DH (Diffie Hellman), or HMAC-MD5.
These values are case insensitive. These values are case insensitive. The default is RSASHA1 for
DNSSEC key generation.
</p> </p>
<p> <p>
Note 1: that for DNSSEC, RSASHA1 is a mandatory to implement Note 1: that for DNSSEC, RSASHA1 is a mandatory to implement
@ -60,15 +61,20 @@
</p> </p>
</dd> </dd>
<dt><span class="term">-b <em class="replaceable"><code>keysize</code></em></span></dt> <dt><span class="term">-b <em class="replaceable"><code>keysize</code></em></span></dt>
<dd><p> <dd>
<p>
Specifies the number of bits in the key. The choice of key Specifies the number of bits in the key. The choice of key
size depends on the algorithm used. RSAMD5 / RSASHA1 keys must be size depends on the algorithm used. RSAMD5 / RSASHA1 keys must be
between between 512 and 2048 bits. Diffie Hellman keys must be between
512 and 2048 bits. Diffie Hellman keys must be between
128 and 4096 bits. DSA keys must be between 512 and 1024 128 and 4096 bits. DSA keys must be between 512 and 1024
bits and an exact multiple of 64. HMAC-MD5 keys must be bits and an exact multiple of 64. HMAC-MD5 keys must be
between 1 and 512 bits. between 1 and 512 bits.
</p></dd> </p>
When generating a DNSSEC key with the default algorithm, this
value defaults to 1024, or 2048 if the KSK flag is set.
<p>
</p>
</dd>
<dt><span class="term">-n <em class="replaceable"><code>nametype</code></em></span></dt> <dt><span class="term">-n <em class="replaceable"><code>nametype</code></em></span></dt>
<dd><p> <dd><p>
Specifies the owner type of the key. The value of Specifies the owner type of the key. The value of
@ -148,7 +154,7 @@
</dl></div> </dl></div>
</div> </div>
<div class="refsect1" lang="en"> <div class="refsect1" lang="en">
<a name="id2543824"></a><h2>GENERATED KEYS</h2> <a name="id215469"></a><h2>GENERATED KEYS</h2>
<p> <p>
When <span><strong class="command">dnssec-keygen</strong></span> completes When <span><strong class="command">dnssec-keygen</strong></span> completes
successfully, successfully,
@ -194,7 +200,7 @@
</p> </p>
</div> </div>
<div class="refsect1" lang="en"> <div class="refsect1" lang="en">
<a name="id2543906"></a><h2>EXAMPLE</h2> <a name="id215557"></a><h2>EXAMPLE</h2>
<p> <p>
To generate a 768-bit DSA key for the domain To generate a 768-bit DSA key for the domain
<strong class="userinput"><code>example.com</code></strong>, the following command would be <strong class="userinput"><code>example.com</code></strong>, the following command would be
@ -215,7 +221,7 @@
</p> </p>
</div> </div>
<div class="refsect1" lang="en"> <div class="refsect1" lang="en">
<a name="id2543949"></a><h2>SEE ALSO</h2> <a name="id215599"></a><h2>SEE ALSO</h2>
<p><span class="citerefentry"><span class="refentrytitle">dnssec-signzone</span>(8)</span>, <p><span class="citerefentry"><span class="refentrytitle">dnssec-signzone</span>(8)</span>,
<em class="citetitle">BIND 9 Administrator Reference Manual</em>, <em class="citetitle">BIND 9 Administrator Reference Manual</em>,
<em class="citetitle">RFC 2539</em>, <em class="citetitle">RFC 2539</em>,
@ -224,7 +230,7 @@
</p> </p>
</div> </div>
<div class="refsect1" lang="en"> <div class="refsect1" lang="en">
<a name="id2544049"></a><h2>AUTHOR</h2> <a name="id215629"></a><h2>AUTHOR</h2>
<p><span class="corpauthor">Internet Systems Consortium</span> <p><span class="corpauthor">Internet Systems Consortium</span>
</p> </p>
</div> </div>

View File

@ -31,7 +31,7 @@
/*% /*%
* Principal Author: Brian Wellington * Principal Author: Brian Wellington
* $Id: dst_parse.c,v 1.16 2009/03/02 23:47:43 tbox Exp $ * $Id: dst_parse.c,v 1.17 2009/06/17 06:51:44 each Exp $
*/ */
#include <config.h> #include <config.h>
@ -498,6 +498,12 @@ dst__privstruct_writefile(const dst_key_t *key, const dst_private_t *priv,
case DST_ALG_HMACSHA512: case DST_ALG_HMACSHA512:
fprintf(fp, "(HMAC_SHA512)\n"); fprintf(fp, "(HMAC_SHA512)\n");
break; break;
case DST_ALG_NSEC3DSA:
fprintf(fp, "(NSEC3DSA)\n");
break;
case DST_ALG_NSEC3RSASHA1:
fprintf(fp, "(NSEC3RSASHA1)\n");
break;
default: default:
fprintf(fp, "(?)\n"); fprintf(fp, "(?)\n");
break; break;