From 70ec9b3b3517e6a95933cd6ab7f152de0a4a1d14 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 4 Apr 2018 19:31:36 +0200 Subject: [PATCH] back-port of the bugfix done in #363 --- src/prngs/fortuna.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/prngs/fortuna.c b/src/prngs/fortuna.c index 6617a27..1f07233 100644 --- a/src/prngs/fortuna.c +++ b/src/prngs/fortuna.c @@ -288,7 +288,7 @@ unsigned long fortuna_read(unsigned char *out, unsigned long outlen, prng_state } /* do we have to reseed? */ - if (++prng->fortuna.wd == LTC_FORTUNA_WD || prng->fortuna.pool0_len >= 64) { + if ((++prng->fortuna.wd == LTC_FORTUNA_WD) && (prng->fortuna.pool0_len >= 64)) { if (_fortuna_reseed(prng) != CRYPT_OK) { goto LBL_UNLOCK; }