summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKen Raeburn <raeburn@mit.edu>2002-06-19 21:05:24 +0000
committerKen Raeburn <raeburn@mit.edu>2002-06-19 21:05:24 +0000
commitde334e293a979d84710c6d6eea92bf6b72844cc0 (patch)
tree2d591cb8834c60c4947e1b40f90b637d669b24e1 /src
parentbb0505f17bd565d93cc0a43eb40ea6ecac8a912c (diff)
downloadkrb5-de334e293a979d84710c6d6eea92bf6b72844cc0.tar.gz
krb5-de334e293a979d84710c6d6eea92bf6b72844cc0.tar.xz
krb5-de334e293a979d84710c6d6eea92bf6b72844cc0.zip
* init_os_ctx.c: Don't include sys/ioctl.h or sys/filio.h.
(krb5_os_init_context): Drop /dev/[u]random support, the Yarrow code will deal with that now. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@14543 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src')
-rw-r--r--src/lib/krb5/os/ChangeLog6
-rw-r--r--src/lib/krb5/os/init_os_ctx.c46
2 files changed, 6 insertions, 46 deletions
diff --git a/src/lib/krb5/os/ChangeLog b/src/lib/krb5/os/ChangeLog
index e47f7e44e..338478294 100644
--- a/src/lib/krb5/os/ChangeLog
+++ b/src/lib/krb5/os/ChangeLog
@@ -1,3 +1,9 @@
+2002-06-19 Ken Raeburn <raeburn@mit.edu>
+
+ * init_os_ctx.c: Don't include sys/ioctl.h or sys/filio.h.
+ (krb5_os_init_context): Drop /dev/[u]random support, the Yarrow
+ code will deal with that now.
+
2002-06-18 Danilo Almeida <dalmeida@mit.edu>
* toffset.c (krb5_get_time_offsets), an_to_ln.c
diff --git a/src/lib/krb5/os/init_os_ctx.c b/src/lib/krb5/os/init_os_ctx.c
index 7939cbaa1..ceefb73db 100644
--- a/src/lib/krb5/os/init_os_ctx.c
+++ b/src/lib/krb5/os/init_os_ctx.c
@@ -34,14 +34,6 @@
#include <PreferencesLib.h>
#endif /* macintosh */
-#if !defined(macintosh) && !defined(_WIN32)
-#define USE_RANDOM_DEVICE
-#include <sys/ioctl.h> /* for FIONBIO */
-#ifdef HAVE_SYS_FILIO_H
-#include <sys/filio.h> /* Solaris needs this */
-#endif
-#endif
-
#if defined(_WIN32)
static krb5_error_code
@@ -452,44 +444,6 @@ krb5_os_init_context(ctx)
os_ctx->default_ccname = 0;
os_ctx->default_ccprincipal = 0;
-#ifdef USE_RANDOM_DEVICE
- /* If the OS provides us with random or even pseudorandom
- data, use it. It'll be far better than what we've got
- above, but not all systems provide it (yet).
-
- Typical setup seems to be /dev/urandom is pseudo-random, as
- good as the system can provide, but never blocking;
- /dev/random is supposedly truly random (the metrics are
- sometimes suspect), and may block. */
- {
- char rndbytes[128];
- krb5_data seed;
- int tmp;
-
- tmp = open ("/dev/urandom", O_RDONLY);
- if (tmp == -1) {
- int dontblock = 1;
- tmp = open ("/dev/random", O_RDONLY);
- if (tmp != -1)
- (void) ioctl (tmp, FIONBIO,
- (char *) &dontblock);
- }
- if (tmp != -1) {
- /* If this doesn't work, should we continue or
- report an error that'll cause all Kerberos
- programs to fail? */
- (void) read (tmp, &rndbytes, sizeof (rndbytes));
- close (tmp);
- }
- /* Okay. Take whatever we've got, and seed the
- PRNG. */
- seed.length = sizeof(rndbytes);
- seed.data = (char *) &rndbytes;
- if ((retval = krb5_c_random_seed(ctx, &seed)))
- return retval;
- }
-#endif
-
krb5_cc_set_default_name(ctx, NULL);
retval = os_init_paths(ctx);