psa_export_public_key_internal: add missing check for FFDH key type
Signed-off-by: Przemek Stekiel <przemyslaw.stekiel@mobica.com>
This commit is contained in:
parent
a9ca13136c
commit
c829816fb6
1 changed files with 3 additions and 2 deletions
|
@ -1457,15 +1457,16 @@ psa_status_t psa_export_public_key_internal(
|
|||
}
|
||||
#if defined(MBEDTLS_PSA_BUILTIN_KEY_TYPE_FFDH_KEY_PAIR) || \
|
||||
defined(MBEDTLS_PSA_BUILTIN_KEY_TYPE_FFDH_PUBLIC_KEY)
|
||||
else {
|
||||
else if (PSA_KEY_TYPE_IS_DH(type)) {
|
||||
return mbedtls_psa_export_ffdh_public_key(attributes,
|
||||
key_buffer,
|
||||
key_buffer_size,
|
||||
data, data_size,
|
||||
data_length);
|
||||
} else {
|
||||
return PSA_ERROR_NOT_SUPPORTED;
|
||||
}
|
||||
#else
|
||||
/* We don't know how to convert a private FFDH key to public */
|
||||
return PSA_ERROR_NOT_SUPPORTED;
|
||||
#endif /* defined(MBEDTLS_PSA_BUILTIN_KEY_TYPE_FFDH_KEY_PAIR) ||
|
||||
* defined(MBEDTLS_PSA_BUILTIN_KEY_TYPE_FFDH_PUBLIC_KEY) */
|
||||
|
|
Loading…
Reference in a new issue