dnssectool.c revision 9c3531d72aeaad6c5f01efe6a1c82023e1379e4d
/*
* Copyright (C) 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.
*/
/* $Id: dnssectool.c,v 1.12 2000/06/22 21:49:05 tale Exp $ */
#include <config.h>
#include <stdlib.h>
#include <isc/keyboard.h>
#include <dns/rdatatype.h>
#include "dnssectool.h"
extern int verbose;
extern const char *program;
static isc_keyboard_t kbd;
void
exit(1);
}
void
if (result != ISC_R_SUCCESS) {
exit(1);
}
}
void
return;
}
char *
isc_buffer_t b;
isc_region_t r;
static char data[1025];
isc_buffer_usedregion(&b, &r);
return (char *) r.base;
}
char *
isc_buffer_t b;
isc_region_t r;
static char data[20];
isc_buffer_usedregion(&b, &r);
return (char *) r.base;
}
char *
isc_buffer_t b;
isc_region_t r;
static char data[10];
isc_buffer_usedregion(&b, &r);
return ((char *)r.base);
}
void
int level;
switch (verbose) {
case 0:
/*
* We want to see warnings about things like out-of-zone
* data in the master file even when not verbose.
*/
break;
case 1:
break;
default:
break;
}
/*
* Set up a channel similar to default_stderr except:
* - the logging level is passed in
* - the program name and logging level are printed
* - no time stamp is printed
*/
}
static isc_result_t
if (!blocking)
return (ISC_R_NOENTROPY);
if (first) {
if (!wantkeyboard) {
"entropy, since your system is lacking\n");
}
}
return (isc_keyboard_open(kbd));
}
static void
}
static isc_result_t
isc_time_t t;
unsigned char c;
if (!blocking)
return (ISC_R_NOENTROPY);
if (result != ISC_R_SUCCESS)
return (result);
result = isc_time_now(&t);
if (result != ISC_R_SUCCESS)
return (result);
sample = isc_time_nanoseconds(&t);
extra = c;
if (result != ISC_R_SUCCESS) {
return (result);
}
return (result);
}
void
if (result != ISC_R_SUCCESS)
fatal("could not create entropy object");
if (result != ISC_R_SUCCESS)
}
else {
if (randomfile == NULL) {
if (result == ISC_R_SUCCESS)
return;
}
else
if (result != ISC_R_SUCCESS)
fatal("failed to open keyboard: %s\n",
}
}
void
}