From: Nikos Mavrogiannopoulos Date: Sat, 29 Oct 2016 21:31:00 +0000 (+0200) Subject: nettle: renamed system random generator-related files for clarity X-Git-Tag: gnutls_3_5_6~20 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=adf720aebd30386a953078078e8ebd32b6eef2a4;p=thirdparty%2Fgnutls.git nettle: renamed system random generator-related files for clarity --- 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 similarity index 100% rename from lib/nettle/rnd-getentropy.c rename to lib/nettle/sysrng-getentropy.c diff --git a/lib/nettle/rnd-linux.c b/lib/nettle/sysrng-linux.c similarity index 94% rename from lib/nettle/rnd-linux.c rename to 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 similarity index 100% rename from lib/nettle/rnd-windows.c rename to 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;