From 8ebc2fc031cd1568e2969ab18b8f507e7f293d03 Mon Sep 17 00:00:00 2001 From: Sam Hartman Date: Mon, 19 Nov 2001 20:05:35 +0000 Subject: [PATCH] Fix memory handling bug in t_prng; update expected results as they changedd git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@14007 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/crypto/ChangeLog | 2 ++ src/lib/crypto/t_prng.c | 2 +- src/lib/crypto/t_prng.reseedtest-expected | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/lib/crypto/ChangeLog b/src/lib/crypto/ChangeLog index 344a036d2..f83b2cae9 100644 --- a/src/lib/crypto/ChangeLog +++ b/src/lib/crypto/ChangeLog @@ -1,5 +1,7 @@ 2001-11-19 Sam Hartman + * t_prng.c (main): Fix seeding bug in t_prng + * t_prng.reseedtest: New test; description in t_prng.reseedtest-comments * t_prng.c (main): If we request 0 bytes of output don't try to diff --git a/src/lib/crypto/t_prng.c b/src/lib/crypto/t_prng.c index 4da6e0f0b..49c0aec74 100644 --- a/src/lib/crypto/t_prng.c +++ b/src/lib/crypto/t_prng.c @@ -57,7 +57,7 @@ int main () { assert ((input.data = malloc(seed_length)) != NULL); for (lc = seed_length; lc > 0; lc--) { scanf ("%2x", &i); - input.data[lc] = (unsigned) (i&0xff); + input.data[seed_length-lc] = (unsigned) (i&0xff); } input.length = seed_length; assert (krb5_c_random_add_entropy (0, source_id, &input) == 0); diff --git a/src/lib/crypto/t_prng.reseedtest-expected b/src/lib/crypto/t_prng.reseedtest-expected index aa8893384..d777aad47 100644 --- a/src/lib/crypto/t_prng.reseedtest-expected +++ b/src/lib/crypto/t_prng.reseedtest-expected @@ -1 +1 @@ -8466373deab3992f57e7a96624b26973c7b32c51 +9ff89f8804f5cb6cab3b45eb5d6811f23c5f58c2 -- 2.26.2