diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2011-11-05 18:15:01 +0000 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2011-11-05 18:15:01 +0000 |
commit | df64f34e843c19bb28102278ffc5a687ebee62f2 (patch) | |
tree | 9d049d2c0fa078b6210d07295308606f90f40233 /fips/rand/fips_rand_selftest.c | |
parent | 21a5cb26965843b263044ff2b7220ea1f030cf4e (diff) |
make post failure simulation reversible in all cases
Diffstat (limited to 'fips/rand/fips_rand_selftest.c')
-rw-r--r-- | fips/rand/fips_rand_selftest.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/fips/rand/fips_rand_selftest.c b/fips/rand/fips_rand_selftest.c index bafce719ca..ec949cbdbb 100644 --- a/fips/rand/fips_rand_selftest.c +++ b/fips/rand/fips_rand_selftest.c @@ -129,15 +129,16 @@ static AES_PRNG_TV aes_256_tv = static int do_x931_test(unsigned char *key, int keylen, AES_PRNG_TV *tv) { - unsigned char R[16]; + unsigned char R[16], V[16]; int rv = 1; + memcpy(V, tv->V, sizeof(V)); if (!FIPS_x931_set_key(key, keylen)) return 0; if (!fips_post_started(FIPS_TEST_X931, keylen, NULL)) return 1; if (!fips_post_corrupt(FIPS_TEST_X931, keylen, NULL)) - tv->V[0]++; - FIPS_x931_seed(tv->V, 16); + V[0]++; + FIPS_x931_seed(V, 16); FIPS_x931_set_dt(tv->DT); FIPS_x931_bytes(R, 16); if (memcmp(R, tv->R, 16)) |