dnssec-signzone.c revision 201b17e55f32d0c92f5d0814713efc71ca11076a
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson * Copyright (C) 1999, 2000 Internet Software Consortium.
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson * Permission to use, copy, modify, and distribute this software for any
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson * purpose with or without fee is hereby granted, provided that the above
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson * copyright notice and this permission notice appear in all copies.
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson#define is_zone_key(key) ((dst_key_flags(key) & DNS_KEYFLAG_OWNERMASK) \
86b0285d7e65601645db4090d62ee6cb63abad6cAndreas Gustafssontypedef struct signer_key_struct signer_key_t;
86b0285d7e65601645db4090d62ee6cb63abad6cAndreas Gustafssontypedef struct signer_array_struct signer_array_t;
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafssonisc_stdtime_t starttime = 0, endtime = 0, now;
86b0285d7e65601645db4090d62ee6cb63abad6cAndreas Gustafssonstatic inline void
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafssonstatic inline void
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafssoncheck_result(isc_result_t result, char *message) {
86b0285d7e65601645db4090d62ee6cb63abad6cAndreas Gustafssonvbprintf(int level, const char *fmt, ...) {
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson/* Not thread-safe! */
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson isc_buffer_init(&b, data, sizeof(data), ISC_BUFFERTYPE_TEXT);
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson return (char *) r.base;
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson/* Not thread-safe! */
isc_buffer_used(&b, &r);
return (char *) r.base;
isc_buffer_t b;
isc_region_t r;
isc_buffer_used(&b, &r);
return (char *) r.base;
if (bit)
static inline isc_boolean_t
static inline isc_boolean_t
isc_buffer_t b;
static signer_key_t *
char *keyname;
return key;
return (NULL);
return key;
static isc_boolean_t
switch (result) {
case DNS_R_SUCCESS:
case DNS_R_NXDOMAIN:
case DNS_R_NXRDATASET:
return ISC_TRUE;
case DNS_R_DELEGATION:
case DNS_R_CNAME:
case DNS_R_DNAME:
return ISC_FALSE;
static isc_boolean_t
#define allocbufferandrdata \
isc_buffer_t b; \
if (!nosigs) {
if (!expired)
if (!expired &&
if (!expired &&
else if (!expired) {
if (keep) {
&sig, &b);
else if (resign) {
if (wassignedby[i] != 0) {
0, NULL);
else if (!nosigs) {
static isc_boolean_t
return (ISC_TRUE);
return (ISC_FALSE);
if (!atorigin) {
NULL);
goto skip;
goto skip;
if (isdelegation) {
case dns_rdatatype_nxt:
case dns_rdatatype_key:
goto skip;
goto skip;
unsigned char *nxt_bits;
skip:
static inline isc_boolean_t
if (!active)
if (!active) {
return (active);
static inline isc_result_t
if (!active) {
return (result);
static inline isc_result_t
return (ISC_R_SUCCESS);
return (result);
lastcut);
if (!atorigin) {
0, &rdsiter);
sizeof(dns_name_t));
int len;
unsigned int nkeys, i;
for (i = 0; i < nkeys; i++) {
static isc_stdtime_t
usage() {
exit(0);
int i, ch;
char *endp;
switch (ch) {
== ISC_R_SUCCESS);
usage();
if (argc == 0) {
for (i = 0; i < argc; i++) {
*algstr++ = 0;
if (s != NULL) {
algstr = s;
alg = 0;
if (alg == 0)