Skip to content

Commit bde7708

Browse files
committed
Remove public key output parameters from p_generate
1 parent cbe1c59 commit bde7708

File tree

3 files changed

+3
-21
lines changed

3 files changed

+3
-21
lines changed

include/psa/crypto_se_driver.h

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -849,19 +849,11 @@ typedef psa_status_t (*psa_drv_se_export_key_t)(psa_key_slot_number_t key,
849849
* Driver developers should endeavor to match the
850850
* usages as close as possible.
851851
* \param[in] bits The size in bits of the key to be generated.
852-
* \param[out] p_pubkey_out The buffer where the public key information will
853-
* be placed
854-
* \param[in] pubkey_out_size The size in bytes of the `p_pubkey_out` buffer
855-
* \param[out] p_pubkey_length Upon successful completion, will contain the
856-
* size of the data placed in `p_pubkey_out`.
857852
*/
858853
typedef psa_status_t (*psa_drv_se_generate_key_t)(psa_key_slot_number_t key_slot,
859854
psa_key_type_t type,
860855
psa_key_usage_t usage,
861-
size_t bits,
862-
uint8_t *p_pubkey_out,
863-
size_t pubkey_out_size,
864-
size_t *p_pubkey_length);
856+
size_t bits);
865857

866858
/**
867859
* \brief A struct containing all of the function pointers needed to for secure

library/psa_crypto.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5331,9 +5331,6 @@ psa_status_t psa_generate_key( const psa_key_attributes_t *attributes,
53315331
psa_status_t status;
53325332
psa_key_slot_t *slot = NULL;
53335333
const psa_se_drv_table_entry_t *driver = NULL;
5334-
uint8_t p_pubkey_out;
5335-
size_t pubkey_out_size;
5336-
size_t p_pubkey_length;
53375334

53385335
status = psa_start_key_creation( attributes, handle, &slot, &driver );
53395336
if( status != PSA_SUCCESS )
@@ -5350,7 +5347,7 @@ psa_status_t psa_generate_key( const psa_key_attributes_t *attributes,
53505347
}
53515348
status = drv->key_management->p_generate(
53525349
slot->data.se.slot_number, slot->type, slot->policy.usage,
5353-
attributes->bits, &p_pubkey_out, pubkey_out_size, &p_pubkey_length);
5350+
attributes->bits);
53545351
if( status != PSA_SUCCESS )
53555352
goto exit;
53565353
}

tests/suites/test_suite_psa_crypto_se_driver_hal_mocks.function

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -92,20 +92,13 @@ static void mock_teardown( void )
9292
static psa_status_t mock_generate( psa_key_slot_number_t key_slot,
9393
psa_key_type_t type,
9494
psa_key_usage_t usage,
95-
size_t bits,
96-
uint8_t *p_pubkey_out,
97-
size_t pubkey_out_size,
98-
size_t *p_pubkey_length )
95+
size_t bits )
9996
{
100-
(void) p_pubkey_out;
101-
(void) p_pubkey_length;
102-
10397
mock_generate_data.called++;
10498
mock_generate_data.key_slot = key_slot;
10599
mock_generate_data.type = type;
106100
mock_generate_data.usage = usage;
107101
mock_generate_data.bits = bits;
108-
mock_generate_data.pubkey_out_size = pubkey_out_size;
109102

110103
return( mock_generate_data.return_value );
111104
}

0 commit comments

Comments
 (0)