diff options
author | Alon Bar-Lev <alonbl@gentoo.org> | 2019-02-07 23:02:46 +0200 |
---|---|---|
committer | Alon Bar-Lev <alonbl@gentoo.org> | 2019-02-07 23:03:18 +0200 |
commit | 132ea93627a905045caf6a6227b7f0c65b49f24c (patch) | |
tree | cb667fd389683381e26b6adf46c6ecb6992346a7 /app-crypt/dieharder/files/dieharder-3.31.1-urandom-64bit.patch | |
parent | net-ftp/proftpd: expose USE=sodium (diff) | |
download | gentoo-132ea93627a905045caf6a6227b7f0c65b49f24c.tar.gz gentoo-132ea93627a905045caf6a6227b7f0c65b49f24c.tar.bz2 gentoo-132ea93627a905045caf6a6227b7f0c65b49f24c.zip |
app-crypt/dieharder: fix random on 64bit
Closes: https://bugs.gentoo.org/show_bug.cgi?id=677386
Thanks: vm666
Signed-off-by: Alon Bar-Lev <alonbl@gentoo.org>
Package-Manager: Portage-2.3.51, Repoman-2.3.11
Diffstat (limited to 'app-crypt/dieharder/files/dieharder-3.31.1-urandom-64bit.patch')
-rw-r--r-- | app-crypt/dieharder/files/dieharder-3.31.1-urandom-64bit.patch | 87 |
1 files changed, 87 insertions, 0 deletions
diff --git a/app-crypt/dieharder/files/dieharder-3.31.1-urandom-64bit.patch b/app-crypt/dieharder/files/dieharder-3.31.1-urandom-64bit.patch new file mode 100644 index 000000000000..c5615b673fd0 --- /dev/null +++ b/app-crypt/dieharder/files/dieharder-3.31.1-urandom-64bit.patch @@ -0,0 +1,87 @@ +diff -ru dieharder-3.31.1/libdieharder/rng_dev_arandom.c dieharder-3.31.1_fixed/libdieharder/rng_dev_arandom.c +--- dieharder-3.31.1/libdieharder/rng_dev_arandom.c 2011-10-14 15:41:37.000000000 +0200 ++++ dieharder-3.31.1_fixed/libdieharder/rng_dev_arandom.c 2014-01-03 22:51:30.010534418 +0100 +@@ -6,6 +6,7 @@ + */ + + #include <dieharder/libdieharder.h> ++#include <stdint.h> + + static unsigned long int dev_arandom_get (void *vstate); + static double dev_arandom_get_double (void *vstate); +@@ -21,7 +22,7 @@ + dev_arandom_get (void *vstate) + { + dev_arandom_state_t *state = (dev_arandom_state_t *) vstate; +- unsigned long int j; ++ uint32_t j; + + if(state->fp != NULL) { + fread(&j,sizeof(j),1,state->fp); +@@ -36,7 +37,7 @@ + static double + dev_arandom_get_double (void *vstate) + { +- return dev_arandom_get (vstate) / (double) UINT_MAX; ++ return dev_arandom_get (vstate) / (double) UINT32_MAX; + } + + static void +diff -ru dieharder-3.31.1/libdieharder/rng_dev_random.c dieharder-3.31.1_fixed/libdieharder/rng_dev_random.c +--- dieharder-3.31.1/libdieharder/rng_dev_random.c 2011-10-14 15:41:37.000000000 +0200 ++++ dieharder-3.31.1_fixed/libdieharder/rng_dev_random.c 2014-01-03 22:50:57.852321485 +0100 +@@ -6,6 +6,7 @@ + */ + + #include <dieharder/libdieharder.h> ++#include <stdint.h> + + static unsigned long int dev_random_get (void *vstate); + static double dev_random_get_double (void *vstate); +@@ -21,7 +22,7 @@ + dev_random_get (void *vstate) + { + dev_random_state_t *state = (dev_random_state_t *) vstate; +- unsigned long int j; ++ uint32_t j; + + if(state->fp != NULL) { + fread(&j,sizeof(j),1,state->fp); +@@ -36,7 +37,7 @@ + static double + dev_random_get_double (void *vstate) + { +- return dev_random_get (vstate) / (double) UINT_MAX; ++ return dev_random_get (vstate) / (double) UINT32_MAX; + } + + static void +diff -ru dieharder-3.31.1/libdieharder/rng_dev_urandom.c dieharder-3.31.1_fixed/libdieharder/rng_dev_urandom.c +--- dieharder-3.31.1/libdieharder/rng_dev_urandom.c 2011-10-14 15:41:37.000000000 +0200 ++++ dieharder-3.31.1_fixed/libdieharder/rng_dev_urandom.c 2014-01-03 23:06:24.124239582 +0100 +@@ -3,6 +3,7 @@ + */ + + #include <dieharder/libdieharder.h> ++#include <stdint.h> + + /* + * This is a wrapping of the /dev/random hardware rng +@@ -21,7 +22,7 @@ + dev_urandom_get (void *vstate) + { + dev_urandom_state_t *state = (dev_urandom_state_t *) vstate; +- unsigned long int j; ++ uint32_t j; + + if(state->fp != NULL) { + fread(&j,sizeof(j),1,state->fp); +@@ -36,7 +37,7 @@ + static double + dev_urandom_get_double (void *vstate) + { +- return dev_urandom_get (vstate) / (double) UINT_MAX; ++ return dev_urandom_get (vstate) / (double) UINT32_MAX; + } + + static void |