# HG changeset patch # User Matt Johnston # Date 1154711705 0 # Node ID 959c66ccf1b5e6cee44f41f9ff88feb2f7ebe37e # Parent bf29e6659fb9994eed08801b96f825efe5179e17 Remove actual randomness, to (hopefully) allow comparison between hosts diff -r bf29e6659fb9 -r 959c66ccf1b5 random.c --- a/random.c Thu Jul 27 01:24:39 2006 +0000 +++ b/random.c Fri Aug 04 17:15:05 2006 +0000 @@ -93,35 +93,6 @@ #endif /* read the actual random data */ - readpos = 0; - do { - if (!already_blocked) - { - int ret; - struct timeval timeout; - fd_set read_fds; - - timeout.tv_sec = 2; /* two seconds should be enough */ - timeout.tv_usec = 0; - - FD_ZERO(&read_fds); - FD_SET(readfd, &read_fds); - ret = select(readfd + 1, &read_fds, NULL, NULL, &timeout); - if (ret == 0) - { - dropbear_log(LOG_INFO, "Warning: Reading the random source seems to have blocked.\nIf you experience problems, you probably need to find a better entropy source."); - already_blocked = 1; - } - } - readlen = read(readfd, &buf[readpos], buflen - readpos); - if (readlen <= 0) { - if (readlen < 0 && errno == EINTR) { - continue; - } - dropbear_exit("error reading random source"); - } - readpos += readlen; - } while (readpos < buflen); close (readfd); } @@ -157,21 +128,14 @@ * the random pools for fork()ed processes. */ void reseedrandom() { - pid_t pid; hash_state hs; - struct timeval tv; if (!donerandinit) { dropbear_exit("seedrandom not done"); } - pid = getpid(); - gettimeofday(&tv, NULL); - sha1_init(&hs); sha1_process(&hs, (void*)hashpool, sizeof(hashpool)); - sha1_process(&hs, (void*)&pid, sizeof(pid)); - sha1_process(&hs, (void*)&tv, sizeof(tv)); sha1_done(&hs, hashpool); }