1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-02 22:46:30 +02:00

See ChangeLog: Tue Jun 1 16:01:46 CEST 1999 Werner Koch

This commit is contained in:
Werner Koch 1999-06-01 14:08:57 +00:00
parent c34c676958
commit 3dddf602dd
19 changed files with 272 additions and 71 deletions

View file

@ -33,6 +33,13 @@
#include <string.h>
#include <unistd.h>
#include <fcntl.h>
#if 0
#ifdef HAVE_LINUX_RANDOM_H
#include <sys/ioctl.h>
#include <asm/types.h>
#include <linux/random.h>
#endif
#endif
#include "types.h"
#include "util.h"
#include "ttyio.h"
@ -48,6 +55,19 @@ static int open_device( const char *name, int minor );
static int gather_random( void (*add)(const void*, size_t, int), int requester,
size_t length, int level );
#if 0
#ifdef HAVE_DEV_RANDOM_IOCTL
static ulong
get_entropy_count( int fd )
{
ulong count;
if( ioctl( fd, RNDGETENTCNT, &count ) == -1 )
g10_log_fatal("ioctl(RNDGETENTCNT) failed: %s\n", strerror(errno) );
return count;
}
#endif
#endif
/****************
* Used to open the Linux and xBSD /dev/random devices
@ -91,6 +111,11 @@ gather_random( void (*add)(const void*, size_t, int), int requester,
fd = fd_urandom;
}
#if 0
#ifdef HAVE_DEV_RANDOM_IOCTL
g10_log_info("entropy count of %d is %lu\n", fd, get_entropy_count(fd) );
#endif
#endif
while( length ) {
fd_set rfds;
struct timeval tv;