mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-03-25 13:43:31 +00:00
Fix checks for key type in psa_export_public_key_iop_setup()
Key type must be a key pair or public-key if not we return PSA_ERROR_INVALID_ARGUMENT. The key type must be ECC key as this is what we support for now otherwise we return PSA_ERROR_NOT_SUPPORTED. Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
This commit is contained in:
parent
4cffd5d4f3
commit
f466a284c1
@ -1717,12 +1717,14 @@ psa_status_t psa_export_public_key_iop_setup(psa_export_public_key_iop_t *operat
|
||||
|
||||
private_key_type = psa_get_key_type(&private_key_attributes);
|
||||
|
||||
if (!PSA_KEY_TYPE_IS_KEY_PAIR(private_key_type)) {
|
||||
if (!PSA_KEY_TYPE_IS_KEY_PAIR(private_key_type) &&
|
||||
!PSA_KEY_TYPE_IS_PUBLIC_KEY(private_key_type)) {
|
||||
status = PSA_ERROR_INVALID_ARGUMENT;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (!PSA_KEY_TYPE_IS_ECC_KEY_PAIR(private_key_type)) {
|
||||
if (!PSA_KEY_TYPE_IS_ECC_KEY_PAIR(private_key_type) &&
|
||||
!PSA_KEY_TYPE_IS_ECC_PUBLIC_KEY(private_key_type)) {
|
||||
status = PSA_ERROR_NOT_SUPPORTED;
|
||||
goto exit;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user