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 <[EMAIL PROTECTED]>


 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 <[EMAIL PROTECTED]>
 * Software Engineer, Red Hat
 ****************************************************/
--
To unsubscribe from this list: send the line "unsubscribe linux-crypto" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to