diff options
author | Werner Koch <wk@gnupg.org> | 2008-09-16 14:28:17 +0000 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2008-09-16 14:28:17 +0000 |
commit | 2d9eb39bd6c6c70358f6bc395ed4dfd81738e811 (patch) | |
tree | 274d122c827e46996c98471738b5926b1aae5903 /random | |
parent | 2f1962593d4465b50ad7ec5781fa08cd44aec820 (diff) | |
download | libgcrypt-2d9eb39bd6c6c70358f6bc395ed4dfd81738e811.tar.gz |
Make fipsrngdriv more pretty.
Fix a problem in the RNG test code.
Minor doc update.
Diffstat (limited to 'random')
-rw-r--r-- | random/ChangeLog | 1 | ||||
-rw-r--r-- | random/random-fips.c | 8 |
2 files changed, 5 insertions, 4 deletions
diff --git a/random/ChangeLog b/random/ChangeLog index 60702eba..c22ea2ea 100644 --- a/random/ChangeLog +++ b/random/ChangeLog @@ -1,6 +1,7 @@ 2008-09-16 Werner Koch <wk@g10code.com> * random-fips.c (x931_aes_driver): No re-seeding with test contexts. + (_gcry_rngfips_init_external_test): Fix setting of test_dt_ptr. 2008-09-15 Werner Koch <wk@g10code.com> diff --git a/random/random-fips.c b/random/random-fips.c index eb1706fc..2fc9596e 100644 --- a/random/random-fips.c +++ b/random/random-fips.c @@ -37,7 +37,7 @@ caller requested less bits, the extra bits are not used. The key for each generator is only set once at the first time a generator is used. The seed value is set with the key and again after 1000 - (SEED_TTL) output blocks. + (SEED_TTL) output blocks; the re-seeding is disabled in test mode. The GCRY_VERY_STRONG_RANDOM and GCRY_STRONG_RANDOM generators are keyed and seeded from the /dev/random device. Thus these @@ -1043,9 +1043,9 @@ _gcry_rngfips_init_external_test (void **r_context, /* Setup a DT value. Because our context structure only stores a pointer we copy the DT value to the extra space we allocated in - the test_ctx and set the pointer to tehre. */ - memcpy ((char*)test_ctx + sizeof *test_ctx, dt, dtlen); - test_ctx->test_dt_ptr = (unsigned char*)test_ctx + sizeof test_ctx; + the test_ctx and set the pointer to that address. */ + memcpy ((unsigned char*)test_ctx + sizeof *test_ctx, dt, dtlen); + test_ctx->test_dt_ptr = (unsigned char*)test_ctx + sizeof *test_ctx; test_ctx->test_dt_counter = ( (test_ctx->test_dt_ptr[12] << 24) |(test_ctx->test_dt_ptr[13] << 16) |(test_ctx->test_dt_ptr[14] << 8) |