summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2016-10-29 23:31:00 +0200
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2016-10-29 23:41:16 +0200
commitadf720aebd30386a953078078e8ebd32b6eef2a4 (patch)
tree4ae240ad623f1475dd09d9e457c6c4d7aa938080
parent1b8d9a237c39b6041196a6750e5901b18fb22843 (diff)
downloadgnutls-tmp-mini-rng-additions.tar.gz
nettle: renamed system random generator-related files for claritytmp-mini-rng-additions
-rw-r--r--lib/nettle/Makefile.am6
-rw-r--r--lib/nettle/sysrng-getentropy.c (renamed from lib/nettle/rnd-getentropy.c)0
-rw-r--r--lib/nettle/sysrng-linux.c (renamed from lib/nettle/rnd-linux.c)4
-rw-r--r--lib/nettle/sysrng-windows.c (renamed from lib/nettle/rnd-windows.c)0
-rw-r--r--tests/rng-sigint.c2
5 files changed, 8 insertions, 4 deletions
diff --git a/lib/nettle/Makefile.am b/lib/nettle/Makefile.am
index 5f5d6d2c94..af64baef02 100644
--- a/lib/nettle/Makefile.am
+++ b/lib/nettle/Makefile.am
@@ -43,12 +43,12 @@ libcrypto_la_SOURCES = pk.c mpi.c mac.c cipher.c init.c \
int/dsa-fips.h int/dsa-keygen-fips186.c int/dsa-validate.c
if WINDOWS
-libcrypto_la_SOURCES += rnd-windows.c
+libcrypto_la_SOURCES += sysrng-windows.c
else
if HAVE_GETENTROPY
-libcrypto_la_SOURCES += rnd-getentropy.c
+libcrypto_la_SOURCES += sysrng-getentropy.c
else
-libcrypto_la_SOURCES += rnd-linux.c
+libcrypto_la_SOURCES += sysrng-linux.c
endif
endif
diff --git a/lib/nettle/rnd-getentropy.c b/lib/nettle/sysrng-getentropy.c
index f83053444b..f83053444b 100644
--- a/lib/nettle/rnd-getentropy.c
+++ b/lib/nettle/sysrng-getentropy.c
diff --git a/lib/nettle/rnd-linux.c b/lib/nettle/sysrng-linux.c
index 7a24d05f6f..3931abbea6 100644
--- a/lib/nettle/rnd-linux.c
+++ b/lib/nettle/sysrng-linux.c
@@ -146,6 +146,10 @@ static int _rnd_get_system_entropy_urandom(void* _rnd, size_t size)
return 0;
}
+/* This is called when gnutls_global_init() is called for second time.
+ * It must check whether any resources are still available.
+ * The particular problem it solves is to verify that the urandom fd is still
+ * open (for applications that for some reason closed all fds */
int _rnd_system_entropy_check(void)
{
int ret;
diff --git a/lib/nettle/rnd-windows.c b/lib/nettle/sysrng-windows.c
index 2baeeb1480..2baeeb1480 100644
--- a/lib/nettle/rnd-windows.c
+++ b/lib/nettle/sysrng-windows.c
diff --git a/tests/rng-sigint.c b/tests/rng-sigint.c
index 7bf1feea0c..6406855fed 100644
--- a/tests/rng-sigint.c
+++ b/tests/rng-sigint.c
@@ -50,7 +50,7 @@ typedef int (*get_entropy_func)(void* rnd, size_t size);
get_entropy_func _rnd_get_system_entropy;
#define RND_NO_INCLUDES
-#include "../lib/nettle/rnd-linux.c"
+#include "../lib/nettle/sysrng-linux.c"
static volatile int stop_loop = 0;