summaryrefslogtreecommitdiff
path: root/bin/dnssec
diff options
context:
space:
mode:
authorInternet Software Consortium, Inc <@isc.org>2007-09-07 14:13:44 -0600
committerLaMont Jones <lamont@debian.org>2007-09-07 14:13:44 -0600
commitefa7b3eaa60cbaa0daf55af6dbbe218fc230222d (patch)
treea32af84a5e267d5715ca50b23766c666d0bcf2d9 /bin/dnssec
parentb62706a673dc58ca390b47342036e3f3206a14bc (diff)
downloadbind9-efa7b3eaa60cbaa0daf55af6dbbe218fc230222d.tar.gz
9.2.0a3
Diffstat (limited to 'bin/dnssec')
-rw-r--r--bin/dnssec/dnssec-keygen.c4
-rw-r--r--bin/dnssec/dnssectool.c101
2 files changed, 7 insertions, 98 deletions
diff --git a/bin/dnssec/dnssec-keygen.c b/bin/dnssec/dnssec-keygen.c
index 8a2d2e1a..3306460a 100644
--- a/bin/dnssec/dnssec-keygen.c
+++ b/bin/dnssec/dnssec-keygen.c
@@ -17,7 +17,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: dnssec-keygen.c,v 1.47 2001/02/15 23:26:29 bwelling Exp $ */
+/* $Id: dnssec-keygen.c,v 1.48 2001/07/10 18:53:09 bwelling Exp $ */
#include <config.h>
@@ -217,8 +217,6 @@ main(int argc, char **argv) {
if (ret != ISC_R_SUCCESS)
fatal("unknown algorithm %s", algname);
}
- if (dst_algorithm_supported(alg) == ISC_FALSE)
- fatal("unsupported algorithm %s", algname);
if (type != NULL) {
if (strcasecmp(type, "NOAUTH") == 0)
diff --git a/bin/dnssec/dnssectool.c b/bin/dnssec/dnssectool.c
index f368e8dd..ab271da7 100644
--- a/bin/dnssec/dnssectool.c
+++ b/bin/dnssec/dnssectool.c
@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: dnssectool.c,v 1.29 2001/06/08 22:07:16 tale Exp $ */
+/* $Id: dnssectool.c,v 1.30 2001/06/22 17:05:54 tale Exp $ */
#include <config.h>
@@ -43,8 +43,6 @@ extern int verbose;
extern const char *program;
static isc_entropysource_t *source = NULL;
-static isc_keyboard_t kbd;
-static isc_boolean_t wantkeyboard = ISC_FALSE;
static fatalcallback_t *fatalcallback = NULL;
void
@@ -201,73 +199,6 @@ cleanup_logging(isc_log_t **logp) {
logp = NULL;
}
-static isc_result_t
-kbdstart(isc_entropysource_t *source, void *arg, isc_boolean_t blocking) {
- isc_keyboard_t *kbd = (isc_keyboard_t *)arg;
- static isc_boolean_t first = ISC_TRUE;
-
- UNUSED(source);
-
- if (!blocking)
- return (ISC_R_NOENTROPY);
- if (first) {
- if (!wantkeyboard) {
- fprintf(stderr, "You must use the keyboard to create "
- "entropy, since your system is lacking\n");
- fprintf(stderr, "/dev/random (or equivalent)\n\n");
- }
- first = ISC_FALSE;
- }
- fprintf(stderr, "start typing:\n");
- return (isc_keyboard_open(kbd));
-}
-
-static void
-kbdstop(isc_entropysource_t *source, void *arg) {
- isc_keyboard_t *kbd = (isc_keyboard_t *)arg;
-
- UNUSED(source);
-
- if (!isc_keyboard_canceled(kbd))
- fprintf(stderr, "stop typing.\r\n");
- (void)isc_keyboard_close(kbd, 3);
-}
-
-static isc_result_t
-kbdget(isc_entropysource_t *source, void *arg, isc_boolean_t blocking) {
- isc_keyboard_t *kbd = (isc_keyboard_t *)arg;
- isc_result_t result;
- isc_time_t t;
- isc_uint32_t sample;
- isc_uint32_t extra;
- unsigned char c;
-
- if (!blocking)
- return (ISC_R_NOTBLOCKING);
-
- result = isc_keyboard_getchar(kbd, &c);
- 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;
-
- result = isc_entropy_addcallbacksample(source, sample, extra);
- if (result != ISC_R_SUCCESS) {
- fprintf(stderr, "\r\n");
- return (result);
- }
-
- fprintf(stderr, ".");
- fflush(stderr);
-
- return (result);
-}
-
void
setup_entropy(isc_mem_t *mctx, const char *randomfile, isc_entropy_t **ectx) {
isc_result_t result;
@@ -276,32 +207,12 @@ setup_entropy(isc_mem_t *mctx, const char *randomfile, isc_entropy_t **ectx) {
if (result != ISC_R_SUCCESS)
fatal("could not create entropy object");
-#ifdef PATH_RANDOMDEV
- if (randomfile == NULL) {
- result = isc_entropy_createfilesource(*ectx, PATH_RANDOMDEV);
- if (result == ISC_R_SUCCESS)
- return;
- }
-#endif
+ result = isc_entropy_usebestsource(*ectx, &source, randomfile,
+ ISC_ENTROPY_KEYBOARDMAYBE);
- if (randomfile != NULL && strcasecmp(randomfile, "keyboard") == 0) {
- wantkeyboard = ISC_TRUE;
- randomfile = NULL;
- }
-
- if (randomfile != NULL) {
- result = isc_entropy_createfilesource(*ectx, randomfile);
- if (result != ISC_R_SUCCESS)
- fatal("could not open randomdev %s: %s", randomfile,
- isc_result_totext(result));
- } else {
- result = isc_entropy_createcallbacksource(*ectx, kbdstart,
- kbdget, kbdstop,
- &kbd, &source);
- if (result != ISC_R_SUCCESS)
- fatal("failed to open keyboard: %s\n",
- isc_result_totext(result));
- }
+ if (result != ISC_R_SUCCESS)
+ fatal("could not initialize entropy source: %s",
+ isc_result_totext(result));
}
void