|
|
c0f8d1 |
diff -up libgcrypt-1.5.3/random/random-csprng.c.urandom-only libgcrypt-1.5.3/random/random-csprng.c
|
|
|
c0f8d1 |
--- libgcrypt-1.5.3/random/random-csprng.c.urandom-only 2013-07-25 11:10:04.000000000 +0200
|
|
|
c0f8d1 |
+++ libgcrypt-1.5.3/random/random-csprng.c 2015-04-10 10:31:39.797534903 +0200
|
|
|
c0f8d1 |
@@ -855,7 +855,7 @@ _gcry_rngcsprng_update_seed_file (void)
|
|
|
c0f8d1 |
if ( !allow_seed_file_update )
|
|
|
c0f8d1 |
{
|
|
|
c0f8d1 |
unlock_pool ();
|
|
|
c0f8d1 |
- log_info(_("note: random_seed file not updated\n"));
|
|
|
c0f8d1 |
+ /* log_info(_("note: random_seed file not updated\n")); */
|
|
|
c0f8d1 |
return;
|
|
|
c0f8d1 |
}
|
|
|
c0f8d1 |
|
|
|
c0f8d1 |
@@ -1120,8 +1120,7 @@ getfnc_gather_random (void))(void (*)(co
|
|
|
c0f8d1 |
enum random_origins, size_t, int);
|
|
|
c0f8d1 |
|
|
|
c0f8d1 |
#if USE_RNDLINUX
|
|
|
c0f8d1 |
- if ( !access (NAME_OF_DEV_RANDOM, R_OK)
|
|
|
c0f8d1 |
- && !access (NAME_OF_DEV_URANDOM, R_OK))
|
|
|
c0f8d1 |
+ if (!access (NAME_OF_DEV_URANDOM, R_OK))
|
|
|
c0f8d1 |
{
|
|
|
c0f8d1 |
fnc = _gcry_rndlinux_gather_random;
|
|
|
c0f8d1 |
return fnc;
|
|
|
c0f8d1 |
diff -up libgcrypt-1.5.3/random/rndlinux.c.urandom-only libgcrypt-1.5.3/random/rndlinux.c
|
|
|
c0f8d1 |
--- libgcrypt-1.5.3/random/rndlinux.c.urandom-only 2014-12-12 16:51:56.000000000 +0100
|
|
|
c0f8d1 |
+++ libgcrypt-1.5.3/random/rndlinux.c 2015-04-10 10:34:13.615111926 +0200
|
|
|
c0f8d1 |
@@ -132,7 +132,11 @@ _gcry_rndlinux_gather_random (void (*add
|
|
|
c0f8d1 |
if (level >= 2)
|
|
|
c0f8d1 |
{
|
|
|
c0f8d1 |
if( fd_random == -1 )
|
|
|
c0f8d1 |
- fd_random = open_device ( NAME_OF_DEV_RANDOM, 1 );
|
|
|
c0f8d1 |
+ /* We try to open /dev/random first but in case the open fails
|
|
|
c0f8d1 |
+ we gracefully retry with /dev/urandom. */
|
|
|
c0f8d1 |
+ fd_random = open_device ( NAME_OF_DEV_RANDOM, 0 );
|
|
|
c0f8d1 |
+ if (fd_random == -1)
|
|
|
c0f8d1 |
+ fd_random = open_device ( NAME_OF_DEV_URANDOM, 1 );
|
|
|
c0f8d1 |
fd = fd_random;
|
|
|
c0f8d1 |
}
|
|
|
c0f8d1 |
else if (level != -1)
|