From b175b146a24a561228dae3eb24c215786ada3343 Mon Sep 17 00:00:00 2001 From: Przemek Stekiel Date: Wed, 22 Mar 2023 08:37:40 +0100 Subject: [PATCH] Remove driver_pake_get_role function Signed-off-by: Przemek Stekiel --- docs/proposed/psa-driver-interface.md | 4 --- include/psa/crypto_extra.h | 15 -------- library/psa_crypto.c | 13 ------- tests/suites/test_suite_psa_crypto_pake.data | 3 -- .../test_suite_psa_crypto_pake.function | 35 ------------------- 5 files changed, 70 deletions(-) diff --git a/docs/proposed/psa-driver-interface.md b/docs/proposed/psa-driver-interface.md index 0027ec7662..17b4f7787f 100644 --- a/docs/proposed/psa-driver-interface.md +++ b/docs/proposed/psa-driver-interface.md @@ -390,10 +390,6 @@ psa_status_t psa_crypto_driver_pake_get_peer( const psa_crypto_driver_pake_inputs_t *inputs, uint8_t *peer_id, size_t peer_id_size, size_t *peer_id_length); -psa_status_t psa_crypto_driver_pake_get_role( -    const psa_crypto_driver_pake_inputs_t *inputs, -    psa_pake_role_t *role); - psa_status_t psa_crypto_driver_pake_get_cipher_suite(     const psa_crypto_driver_pake_inputs_t *inputs,     psa_pake_cipher_suite_t *cipher_suite); diff --git a/include/psa/crypto_extra.h b/include/psa/crypto_extra.h index 0c097b2322..cd530cffb9 100644 --- a/include/psa/crypto_extra.h +++ b/include/psa/crypto_extra.h @@ -1330,20 +1330,6 @@ psa_status_t psa_crypto_driver_pake_get_password( const psa_crypto_driver_pake_inputs_t *inputs, uint8_t *buffer, size_t buffer_size, size_t *buffer_length); -/** Get the role from given inputs. - * - * \param[in] inputs Operation inputs. - * \param[out] role Return buffer for role. - * - * \retval #PSA_SUCCESS - * Success. - * \retval #PSA_ERROR_BAD_STATE - * Role hasn't been set yet. - */ -psa_status_t psa_crypto_driver_pake_get_role( - const psa_crypto_driver_pake_inputs_t *inputs, - psa_pake_role_t *role); - /** Get the length of the user id in bytes from given inputs. * * \param[in] inputs Operation inputs. @@ -2033,7 +2019,6 @@ static inline void psa_pake_cs_set_hash(psa_pake_cipher_suite_t *cipher_suite, struct psa_crypto_driver_pake_inputs_s { uint8_t *MBEDTLS_PRIVATE(password); size_t MBEDTLS_PRIVATE(password_len); - psa_pake_role_t MBEDTLS_PRIVATE(role); uint8_t *MBEDTLS_PRIVATE(user); size_t MBEDTLS_PRIVATE(user_len); uint8_t *MBEDTLS_PRIVATE(peer); diff --git a/library/psa_crypto.c b/library/psa_crypto.c index 540ae46afb..2d53bf698d 100644 --- a/library/psa_crypto.c +++ b/library/psa_crypto.c @@ -7211,19 +7211,6 @@ psa_status_t psa_crypto_driver_pake_get_password( return PSA_SUCCESS; } -psa_status_t psa_crypto_driver_pake_get_role( - const psa_crypto_driver_pake_inputs_t *inputs, - psa_pake_role_t *role) -{ - if (inputs->role == PSA_PAKE_ROLE_NONE) { - return PSA_ERROR_BAD_STATE; - } - - *role = inputs->role; - - return PSA_SUCCESS; -} - psa_status_t psa_crypto_driver_pake_get_user_len( const psa_crypto_driver_pake_inputs_t *inputs, size_t *user_len) diff --git a/tests/suites/test_suite_psa_crypto_pake.data b/tests/suites/test_suite_psa_crypto_pake.data index 6f704b4e4f..77faebb264 100644 --- a/tests/suites/test_suite_psa_crypto_pake.data +++ b/tests/suites/test_suite_psa_crypto_pake.data @@ -216,9 +216,6 @@ pake_input_getters_password PSA PAKE: input getters: cipher suite pake_input_getters_cipher_suite -PSA PAKE: input getters: role -pake_input_getters_role - PSA PAKE: input getters: user pake_input_getters_user diff --git a/tests/suites/test_suite_psa_crypto_pake.function b/tests/suites/test_suite_psa_crypto_pake.function index 88f24dd55b..85e7b7406f 100644 --- a/tests/suites/test_suite_psa_crypto_pake.function +++ b/tests/suites/test_suite_psa_crypto_pake.function @@ -1025,41 +1025,6 @@ exit: } /* END_CASE */ -/* BEGIN_CASE depends_on:PSA_WANT_ALG_JPAKE */ -void pake_input_getters_role() -{ - psa_pake_cipher_suite_t cipher_suite = psa_pake_cipher_suite_init(); - psa_pake_operation_t operation = psa_pake_operation_init(); - psa_pake_role_t role_ret = PSA_PAKE_ROLE_NONE; - - psa_pake_primitive_t primitive = PSA_PAKE_PRIMITIVE( - PSA_PAKE_PRIMITIVE_TYPE_ECC, - PSA_ECC_FAMILY_SECP_R1, 256); - - PSA_INIT(); - - psa_pake_cs_set_algorithm(&cipher_suite, PSA_ALG_JPAKE); - psa_pake_cs_set_primitive(&cipher_suite, primitive); - psa_pake_cs_set_hash(&cipher_suite, PSA_ALG_SHA_256); - - PSA_ASSERT(psa_pake_setup(&operation, &cipher_suite)); - - TEST_EQUAL(psa_crypto_driver_pake_get_role(&operation.data.inputs, &role_ret), - PSA_ERROR_BAD_STATE); - - /* Role can not be set directly using psa_pake_set_role(). It is set by the core - based on given user/peer identifiers. Simulate that Role is already set. */ - operation.data.inputs.role = PSA_PAKE_ROLE_SERVER; - TEST_EQUAL(psa_crypto_driver_pake_get_role(&operation.data.inputs, &role_ret), - PSA_SUCCESS); - - TEST_EQUAL(role_ret, PSA_PAKE_ROLE_SERVER); -exit: - PSA_ASSERT(psa_pake_abort(&operation)); - PSA_DONE(); -} -/* END_CASE */ - /* BEGIN_CASE depends_on:PSA_WANT_ALG_JPAKE */ void pake_input_getters_user() {