From 9f68523cf9c6321d556e8be3b6f18319239f2a42 Mon Sep 17 00:00:00 2001 From: Geoffrey Challen Date: Tue, 1 Mar 2016 14:47:04 -0500 Subject: [PATCH 1/2] Fix to bigexec. --- test161/tests/syscalls/bigexec.t | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test161/tests/syscalls/bigexec.t b/test161/tests/syscalls/bigexec.t index 0614b78..a5cef02 100644 --- a/test161/tests/syscalls/bigexec.t +++ b/test161/tests/syscalls/bigexec.t @@ -1,4 +1,4 @@ --- +--- name: "Bigexec Test" description: Tests to ensure that the argument passing logic is not hard-coded From 0230d87de48fb53697876b19ec7abef13ec03071 Mon Sep 17 00:00:00 2001 From: Scott Haseley Date: Tue, 1 Mar 2016 15:24:26 -0500 Subject: [PATCH 2/2] Changed make_salt to call srandom with time in ms since epoch (lower 32 bits). --- common/libtest161/secure.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/common/libtest161/secure.c b/common/libtest161/secure.c index fdc9a2c..eb02485 100644 --- a/common/libtest161/secure.c +++ b/common/libtest161/secure.c @@ -40,6 +40,8 @@ static int buf_num = 0; #ifndef _KERNEL static int did_random = 0; +#define NSEC_PER_MSEC 1000000ULL +#define MSEC_PER_SEC 1000ULL #endif static void * _alloc(size_t size) @@ -143,9 +145,14 @@ static void make_salt(char *salt_str) #ifndef _KERNEL if (!did_random) { did_random = 1; - time_t t; - time(&t); - srandom(t); + time_t sec; + unsigned long ns; + unsigned long long ms; + + __time(&sec, &ns); + ms = (unsigned long long)sec * MSEC_PER_SEC; + ms += (ns / NSEC_PER_MSEC); + srandom((unsigned long)ms); } #endif