mirror of
https://github.com/espressif/mbedtls.git
synced 2025-06-28 04:07:56 +08:00
Adapt pake driver wrapper tests for the new design
Signed-off-by: Przemek Stekiel <przemyslaw.stekiel@mobica.com>
This commit is contained in:
parent
2797d37424
commit
fcd70e250f
@ -3118,6 +3118,12 @@ void pake_operations(data_t *pw_data, int forced_status_setup_arg, int forced_st
|
|||||||
input_buffer, size_key_share),
|
input_buffer, size_key_share),
|
||||||
PSA_SUCCESS);
|
PSA_SUCCESS);
|
||||||
|
|
||||||
|
/* Simulate that we are ready to get implicit key. */
|
||||||
|
operation.computation_stage.data.jpake_computation_stage.input_step =
|
||||||
|
PSA_PAKE_STEP_DERIVE;
|
||||||
|
operation.computation_stage.data.jpake_computation_stage.output_step =
|
||||||
|
PSA_PAKE_STEP_DERIVE;
|
||||||
|
|
||||||
/* --- psa_pake_get_implicit_key --- */
|
/* --- psa_pake_get_implicit_key --- */
|
||||||
mbedtls_test_driver_pake_hooks.forced_status = forced_status;
|
mbedtls_test_driver_pake_hooks.forced_status = forced_status;
|
||||||
mbedtls_test_driver_pake_hooks.hits = 0;
|
mbedtls_test_driver_pake_hooks.hits = 0;
|
||||||
@ -3242,9 +3248,22 @@ void ecjpake_rounds(int alg_arg, int primitive_arg, int hash_arg,
|
|||||||
ecjpake_do_round(alg, primitive_arg, &server, &client,
|
ecjpake_do_round(alg, primitive_arg, &server, &client,
|
||||||
client_input_first, 2);
|
client_input_first, 2);
|
||||||
|
|
||||||
|
/* After get the key is obtained operation is aborted.
|
||||||
|
Adapt counter of expected hits. */
|
||||||
|
if (pake_in_driver) {
|
||||||
|
pake_expected_hit_count++;
|
||||||
|
}
|
||||||
|
|
||||||
PSA_ASSERT(psa_pake_get_implicit_key(&server, &server_derive));
|
PSA_ASSERT(psa_pake_get_implicit_key(&server, &server_derive));
|
||||||
TEST_EQUAL(mbedtls_test_driver_pake_hooks.hits,
|
TEST_EQUAL(mbedtls_test_driver_pake_hooks.hits,
|
||||||
pake_in_driver ? pake_expected_hit_count++ : pake_expected_hit_count);
|
pake_in_driver ? pake_expected_hit_count++ : pake_expected_hit_count);
|
||||||
|
|
||||||
|
/* After get the key is obtained operation is aborted.
|
||||||
|
Adapt counter of expected hits. */
|
||||||
|
if (pake_in_driver) {
|
||||||
|
pake_expected_hit_count++;
|
||||||
|
}
|
||||||
|
|
||||||
PSA_ASSERT(psa_pake_get_implicit_key(&client, &client_derive));
|
PSA_ASSERT(psa_pake_get_implicit_key(&client, &client_derive));
|
||||||
TEST_EQUAL(mbedtls_test_driver_pake_hooks.hits,
|
TEST_EQUAL(mbedtls_test_driver_pake_hooks.hits,
|
||||||
pake_in_driver ? pake_expected_hit_count++ : pake_expected_hit_count);
|
pake_in_driver ? pake_expected_hit_count++ : pake_expected_hit_count);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user