mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-11-22 19:05:37 +01:00
Add test for ctr_drbg_update() input sanitizing
This commit is contained in:
parent
d9e2dd2bb0
commit
f5f25b3a0d
@ -141,6 +141,10 @@ void ctr_drbg_entropy_usage( )
|
|||||||
}
|
}
|
||||||
TEST_ASSERT( last_idx == test_offset_idx );
|
TEST_ASSERT( last_idx == test_offset_idx );
|
||||||
|
|
||||||
|
/* Call update with too much data (sizeof entropy > MAX(_SEED)_INPUT)
|
||||||
|
* (just make sure it doesn't cause memory corruption) */
|
||||||
|
ctr_drbg_update( &ctx, entropy, sizeof( entropy ) );
|
||||||
|
|
||||||
/* Now enable PR, so the next few calls should all reseed */
|
/* Now enable PR, so the next few calls should all reseed */
|
||||||
ctr_drbg_set_prediction_resistance( &ctx, CTR_DRBG_PR_ON );
|
ctr_drbg_set_prediction_resistance( &ctx, CTR_DRBG_PR_ON );
|
||||||
TEST_ASSERT( ctr_drbg_random( &ctx, out, sizeof( out ) ) == 0 );
|
TEST_ASSERT( ctr_drbg_random( &ctx, out, sizeof( out ) ) == 0 );
|
||||||
|
Loading…
Reference in New Issue
Block a user