mirror of
https://github.com/cuberite/polarssl.git
synced 2025-10-03 18:43:38 -04:00
test: pake: add test for opaque password key
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
This commit is contained in:
parent
ae7fe7ee53
commit
2a3ffb4203
@ -6237,10 +6237,21 @@ void ssl_ecjpake_set_password( int use_opaque_arg )
|
|||||||
{
|
{
|
||||||
psa_key_attributes_t attributes = PSA_KEY_ATTRIBUTES_INIT;
|
psa_key_attributes_t attributes = PSA_KEY_ATTRIBUTES_INIT;
|
||||||
|
|
||||||
psa_set_key_usage_flags( &attributes, PSA_KEY_USAGE_DERIVE );
|
/* First try with an invalid usage */
|
||||||
|
psa_set_key_usage_flags( &attributes, PSA_KEY_USAGE_SIGN_HASH );
|
||||||
psa_set_key_algorithm( &attributes, PSA_ALG_JPAKE );
|
psa_set_key_algorithm( &attributes, PSA_ALG_JPAKE );
|
||||||
psa_set_key_type( &attributes, PSA_KEY_TYPE_PASSWORD );
|
psa_set_key_type( &attributes, PSA_KEY_TYPE_PASSWORD );
|
||||||
|
|
||||||
|
PSA_ASSERT( psa_import_key( &attributes, pwd_string,
|
||||||
|
pwd_len, &pwd_slot ) );
|
||||||
|
|
||||||
|
ECJPAKE_TEST_SET_PASSWORD( MBEDTLS_ERR_SSL_HW_ACCEL_FAILED );
|
||||||
|
|
||||||
|
psa_destroy_key( pwd_slot );
|
||||||
|
|
||||||
|
/* Then set the correct usage */
|
||||||
|
psa_set_key_usage_flags( &attributes, PSA_KEY_USAGE_DERIVE );
|
||||||
|
|
||||||
PSA_ASSERT( psa_import_key( &attributes, pwd_string,
|
PSA_ASSERT( psa_import_key( &attributes, pwd_string,
|
||||||
pwd_len, &pwd_slot ) );
|
pwd_len, &pwd_slot ) );
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user