summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNIIBE Yutaka <gniibe@fsij.org>2022-01-11 14:47:13 +0900
committerNIIBE Yutaka <gniibe@fsij.org>2022-01-11 14:47:13 +0900
commit560943805a525a6f479b666578b0ff7d51e6f833 (patch)
tree358f75853d2ef04a97f063b22c8aff4f5c0979d0
parent83e58191d3d960b3efda960dd6fe50e8f0b02bda (diff)
downloadlibgcrypt-560943805a525a6f479b666578b0ff7d51e6f833.tar.gz
random: Rename rndlinux module to rndoldlinux.
* configure.ac (USE_RNDOLDLINUX): Rename from USE_RNDLINUX. (GCRYPT_RANDOM): Use rndoldlinux.lo. * doc/gcrypt.texi: Update. * random/Makefile.am (EXTRA_librandom_la_SOURCES): Update. * random/rndoldlinux.c: Rename from rndlinux.c. Rename the function. * random/rand-internal.h: Update the function name. * random/random-csprng.c: Update the calls to the function. * random/random-drbg.c: Likewise. * random/random-system.c: Likewise. * src/global.c: Use USE_RNDOLDLINUX. -- GnuPG-bug-id: 5759 Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
-rw-r--r--configure.ac4
-rw-r--r--doc/gcrypt.texi8
-rw-r--r--random/Makefile.am2
-rw-r--r--random/rand-internal.h10
-rw-r--r--random/random-csprng.c10
-rw-r--r--random/random-drbg.c10
-rw-r--r--random/random-system.c10
-rw-r--r--random/rndoldlinux.c (renamed from random/rndlinux.c)10
-rw-r--r--src/global.c4
9 files changed, 34 insertions, 34 deletions
diff --git a/configure.ac b/configure.ac
index ea2d26ba..4170cb83 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3111,8 +3111,8 @@ fi
LIST_MEMBER(linux, $random_modules)
if test "$found" = "1" ; then
- GCRYPT_RANDOM="$GCRYPT_RANDOM rndlinux.lo"
- AC_DEFINE(USE_RNDLINUX, 1, [Defined if the /dev/random RNG should be used.])
+ GCRYPT_RANDOM="$GCRYPT_RANDOM rndoldlinux.lo"
+ AC_DEFINE(USE_RNDOLDLINUX, 1, [Defined if the /dev/random RNG should be used.])
fi
LIST_MEMBER(unix, $random_modules)
diff --git a/doc/gcrypt.texi b/doc/gcrypt.texi
index 6381970c..bab4f77a 100644
--- a/doc/gcrypt.texi
+++ b/doc/gcrypt.texi
@@ -791,7 +791,7 @@ reduce the "up to 16 bytes" above to 0. Then the dependencies of the
initial states of the pools are completely known. Note that this is not
an issue if random of @code{GCRY_VERY_STRONG_RANDOM} quality is
requested as in this case enough extra entropy gets mixed. It is also
-not an issue when using rndgetentropy or rndlinux module, because the
+not an issue when using rndgetentropy or rndoldlinux module, because the
module guarantees to read full 16 bytes and thus there is no
way for an attacker without kernel access to control these 16 bytes.
@@ -6250,7 +6250,7 @@ All generators make use of so-called entropy gathering modules:
@item rndgetentropy
Uses the operating system provided @code{getentropy} function.
-@item rndlinux
+@item rndoldlinux
Uses the operating system provided @file{/dev/random} and
@file{/dev/urandom} devices. The @file{/dev/gcrypt/random.conf}
config option @option{only-urandom} can be used to inhibit the use of
@@ -6346,12 +6346,12 @@ output blocks.
On Unix like systems the @code{GCRY_VERY_STRONG_RANDOM} and
@code{GCRY_STRONG_RANDOM} generators are keyed and seeded using the
-rndgetentropy or rndlinux module. With rndlinux module, these
+rndgetentropy or rndoldlinux module. With rndoldlinux module, these
generators may block until the OS kernel has collected enough entropy.
When used with Microsoft Windows the rndw32 module is used instead.
The generator used for @code{gcry_create_nonce} is keyed and seeded
-from the @code{GCRY_STRONG_RANDOM} generator. Thus, with rndlinux
+from the @code{GCRY_STRONG_RANDOM} generator. Thus, with rndoldlinux
module, it may also block if the @code{GCRY_STRONG_RANDOM} generator
has not yet been used before and thus gets initialized on the first
use by @code{gcry_create_nonce}. This special treatment is justified
diff --git a/random/Makefile.am b/random/Makefile.am
index b4f0ae1f..af978570 100644
--- a/random/Makefile.am
+++ b/random/Makefile.am
@@ -41,7 +41,7 @@ rndhw.c
EXTRA_librandom_la_SOURCES = \
rndgetentropy.c \
-rndlinux.c \
+rndoldlinux.c \
rndegd.c \
rndunix.c \
rndw32.c \
diff --git a/random/rand-internal.h b/random/rand-internal.h
index 13d701c5..2d2b8909 100644
--- a/random/rand-internal.h
+++ b/random/rand-internal.h
@@ -93,11 +93,11 @@ int _gcry_rndgetentropy_gather_random (void (*add) (const void *, size_t,
enum random_origins origin,
size_t length, int level);
-/*-- rndlinux.c --*/
-int _gcry_rndlinux_gather_random (void (*add) (const void *, size_t,
- enum random_origins),
- enum random_origins origin,
- size_t length, int level);
+/*-- rndoldlinux.c --*/
+int _gcry_rndoldlinux_gather_random (void (*add) (const void *, size_t,
+ enum random_origins),
+ enum random_origins origin,
+ size_t length, int level);
/*-- rndunix.c --*/
int _gcry_rndunix_gather_random (void (*add) (const void *, size_t,
diff --git a/random/random-csprng.c b/random/random-csprng.c
index 67a5242a..85d11789 100644
--- a/random/random-csprng.c
+++ b/random/random-csprng.c
@@ -323,7 +323,7 @@ _gcry_rngcsprng_initialize (int full)
/* Try to close the FDs of the random gather module. This is
- currently only implemented for rndlinux. */
+ currently only implemented for rndgetentropy/rndoldlinux. */
void
_gcry_rngcsprng_close_fds (void)
{
@@ -331,8 +331,8 @@ _gcry_rngcsprng_close_fds (void)
#if USE_RNDGETENTROPY
_gcry_rndgetentropy_gather_random (NULL, 0, 0, 0);
#endif
-#if USE_RNDLINUX
- _gcry_rndlinux_gather_random (NULL, 0, 0, 0);
+#if USE_RNDOLDLINUX
+ _gcry_rndoldlinux_gather_random (NULL, 0, 0, 0);
#endif
pool_writepos = 0;
pool_readpos = 0;
@@ -1152,11 +1152,11 @@ getfnc_gather_random (void))(void (*)(const void*, size_t,
return fnc;
#endif
-#if USE_RNDLINUX
+#if USE_RNDOLDLINUX
if ( !access (NAME_OF_DEV_RANDOM, R_OK)
&& !access (NAME_OF_DEV_URANDOM, R_OK))
{
- fnc = _gcry_rndlinux_gather_random;
+ fnc = _gcry_rndoldlinux_gather_random;
return fnc;
}
#endif
diff --git a/random/random-drbg.c b/random/random-drbg.c
index 70ede2a4..a42b9ce8 100644
--- a/random/random-drbg.c
+++ b/random/random-drbg.c
@@ -621,9 +621,9 @@ drbg_get_entropy (drbg_state_t drbg, unsigned char *buffer,
#if USE_RNDGETENTROPY
rc = _gcry_rndgetentropy_gather_random (drbg_read_cb, 0, len,
GCRY_VERY_STRONG_RANDOM);
-#elif USE_RNDLINUX
- rc = _gcry_rndlinux_gather_random (drbg_read_cb, 0, len,
- GCRY_VERY_STRONG_RANDOM);
+#elif USE_RNDOLDLINUX
+ rc = _gcry_rndoldlinux_gather_random (drbg_read_cb, 0, len,
+ GCRY_VERY_STRONG_RANDOM);
#elif USE_RNDUNIX
rc = _gcry_rndunix_gather_random (drbg_read_cb, 0, len,
GCRY_VERY_STRONG_RANDOM);
@@ -1873,8 +1873,8 @@ _gcry_rngdrbg_close_fds (void)
#if USE_RNDGETENTROPY
_gcry_rndgetentropy_gather_random (NULL, 0, 0, 0);
#endif
-#if USE_RNDLINUX
- _gcry_rndlinux_gather_random (NULL, 0, 0, 0);
+#if USE_RNDOLDLINUX
+ _gcry_rndoldlinux_gather_random (NULL, 0, 0, 0);
#endif
if (drbg_state)
{
diff --git a/random/random-system.c b/random/random-system.c
index 8e50120c..a1d17ad0 100644
--- a/random/random-system.c
+++ b/random/random-system.c
@@ -149,8 +149,8 @@ get_random (void *buffer, size_t length, int level)
#if USE_RNDGETENTROPY
rc = _gcry_rndgetentropy_gather_random (read_cb, 0, length, level);
-#elif USE_RNDLINUX
- rc = _gcry_rndlinux_gather_random (read_cb, 0, length, level);
+#elif USE_RNDOLDLINUX
+ rc = _gcry_rndoldlinux_gather_random (read_cb, 0, length, level);
#elif USE_RNDUNIX
rc = _gcry_rndunix_gather_random (read_cb, 0, length, level);
#elif USE_RNDW32
@@ -190,7 +190,7 @@ _gcry_rngsystem_initialize (int full)
/* Try to close the FDs of the random gather module. This is
- currently only implemented for rndlinux. */
+ currently only implemented for rndgetentropy/rndoldlinux. */
void
_gcry_rngsystem_close_fds (void)
{
@@ -198,8 +198,8 @@ _gcry_rngsystem_close_fds (void)
#if USE_RNDGETENTROPY
_gcry_rndgetentropy_gather_random (NULL, 0, 0, 0);
#endif
-#if USE_RNDLINUX
- _gcry_rndlinux_gather_random (NULL, 0, 0, 0);
+#if USE_RNDOLDLINUX
+ _gcry_rndoldlinux_gather_random (NULL, 0, 0, 0);
#endif
unlock_rng ();
}
diff --git a/random/rndlinux.c b/random/rndoldlinux.c
index 0cafd859..c0bb9a33 100644
--- a/random/rndlinux.c
+++ b/random/rndoldlinux.c
@@ -1,4 +1,4 @@
-/* rndlinux.c - raw random number for OSes with /dev/random
+/* rndoldlinux.c - raw random number for OSes with /dev/random
* Copyright (C) 1998, 2001, 2002, 2003, 2007,
* 2009 Free Software Foundation, Inc.
*
@@ -116,10 +116,10 @@ open_device (const char *name, int retry)
* error). This function should be entered only by one thread at a
* time. */
int
-_gcry_rndlinux_gather_random (void (*add)(const void*, size_t,
- enum random_origins),
- enum random_origins origin,
- size_t length, int level )
+_gcry_rndoldlinux_gather_random (void (*add)(const void*, size_t,
+ enum random_origins),
+ enum random_origins origin,
+ size_t length, int level )
{
static int fd_urandom = -1;
static int fd_random = -1;
diff --git a/src/global.c b/src/global.c
index a955c3fc..054998f2 100644
--- a/src/global.c
+++ b/src/global.c
@@ -339,8 +339,8 @@ print_config (const char *what, gpgrt_stream_t fp)
#if USE_RNDGETENTROPY
"getentropy:"
#endif
-#if USE_RNDLINUX
- "linux:"
+#if USE_RNDOLDLINUX
+ "oldlinux:"
#endif
#if USE_RNDUNIX
"unix:"