dnssec-signkey.c revision b1d234eb75e2804e09d89178a76df39c321db51b
/*
* Copyright (C) 1999, 2000 Internet Software Consortium.
*
* 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 DISCLAIMS
* ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
* CONSORTIUM 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.
*/
#include <config.h>
#include <stdlib.h>
#include <isc/commandline.h>
#include <dns/rdatalist.h>
#include <dns/rdataset.h>
#include <dns/rdatastruct.h>
#include "dnssectool.h"
char *program = "dnssec-signkey";
int verbose;
#define BUFSIZE 2048
struct keynode {
};
static isc_stdtime_t now;
static void
usage(void) {
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;
isc_buffer_t b;
isc_region_t r;
{
switch (ch) {
case 'v':
if (*endp != '\0')
fatal("verbose level must be numeric");
break;
default:
usage();
}
}
if (argc < 2)
usage();
fatal("keyset file must end in .keyset");
if (result != ISC_R_SUCCESS)
isc_buffer_usedregion(&b, &r);
fatal("out of memory");
if (result != ISC_R_SUCCESS)
if (result != ISC_R_SUCCESS)
fatal("failed to find database node '%s': %s",
0, &rdataset, &sigrdataset);
if (result != ISC_R_SUCCESS)
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)
fatal("signature by key '%s/%s/%d' did not verify: %s",
} while (result == ISC_R_SUCCESS);
fatal("Not all zone keys self signed the key set");
argc -= 1;
argv += 1;
for (i = 0; i < argc; i++) {
int alg;
if (result != ISC_R_SUCCESS)
usage();
if (result != ISC_R_SUCCESS)
fatal("failed to read key %s/%s/%d from disk: %s",
fatal("out of memory");
fatal("out of memory");
if (result != ISC_R_SUCCESS)
fatal("key '%s/%s/%d' failed to sign data: %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)) {
}
return (0);
}