mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2025-01-11 10:05:43 +00:00
psa: Rename psa_export_rsa/ecp_key to mbedtls_psa_rsa/ecp_export_key
Rename psa_export_rsa/ecp_key to mbedtls_psa_rsa/ecp_export_key before to move them to RSA/ECP specific PSA crypto C files. Signed-off-by: Ronald Cron <ronald.cron@arm.com>
This commit is contained in:
parent
9085708371
commit
3c8ca3ad00
|
@ -638,11 +638,11 @@ exit:
|
||||||
* \param[in] data_size The length of the buffer to export to
|
* \param[in] data_size The length of the buffer to export to
|
||||||
* \param[out] data_length The amount of bytes written to \p data
|
* \param[out] data_length The amount of bytes written to \p data
|
||||||
*/
|
*/
|
||||||
static psa_status_t psa_export_rsa_key( psa_key_type_t type,
|
static psa_status_t mbedtls_psa_rsa_export_key( psa_key_type_t type,
|
||||||
mbedtls_rsa_context *rsa,
|
mbedtls_rsa_context *rsa,
|
||||||
uint8_t *data,
|
uint8_t *data,
|
||||||
size_t data_size,
|
size_t data_size,
|
||||||
size_t *data_length )
|
size_t *data_length )
|
||||||
{
|
{
|
||||||
#if defined(MBEDTLS_PK_WRITE_C)
|
#if defined(MBEDTLS_PK_WRITE_C)
|
||||||
int ret;
|
int ret;
|
||||||
|
@ -730,11 +730,11 @@ static psa_status_t psa_import_rsa_key( psa_key_slot_t *slot,
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
status = psa_export_rsa_key( slot->attr.type,
|
status = mbedtls_psa_rsa_export_key( slot->attr.type,
|
||||||
rsa,
|
rsa,
|
||||||
output,
|
output,
|
||||||
data_length,
|
data_length,
|
||||||
&data_length);
|
&data_length);
|
||||||
exit:
|
exit:
|
||||||
/* Always free the RSA object */
|
/* Always free the RSA object */
|
||||||
mbedtls_rsa_free( rsa );
|
mbedtls_rsa_free( rsa );
|
||||||
|
@ -876,11 +876,11 @@ exit:
|
||||||
* \param[in] data_size The length of the buffer to export to
|
* \param[in] data_size The length of the buffer to export to
|
||||||
* \param[out] data_length The amount of bytes written to \p data
|
* \param[out] data_length The amount of bytes written to \p data
|
||||||
*/
|
*/
|
||||||
static psa_status_t psa_export_ecp_key( psa_key_type_t type,
|
static psa_status_t mbedtls_psa_ecp_export_key( psa_key_type_t type,
|
||||||
mbedtls_ecp_keypair *ecp,
|
mbedtls_ecp_keypair *ecp,
|
||||||
uint8_t *data,
|
uint8_t *data,
|
||||||
size_t data_size,
|
size_t data_size,
|
||||||
size_t *data_length )
|
size_t *data_length )
|
||||||
{
|
{
|
||||||
psa_status_t status;
|
psa_status_t status;
|
||||||
|
|
||||||
|
@ -963,11 +963,11 @@ static psa_status_t psa_import_ecp_key( psa_key_slot_t *slot,
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
status = psa_export_ecp_key( slot->attr.type,
|
status = mbedtls_psa_ecp_export_key( slot->attr.type,
|
||||||
ecp,
|
ecp,
|
||||||
output,
|
output,
|
||||||
data_length,
|
data_length,
|
||||||
&data_length);
|
&data_length);
|
||||||
exit:
|
exit:
|
||||||
/* Always free the PK object (will also free contained ECP context) */
|
/* Always free the PK object (will also free contained ECP context) */
|
||||||
mbedtls_ecp_keypair_free( ecp );
|
mbedtls_ecp_keypair_free( ecp );
|
||||||
|
@ -1780,11 +1780,11 @@ static psa_status_t psa_internal_export_key( const psa_key_slot_t *slot,
|
||||||
if( status != PSA_SUCCESS )
|
if( status != PSA_SUCCESS )
|
||||||
return( status );
|
return( status );
|
||||||
|
|
||||||
status = psa_export_rsa_key( PSA_KEY_TYPE_RSA_PUBLIC_KEY,
|
status = mbedtls_psa_rsa_export_key( PSA_KEY_TYPE_RSA_PUBLIC_KEY,
|
||||||
rsa,
|
rsa,
|
||||||
data,
|
data,
|
||||||
data_size,
|
data_size,
|
||||||
data_length );
|
data_length );
|
||||||
|
|
||||||
mbedtls_rsa_free( rsa );
|
mbedtls_rsa_free( rsa );
|
||||||
mbedtls_free( rsa );
|
mbedtls_free( rsa );
|
||||||
|
@ -1808,13 +1808,13 @@ static psa_status_t psa_internal_export_key( const psa_key_slot_t *slot,
|
||||||
if( status != PSA_SUCCESS )
|
if( status != PSA_SUCCESS )
|
||||||
return( status );
|
return( status );
|
||||||
|
|
||||||
status = psa_export_ecp_key( PSA_KEY_TYPE_ECC_PUBLIC_KEY(
|
status = mbedtls_psa_ecp_export_key(
|
||||||
PSA_KEY_TYPE_ECC_GET_FAMILY(
|
PSA_KEY_TYPE_ECC_PUBLIC_KEY(
|
||||||
slot->attr.type ) ),
|
PSA_KEY_TYPE_ECC_GET_FAMILY( slot->attr.type ) ),
|
||||||
ecp,
|
ecp,
|
||||||
data,
|
data,
|
||||||
data_size,
|
data_size,
|
||||||
data_length );
|
data_length );
|
||||||
|
|
||||||
mbedtls_ecp_keypair_free( ecp );
|
mbedtls_ecp_keypair_free( ecp );
|
||||||
mbedtls_free( ecp );
|
mbedtls_free( ecp );
|
||||||
|
@ -6621,11 +6621,11 @@ static psa_status_t psa_generate_key_internal(
|
||||||
return( status );
|
return( status );
|
||||||
}
|
}
|
||||||
|
|
||||||
status = psa_export_rsa_key( type,
|
status = mbedtls_psa_rsa_export_key( type,
|
||||||
&rsa,
|
&rsa,
|
||||||
slot->key.data,
|
slot->key.data,
|
||||||
bytes,
|
bytes,
|
||||||
&slot->key.bytes );
|
&slot->key.bytes );
|
||||||
mbedtls_rsa_free( &rsa );
|
mbedtls_rsa_free( &rsa );
|
||||||
if( status != PSA_SUCCESS )
|
if( status != PSA_SUCCESS )
|
||||||
psa_remove_key_data_from_memory( slot );
|
psa_remove_key_data_from_memory( slot );
|
||||||
|
|
Loading…
Reference in a new issue