dnssec-signkey.c revision d566e8ea7b2f38bafd439ccf744cd41de14345a6
/*
* Portions Copyright (C) 2000, 2001 Internet Software Consortium.
* Portions Copyright (C) 1995-2000 by Network Associates, Inc.
*
* Permission to use, copy, modify, and 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 INTERNET SOFTWARE CONSORTIUM AND
* NETWORK ASSOCIATES DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
* SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE CONSORTIUM OR NETWORK
* ASSOCIATES 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: dnssec-signkey.c,v 1.48 2001/03/27 22:08:37 bwelling Exp $ */
#include <config.h>
#include <stdlib.h>
#include <isc/commandline.h>
#include <dns/fixedname.h>
#include <dns/rdataclass.h>
#include <dns/rdatalist.h>
#include <dns/rdataset.h>
#include <dns/rdatastruct.h>
#include "dnssectool.h"
const char *program = "dnssec-signkey";
int verbose;
#define BUFSIZE 2048
struct keynode {
};
static void
usage(void) {
"(from keyset)\n");
exit(0);
}
static void
if (result != ISC_R_SUCCESS)
continue;
if (!dst_key_iszonekey(key))
continue;
fatal("out of memory");
}
if (result != ISC_R_NOMORE)
fatal("failure traversing key list");
}
static dst_key_t *
{
}
}
fatal("signature generated by non-zone or missing key");
return (NULL);
}
int
int i, ch;
char tdomain[1025];
char *endp;
unsigned char *data;
char *randomfile = NULL;
isc_buffer_t b;
isc_region_t r;
unsigned int eflags;
{
switch (ch) {
case 'a':
break;
case 'c':
break;
case 's':
break;
case 'e':
break;
case 'p':
break;
case 'r':
break;
case 'v':
if (*endp != '\0')
fatal("verbose level must be numeric");
break;
case 'h':
default:
usage();
}
}
if (argc < 2)
usage();
if (result != ISC_R_SUCCESS)
} else
if (!pseudorandom)
if (result != ISC_R_SUCCESS)
fatal("could not initialize dst");
fatal("if -s or -e is specified, both must be");
if (result != ISC_R_SUCCESS)
isc_buffer_usedregion(&b, &r);
fatal("out of memory");
if (result != ISC_R_SUCCESS) {
char domainstr[DNS_NAME_FORMATSIZE];
fatal("failed to find database node '%s': %s",
}
0, &rdataset, &sigrdataset);
if (result != ISC_R_SUCCESS) {
char domainstr[DNS_NAME_FORMATSIZE];
fatal("failed to find rdataset '%s KEY': %s",
}
if (!dns_rdataset_isassociated(&sigrdataset))
fatal("no SIG KEY set present");
do {
if (result != ISC_R_SUCCESS) {
char keystr[KEY_FORMATSIZE];
fatal("signature by key '%s' did not verify: %s",
}
} while (result == ISC_R_SUCCESS);
} else {
}
fatal("Not all zone keys self signed the key set");
argc -= 1;
argv += 1;
for (i = 0; i < argc; i++) {
if (result != ISC_R_SUCCESS)
fatal("failed to read key %s from disk: %s",
fatal("out of memory");
fatal("out of memory");
if (result != ISC_R_SUCCESS) {
char keystr[KEY_FORMATSIZE];
fatal("key '%s' failed to sign data: %s",
}
if (tryverify) {
if (result != ISC_R_SUCCESS) {
char keystr[KEY_FORMATSIZE];
fatal("signature from key '%s' failed to "
"verify: %s",
}
}
dst_key_free(&key);
}
if (result != ISC_R_SUCCESS)
fatal("failed to write database to '%s': %s",
}
dns_db_detach(&db);
while (!ISC_LIST_EMPTY(keylist)) {
}
if (verbose > 10)
return (0);
}