signer.c revision 2b71493ae644557c48a906f889ef50127f418b17
501941f0b6cce74c2ff75b10aff3f230d5d37e4cEvan Hunt * Copyright (C) 1999, 2000 Internet Software Consortium.
501941f0b6cce74c2ff75b10aff3f230d5d37e4cEvan Hunt * Permission to use, copy, modify, and distribute this software for any
501941f0b6cce74c2ff75b10aff3f230d5d37e4cEvan Hunt * purpose with or without fee is hereby granted, provided that the above
501941f0b6cce74c2ff75b10aff3f230d5d37e4cEvan Hunt * copyright notice and this permission notice appear in all copies.
501941f0b6cce74c2ff75b10aff3f230d5d37e4cEvan Hunt * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
501941f0b6cce74c2ff75b10aff3f230d5d37e4cEvan Hunt * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
501941f0b6cce74c2ff75b10aff3f230d5d37e4cEvan Hunt * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
501941f0b6cce74c2ff75b10aff3f230d5d37e4cEvan Hunt * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
501941f0b6cce74c2ff75b10aff3f230d5d37e4cEvan Hunt * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
501941f0b6cce74c2ff75b10aff3f230d5d37e4cEvan Hunt * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
501941f0b6cce74c2ff75b10aff3f230d5d37e4cEvan Hunt * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
501941f0b6cce74c2ff75b10aff3f230d5d37e4cEvan Hunt#define is_zone_key(key) ((dst_key_flags(key) & DNS_KEYFLAG_OWNERMASK) \
501941f0b6cce74c2ff75b10aff3f230d5d37e4cEvan Huntstatic isc_stdtime_t starttime = 0, endtime = 0, now;
501941f0b6cce74c2ff75b10aff3f230d5d37e4cEvan Huntstatic int tryverify = 0;
501941f0b6cce74c2ff75b10aff3f230d5d37e4cEvan Huntstatic inline void
501941f0b6cce74c2ff75b10aff3f230d5d37e4cEvan Huntstatic inline void
isc_buffer_t b;
isc_region_t r;
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;
isc_buffer_t b;
isc_region_t r;
isc_buffer_used(&b, &r);
return (char *) r.base;
if (bit)
if (tryverify != 0) {
rdata);
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 inline 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);
static int warnwild = 0;
if (warnwild++ == 0)
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) {
dns_rdatatype_nxt, 0);
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) {
usage();
if (verbose > 0) {
== 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)