mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2025-01-24 11:11:10 +00:00
psa_generate_key(): return PSA_ERROR_INVALID_ARGUMENT for public key
Signed-off-by: Przemyslaw Stekiel <przemyslaw.stekiel@mobica.com>
This commit is contained in:
parent
e93b3699fa
commit
5b20a7e8b3
|
@ -5230,6 +5230,10 @@ psa_status_t psa_generate_key( const psa_key_attributes_t *attributes,
|
|||
if( psa_get_key_bits( attributes ) == 0 )
|
||||
return( PSA_ERROR_INVALID_ARGUMENT );
|
||||
|
||||
/* Reject any attempt to create a public key. */
|
||||
if( PSA_KEY_TYPE_IS_PUBLIC_KEY(attributes->core.type) )
|
||||
return( PSA_ERROR_INVALID_ARGUMENT );
|
||||
|
||||
status = psa_start_key_creation( PSA_KEY_CREATION_GENERATE, attributes,
|
||||
&slot, &driver );
|
||||
if( status != PSA_SUCCESS )
|
||||
|
|
Loading…
Reference in a new issue