* devices.in (dev_storage): Map /dev/random and /dev/urandom to

\Device\Null.
	* devices.cc: Regenerate.
	* fhandler.h (fhandler_dev_random::open): Drop declaration.
	(fhandler_dev_random::close): Ditto.
	(fhandler_dev_random::crypt_gen_random): Convert to static method.
	* fhandler_random.cc (fhandler_dev_random::open): Remove so that default
	fhandler_base::open is used to open \Device\Null.
	(fhandler_dev_random::close): Ditto.
	* fhandler_socket.cc (entropy_source): Delete.
	(fhandler_socket::af_local_set_secret): Remove entropy_source code and
	call fhandler_dev_random::crypt_gen_random directly instead.
This commit is contained in:
Corinna Vinschen
2013-10-25 12:21:59 +00:00
parent 8ef76ab6f9
commit 494c626414
7 changed files with 27 additions and 46 deletions

View File

@@ -28,15 +28,6 @@ details. */
#define PSEUDO_MULTIPLIER (6364136223846793005LL)
#define PSEUDO_SHIFTVAL (21)
int
fhandler_dev_random::open (int flags, mode_t)
{
set_flags ((flags & ~O_TEXT) | O_BINARY);
nohandle (true);
set_open_status ();
return 1;
}
/* There's a bug in ntsecapi.h (Mingw as well as MSFT). SystemFunction036
is, in fact, a WINAPI function, but it's not defined as such. Therefore
we have to do it correctly here. */
@@ -149,9 +140,3 @@ fhandler_dev_random::read (void *ptr, size_t& len)
else if (!crypt_gen_random (ptr, len))
len = pseudo_read (ptr, len);
}
int
fhandler_dev_random::close ()
{
return 0;
}