mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-12-26 01:35:29 +00:00
Streamline test function API by removing parameter
streamline the API for the test test_derive_invalid_generator_state: by removing the key_data parameter. This parameter is not important for test flow and can be hard-coded.
This commit is contained in:
parent
f8964b9580
commit
dd69d8b7ff
|
@ -1211,7 +1211,7 @@ derive_setup:PSA_KEY_TYPE_DERIVE:"0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b":
|
||||||
|
|
||||||
PSA key derivation: invalid generator state ( double generate + read past capacity )
|
PSA key derivation: invalid generator state ( double generate + read past capacity )
|
||||||
depends_on:MBEDTLS_MD_C:MBEDTLS_SHA256_C
|
depends_on:MBEDTLS_MD_C:MBEDTLS_SHA256_C
|
||||||
test_derive_invalid_generator_state:"0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b"
|
test_derive_invalid_generator_state:
|
||||||
|
|
||||||
PSA key derivation: invalid generator state ( call read/get_capacity after init and abort )
|
PSA key derivation: invalid generator state ( call read/get_capacity after init and abort )
|
||||||
depends_on:MBEDTLS_MD_C:MBEDTLS_SHA256_C
|
depends_on:MBEDTLS_MD_C:MBEDTLS_SHA256_C
|
||||||
|
|
|
@ -3086,7 +3086,7 @@ exit:
|
||||||
/* END_CASE */
|
/* END_CASE */
|
||||||
|
|
||||||
/* BEGIN_CASE */
|
/* BEGIN_CASE */
|
||||||
void test_derive_invalid_generator_state( data_t *key_data )
|
void test_derive_invalid_generator_state( )
|
||||||
{
|
{
|
||||||
psa_key_slot_t base_key = 1;
|
psa_key_slot_t base_key = 1;
|
||||||
size_t key_type = PSA_KEY_TYPE_DERIVE;
|
size_t key_type = PSA_KEY_TYPE_DERIVE;
|
||||||
|
@ -3094,6 +3094,9 @@ void test_derive_invalid_generator_state( data_t *key_data )
|
||||||
psa_algorithm_t alg = PSA_ALG_HKDF(PSA_ALG_SHA_256);
|
psa_algorithm_t alg = PSA_ALG_HKDF(PSA_ALG_SHA_256);
|
||||||
size_t capacity = 42;
|
size_t capacity = 42;
|
||||||
uint8_t buffer[42];
|
uint8_t buffer[42];
|
||||||
|
const uint8_t key_data[22] = { 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b,
|
||||||
|
0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b,
|
||||||
|
0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b};
|
||||||
psa_key_policy_t policy;
|
psa_key_policy_t policy;
|
||||||
|
|
||||||
TEST_ASSERT( psa_crypto_init( ) == PSA_SUCCESS );
|
TEST_ASSERT( psa_crypto_init( ) == PSA_SUCCESS );
|
||||||
|
@ -3103,8 +3106,8 @@ void test_derive_invalid_generator_state( data_t *key_data )
|
||||||
TEST_ASSERT( psa_set_key_policy( base_key, &policy ) == PSA_SUCCESS );
|
TEST_ASSERT( psa_set_key_policy( base_key, &policy ) == PSA_SUCCESS );
|
||||||
|
|
||||||
TEST_ASSERT( psa_import_key( base_key, key_type,
|
TEST_ASSERT( psa_import_key( base_key, key_type,
|
||||||
key_data->x,
|
key_data,
|
||||||
key_data->len ) == PSA_SUCCESS );
|
sizeof(key_data) ) == PSA_SUCCESS );
|
||||||
|
|
||||||
/* valid key derivation */
|
/* valid key derivation */
|
||||||
TEST_ASSERT( psa_key_derivation( &generator, base_key, alg,
|
TEST_ASSERT( psa_key_derivation( &generator, base_key, alg,
|
||||||
|
|
Loading…
Reference in a new issue