diff options
| author | Joe Maples <joe@frap129.org> | 2016-08-28 13:10:23 +0000 |
|---|---|---|
| committer | Mister Oyster <oysterized@gmail.com> | 2017-04-11 10:57:04 +0200 |
| commit | 348fec78a63fc91b4d0bf2534d56b4f7cb7a27c1 (patch) | |
| tree | 74fa917aa0630c3c18b683cce78fa6627bcd8653 /lib | |
| parent | 34a20a12e3d15c06b0d9253fe0af3b134d1917b2 (diff) | |
random: Backport driver from 4.1.31
Signed-off-by: Joe Maples <joe@frap129.org>
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/random32.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/random32.c b/lib/random32.c index ae95d5154..0bee183fa 100644 --- a/lib/random32.c +++ b/lib/random32.c @@ -151,7 +151,8 @@ static u32 __extract_hwseed(void) { unsigned int val = 0; - (void)(arch_get_random_int(&val)); + (void)(arch_get_random_seed_int(&val) || + arch_get_random_int(&val)); return val; } @@ -220,7 +221,7 @@ static void __prandom_timer(unsigned long dontcare) u32 entropy; unsigned long expires; - erandom_get_random_bytes((char *)&entropy, sizeof(entropy)); + get_random_bytes(&entropy, sizeof(entropy)); prandom_seed(entropy); /* reseed every ~60 seconds, in [40 .. 80) interval with slack */ @@ -270,7 +271,7 @@ static void __prandom_reseed(bool late) struct rnd_state *state = &per_cpu(net_rand_state,i); u32 seeds[4]; - erandom_get_random_bytes((char *)&seeds, sizeof(seeds)); + get_random_bytes(&seeds, sizeof(seeds)); state->s1 = __seed(seeds[0], 2U); state->s2 = __seed(seeds[1], 8U); state->s3 = __seed(seeds[2], 16U); |
