signer.c revision a15583c68146644225dc1c1c5279c63db4685265
499b34cea04a46823d003d4c0520c8b03e8513cbBrian Wellington * Copyright (C) 1999, 2000 Internet Software Consortium.
7270737ca9bfa3c5f067e6377068aa597687d094Bob Halley * Permission to use, copy, modify, and distribute this software for any
7270737ca9bfa3c5f067e6377068aa597687d094Bob Halley * purpose with or without fee is hereby granted, provided that the above
7270737ca9bfa3c5f067e6377068aa597687d094Bob Halley * copyright notice and this permission notice appear in all copies.
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
struct signer_key_struct {
struct signer_array_struct {
static int verbose;
static int tryverify = 0;
isc_buffer_t b;
isc_region_t r;
isc_buffer_usedregion(&b, &r);
return (char *) r.base;
isc_buffer_t b;
isc_region_t r;
isc_buffer_usedregion(&b, &r);
return (char *) r.base;
isc_buffer_t b;
isc_region_t r;
isc_buffer_usedregion(&b, &r);
return (char *) r.base;
if (bit)
if (tryverify != 0) {
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 ISC_R_SUCCESS:
case DNS_R_NXDOMAIN:
case DNS_R_NXRRSET:
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)