int FIPS_selftest_dsa(void);
int FIPS_selftest_ecdsa(void);
int FIPS_selftest_ecdh(void);
-void FIPS_corrupt_drbg(void);
-void FIPS_x931_stick(void);
-void FIPS_drbg_stick(void);
+void FIPS_x931_stick(int onoff);
+void FIPS_drbg_stick(int onoff);
int FIPS_selftest_x931(void);
int FIPS_selftest_hmac(void);
int FIPS_selftest_drbg(void);
if (!FIPS_module_mode())
return 1;
if (do_drbg_stick)
- FIPS_drbg_stick();
+ FIPS_drbg_stick(1);
if (do_rng_stick)
- FIPS_x931_stick();
+ FIPS_x931_stick(1);
/* AES encryption/decryption
*/
static int drbg_stick = 0;
-void FIPS_drbg_stick(void)
+void FIPS_drbg_stick(int onoff)
{
- drbg_stick = 1;
+ drbg_stick = onoff;
}
/* Continuous DRBG utility function */
static int fips_prng_fail = 0;
-void FIPS_x931_stick(void)
+void FIPS_x931_stick(int onoff)
{
- fips_prng_fail = 1;
+ fips_prng_fail = onoff;
}
static void fips_rand_prng_reset(FIPS_PRNG_CTX *ctx)
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))