dnssec-signzone.c revision 3d452d43660bf364910d664df5329609062e9b1a
#include <config.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <isc/assertions.h>
#include <dns/fixedname.h>
#include <dns/dbiterator.h>
#include <dns/rdatalist.h>
#include <dns/rdataset.h>
#include <dns/rdatasetiter.h>
#include <dns/rdatastruct.h>
#include <dns/keyvalues.h>
#define MAXKEYS 10
static inline void
exit(1);
}
static inline void
if (result != ISC_R_SUCCESS) {
exit(1);
}
}
static void
if (bit)
else
}
static void
{
isc_buffer_t b;
isc_region_t r;
}
void
{
int i;
/*
* Is this an immaterial key? This should also check that it's not
* a non-zone key at the origin.
*/
isc_buffer_t b;
printf("saving old key...\n");
dns_rdatatype_sig, &sig, &b);
}
else {
for (i = 0; i < nkeys; i++) {
break;
}
if (i < nkeys)
else
printf("couldn't find key\n");
}
}
static void
int nkeys)
{
int i;
while (result == ISC_R_SUCCESS) {
{
continue;
}
if (result == ISC_R_SUCCESS)
else if (result == ISC_R_NOTFOUND) {
}
else
/*
* There probably should be a dns_nxtsetbit or something,
* but it can get complicated if we need to extend the
* length. In this case, since the NXT bit is set and
* SIG < NXT, the easy way works.
*/
unsigned char *nxt_bits;
isc_region_t r, r2;
dns_rdata_toregion(&rdata, &r);
dns_name_fromregion(&nxtname, &r);
}
if (!alreadysigned) {
for (i = 0; i < nkeys; i++) {
if (!defaultkey[i])
continue;
sizeof(array[i]));
}
}
else {
i = 0;
while (result == ISC_R_SUCCESS) {
&sigrdatalist, &sigrdata,
sizeof(array[i]));
i++;
}
}
if (result == DNS_R_UNCHANGED)
}
if (result != DNS_R_NOMORE)
fatal("rdataset iteration failed");
}
static inline isc_boolean_t
while (result == ISC_R_SUCCESS) {
if (!active)
else
}
if (result != DNS_R_NOMORE)
fatal("rdataset iteration failed");
if (!active) {
/*
* Make sure there is no NXT record for this node.
*/
if (result == DNS_R_UNCHANGED)
}
return (active);
}
static inline isc_result_t
{
do {
if (result == ISC_R_SUCCESS) {
if (!active) {
}
}
return (result);
}
static void
char *origintext;
isc_buffer_t b;
char newfilename[1024];
unsigned char curdata[1024];
unsigned int nkeys = 0;
unsigned int i;
if (origintext == NULL)
else
origintext++; /* Skip '/'. */
isc_buffer_add(&b, len);
for (i = 0; i < nkeys; i++)
defaultkey[i] = ISC_TRUE;
while (result == ISC_R_SUCCESS) {
if (result == ISC_R_SUCCESS)
&nextnode);
if (result == ISC_R_SUCCESS)
else if (result == DNS_R_NOMORE)
else {
fatal("db iteration failed");
}
nkeys);
}
if (result != DNS_R_NOMORE)
fatal("db iteration failed");
/*
* XXXRTH For now, we don't increment the SOA serial.
*/
fatal("filename too long");
dns_db_detach(&db);
for (i = 0; i < nkeys; i++)
dst_key_free(keys[i]);
}
int
int i;
argc--;
argv++;
for (i = 0; i < argc; i++)
return (0);
}