2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-30 22:15:20 +00:00

--with-randomdev sets HAVE_RANDOMDEV, use that instead of /dev/random.

This commit is contained in:
Brian Wellington
2000-08-17 18:56:49 +00:00
parent 708c4ac042
commit a14613fce9
9 changed files with 319 additions and 214 deletions

View File

@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/ */
/* $Id: acconfig.h,v 1.25 2000/08/01 01:10:56 tale Exp $ */ /* $Id: acconfig.h,v 1.26 2000/08/17 18:56:38 bwelling Exp $ */
/*** /***
*** This file is not to be included by any public header files, because *** This file is not to be included by any public header files, because
@@ -102,3 +102,6 @@ int sigwait(const unsigned int *set, int *sig);
ap = (va_list)(_u.var + __va_words(__typeof(last))); \ ap = (va_list)(_u.var + __va_words(__typeof(last))); \
} while (0) } while (0)
#endif /* SHUTUP_STDARG_CAST && __GNUC__ */ #endif /* SHUTUP_STDARG_CAST && __GNUC__ */
/* define if the system has a random number generating device */
#undef HAVE_RANDOMDEV

View File

@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/ */
/* $Id: dnssectool.c,v 1.18 2000/08/17 01:22:10 gson Exp $ */ /* $Id: dnssectool.c,v 1.19 2000/08/17 18:56:44 bwelling Exp $ */
#include <config.h> #include <config.h>
@@ -190,7 +190,7 @@ kbdstart(isc_entropysource_t *source, void *arg, isc_boolean_t blocking) {
if (!wantkeyboard) { if (!wantkeyboard) {
fprintf(stderr, "You must use the keyboard to create " fprintf(stderr, "You must use the keyboard to create "
"entropy, since your system is lacking\n"); "entropy, since your system is lacking\n");
fprintf(stderr, "/dev/random\n\n"); fprintf(stderr, "/dev/random (or equivalent)\n\n");
} }
first = ISC_FALSE; first = ISC_FALSE;
} }
@@ -258,13 +258,15 @@ setup_entropy(isc_mem_t *mctx, const char *randomfile, isc_entropy_t **ectx) {
isc_result_totext(result)); isc_result_totext(result));
} }
else { else {
#ifdef HAVE_RANDOMDEV
if (randomfile == NULL) { if (randomfile == NULL) {
result = isc_entropy_createfilesource(*ectx, result = isc_entropy_createfilesource(*ectx,
"/dev/random"); HAVE_RANDOMDEV);
if (result == ISC_R_SUCCESS) if (result == ISC_R_SUCCESS)
return; return;
} }
else else
#endif
wantkeyboard = ISC_TRUE; wantkeyboard = ISC_TRUE;
result = isc_entropy_createcallbacksource(*ectx, kbdstart, result = isc_entropy_createcallbacksource(*ectx, kbdstart,
kbdget, kbdstop, kbdget, kbdstop,

View File

@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/ */
/* $Id: main.c,v 1.79 2000/08/17 01:30:31 gson Exp $ */ /* $Id: main.c,v 1.80 2000/08/17 18:56:45 bwelling Exp $ */
#include <config.h> #include <config.h>
@@ -425,7 +425,9 @@ create_managers(void) {
return (ISC_R_UNEXPECTED); return (ISC_R_UNEXPECTED);
} }
(void)isc_entropy_createfilesource(ns_g_entropy, "/dev/random"); #ifdef HAVE_RANDOMDEV
(void)isc_entropy_createfilesource(ns_g_entropy, HAVE_RANDOMDEV);
#endif
return (ISC_R_SUCCESS); return (ISC_R_SUCCESS);
} }

View File

@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/ */
/* $Id: dst_test.c,v 1.30 2000/08/01 01:13:40 tale Exp $ */ /* $Id: dst_test.c,v 1.31 2000/08/17 18:56:48 bwelling Exp $ */
#include <config.h> #include <config.h>
@@ -243,7 +243,9 @@ main(void) {
dns_result_register(); dns_result_register();
isc_entropy_create(mctx, &ectx); isc_entropy_create(mctx, &ectx);
isc_entropy_createfilesource(ectx, "/dev/random"); #ifdef HAVE_RANDOMDEV
isc_entropy_createfilesource(ectx, HAVE_RANDOMDEV);
#endif
isc_entropy_createfilesource(ectx, "randomfile"); isc_entropy_createfilesource(ectx, "randomfile");
dst_lib_init(mctx, ectx, ISC_ENTROPY_BLOCKING|ISC_ENTROPY_GOODONLY); dst_lib_init(mctx, ectx, ISC_ENTROPY_BLOCKING|ISC_ENTROPY_GOODONLY);

View File

@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/ */
/* $Id: t_dst.c,v 1.36 2000/08/01 01:13:41 tale Exp $ */ /* $Id: t_dst.c,v 1.37 2000/08/17 18:56:49 bwelling Exp $ */
#include <config.h> #include <config.h>
@@ -370,7 +370,9 @@ t1(void) {
t_result(T_UNRESOLVED); t_result(T_UNRESOLVED);
return; return;
} }
isc_entropy_createfilesource(ectx, "/dev/random"); #ifdef HAVE_RANDOMDEV
isc_entropy_createfilesource(ectx, HAVE_RANDOMDEV);
#endif
result = isc_entropy_createfilesource(ectx, "randomfile"); result = isc_entropy_createfilesource(ectx, "randomfile");
if (isc_result != ISC_R_SUCCESS) { if (isc_result != ISC_R_SUCCESS) {
t_info("isc_entropy_create failed %d\n", t_info("isc_entropy_create failed %d\n",
@@ -844,7 +846,9 @@ t2_vfy(char **av) {
isc_result_totext(isc_result)); isc_result_totext(isc_result));
return(T_UNRESOLVED); return(T_UNRESOLVED);
} }
isc_entropy_createfilesource(ectx, "/dev/random"); #ifdef HAVE_RANDOMDEV
isc_entropy_createfilesource(ectx, HAVE_RANDOMDEV);
#endif
result = isc_entropy_createfilesource(ectx, "randomfile"); result = isc_entropy_createfilesource(ectx, "randomfile");
if (isc_result != ISC_R_SUCCESS) { if (isc_result != ISC_R_SUCCESS) {
t_info("isc_entropy_create failed %d\n", t_info("isc_entropy_create failed %d\n",

View File

@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/ */
/* $Id: tkey_test.c,v 1.29 2000/08/01 01:13:27 tale Exp $ */ /* $Id: tkey_test.c,v 1.30 2000/08/17 18:56:46 bwelling Exp $ */
/* /*
* Principal Author: Brian Wellington (core copied from res_test.c) * Principal Author: Brian Wellington (core copied from res_test.c)
@@ -375,10 +375,14 @@ main(int argc, char *argv[]) {
ectx = NULL; ectx = NULL;
RUNTIME_CHECK(isc_entropy_create(mctx, &ectx) == ISC_R_SUCCESS); RUNTIME_CHECK(isc_entropy_create(mctx, &ectx) == ISC_R_SUCCESS);
result = isc_entropy_createfilesource(ectx, "/dev/random"); #ifdef HAVE_RANDOMDEV
result = isc_entropy_createfilesource(ectx, HAVE_RANDOMDEV);
#else
result = ISC_R_NOTFOUND;
#endif
if (result != ISC_R_SUCCESS) { if (result != ISC_R_SUCCESS) {
fprintf(stderr, fprintf(stderr,
"%s only runs when /dev/random is available.\n", "%s only runs when a random device is available.\n",
argv[0]); argv[0]);
exit(-1); exit(-1);
} }

View File

@@ -6,16 +6,18 @@
* purpose with or without fee is hereby granted, provided that the above * purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies. * copyright notice and this permission notice appear in all copies.
* *
* THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
* ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
* OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
* CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL * INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
* ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
* SOFTWARE. * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/ */
/* $Id: config.h.in,v 1.35 2000/08/17 18:56:39 bwelling Exp $ */
/*** /***
*** This file is not to be included by any public header files, because *** This file is not to be included by any public header files, because
*** it does not get installed. *** it does not get installed.
@@ -112,6 +114,9 @@ int sigwait(const unsigned int *set, int *sig);
} while (0) } while (0)
#endif /* SHUTUP_STDARG_CAST && __GNUC__ */ #endif /* SHUTUP_STDARG_CAST && __GNUC__ */
/* define if the system has a random number generating device */
#undef HAVE_RANDOMDEV
/* Define if you have the <fcntl.h> header file. */ /* Define if you have the <fcntl.h> header file. */
#undef HAVE_FCNTL_H #undef HAVE_FCNTL_H

430
configure vendored

File diff suppressed because it is too large Load Diff

View File

@@ -18,7 +18,7 @@ AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)dnl
esyscmd([sed "s/^/# /" COPYRIGHT])dnl esyscmd([sed "s/^/# /" COPYRIGHT])dnl
AC_DIVERT_POP()dnl AC_DIVERT_POP()dnl
AC_REVISION($Revision: 1.176 $) AC_REVISION($Revision: 1.177 $)
AC_INIT(lib/dns/name.c) AC_INIT(lib/dns/name.c)
AC_PREREQ(2.13) AC_PREREQ(2.13)
@@ -242,7 +242,7 @@ case "$use_gssapi" in
USE_GSSAPI='' USE_GSSAPI=''
DST_GSSAPI_INC='' DST_GSSAPI_INC=''
DNS_GSSAPI_LIBS='' DNS_GSSAPI_LIBS=''
AC_MSG_RESULT(none found) AC_MSG_RESULT(not specified)
;; ;;
yes) yes)
AC_MSG_ERROR([--with-gssapi must specify a path]) AC_MSG_ERROR([--with-gssapi must specify a path])
@@ -259,6 +259,39 @@ AC_SUBST(USE_GSSAPI)
AC_SUBST(DST_GSSAPI_INC) AC_SUBST(DST_GSSAPI_INC)
AC_SUBST(DNS_GSSAPI_LIBS) AC_SUBST(DNS_GSSAPI_LIBS)
#
# was --with-randomdev specified?
#
AC_MSG_CHECKING(for random device)
AC_ARG_WITH(randomdev,
[ --with-randomdev=PATH Specify path for random device],
use_randomdev="$withval", use_randomdev="unspec")
case "$use_randomdev" in
unspec)
case "$host" in
*-openbsd*)
AC_DEFINE(HAVE_RANDOMDEV, "/dev/srandom")
AC_MSG_RESULT(using /dev/srandom)
;;
*-linux*|*-freebsd*|*-netbsd*)
AC_DEFINE(HAVE_RANDOMDEV, "/dev/random")
AC_MSG_RESULT(using /dev/random)
;;
*)
AC_MSG_RESULT(not found)
;;
esac
;;
yes)
AC_MSG_ERROR([--with-randomdev must specify a path])
;;
*)
AC_DEFINE_UNQUOTED(HAVE_RANDOMDEV, "$use_randomdev")
AC_MSG_RESULT(using "$use_randomdev")
;;
esac
# #
# NetBSD has multiple pthreads implementations. The recommended # NetBSD has multiple pthreads implementations. The recommended
# one to use is "unproven-pthreads". The older "mit-pthreads" # one to use is "unproven-pthreads". The older "mit-pthreads"