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

See ChangeLog: Fri Aug 25 16:05:38 CEST 2000 Werner Koch

This commit is contained in:
Werner Koch 2000-08-25 14:00:15 +00:00
parent 1d01573b78
commit 74b7fe6a7e
14 changed files with 100 additions and 16 deletions

View file

@ -1,3 +1,10 @@
Fri Aug 25 16:05:38 CEST 2000 Werner Koch <wk@openit.de>
* rndlinux.c (open_device): Loose random device checking.
By Nils Ellmenreich.
* rndegd.c (gather_random): Name of socket is nom configurable.
Wed Jun 28 11:54:44 CEST 2000 Werner Koch <wk@>
* rsa.c, rsa.h: New based on the old module version (only in CVS for now).

View file

@ -114,13 +114,28 @@ gather_random( void (*add)(const void*, size_t, int), int requester,
}
}
if( fd == -1 ) {
char *name = make_filename( g10_opt_homedir, "entropy", NULL );
const char *bname = NULL;
char *name;
struct sockaddr_un addr;
int addr_len;
#ifdef EGD_SOCKET_NAME
bname = EGD_SOCKET_NAME;
#endif
if ( !bname || !*bname )
bname = "entropy";
if ( *bname == '=' && bname[1] )
name = make_filename( g10_opt_homedir, bname+1 , NULL );
else
name = make_filename( bname , NULL );
if ( strlen(name)+1 >= sizeof addr.sun_path )
g10_log_fatal ("EGD socketname is too long\n");
memset( &addr, 0, sizeof addr );
addr.sun_family = AF_UNIX;
strcpy( addr.sun_path, name ); /* fixme: check that it is long enough */
strcpy( addr.sun_path, name );
addr_len = offsetof( struct sockaddr_un, sun_path )
+ strlen( addr.sun_path );

View file

@ -70,7 +70,7 @@ get_entropy_count( int fd )
#endif
/****************
* Used to open the Linux and xBSD /dev/random devices
* Used to open the /dev/random devices (Linux, xBSD, Solaris (if it exists), ...)
*/
static int
open_device( const char *name, int minor )
@ -83,8 +83,9 @@ open_device( const char *name, int minor )
g10_log_fatal("can't open %s: %s\n", name, strerror(errno) );
if( fstat( fd, &sb ) )
g10_log_fatal("stat() off %s failed: %s\n", name, strerror(errno) );
if( !S_ISCHR(sb.st_mode) )
g10_log_fatal("invalid random device!\n" );
/* Don't check device type for better portability */
/* if( (!S_ISCHR(sb.st_mode)) && (!S_ISFIFO(sb.st_mode)) )
g10_log_fatal("invalid random device!\n" ); */
return fd;
}