[PATCH] prng: fix repetition test to properly update on each iteration

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Fixing a silly bug that I missed in the initial submission
Fix the repetition test in prng to update on each iteration.  Currently we check
against the last iteration to make sure the given prng context isn't stuck, but
we never update the last data buffer.

Best
Neil

Signed-off-by: Neil Horman <nhorman@xxxxxxxxxxxxx>


 prng.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/crypto/prng.c b/crypto/prng.c
index 1310175..5b66bdf 100644
--- a/crypto/prng.c
+++ b/crypto/prng.c
@@ -153,6 +153,7 @@ static int _get_more_prng_bytes(struct prng_context *ctx)
 					ctx->flags |= PRNG_NEED_RESET;
 					return -1;
 				}
+				memcpy(ctx->last_rand_data, ctx->rand_data, DEFAULT_BLK_SZ);
 
 				/*
 				 * Lastly xor the random data with I
-- 
/****************************************************
 * Neil Horman <nhorman@xxxxxxxxxxxxx>
 * Software Engineer, Red Hat
 ****************************************************/
--
To unsubscribe from this list: send the line "unsubscribe linux-crypto" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel]     [Gnu Classpath]     [Gnu Crypto]     [DM Crypt]     [Netfilter]     [Bugtraq]

  Powered by Linux