Always include platform.h for MBEDTLS_ERR_PLATFORM_xxx

Recognize MBEDTLS_ERR_PLATFORM_xxx in mbedtls_to_psa_error().
This commit is contained in:
Gilles Peskine 2019-05-06 15:26:23 +02:00
parent 423005ea93
commit ff2d200fa5

View file

@ -39,9 +39,8 @@
#include <stdlib.h>
#include <string.h>
#if defined(MBEDTLS_PLATFORM_C)
#include "mbedtls/platform.h"
#else
#if !defined(MBEDTLS_PLATFORM_C)
#define mbedtls_calloc calloc
#define mbedtls_free free
#endif
@ -284,6 +283,11 @@ static psa_status_t mbedtls_to_psa_error( int ret )
case MBEDTLS_ERR_PK_HW_ACCEL_FAILED:
return( PSA_ERROR_HARDWARE_FAILURE );
case MBEDTLS_ERR_PLATFORM_HW_ACCEL_FAILED:
return( PSA_ERROR_HARDWARE_FAILURE );
case MBEDTLS_ERR_PLATFORM_FEATURE_UNSUPPORTED:
return( PSA_ERROR_NOT_SUPPORTED );
case MBEDTLS_ERR_RIPEMD160_HW_ACCEL_FAILED:
return( PSA_ERROR_HARDWARE_FAILURE );