From adfeadc6e5faa72ca6a4c5c4d434e2baab4c70a8 Mon Sep 17 00:00:00 2001 From: Gabor Mezei Date: Mon, 21 Mar 2022 12:17:49 +0100 Subject: [PATCH] Extend PSA error translation Add new error codes to the PSA to mbedtls error translation. Signed-off-by: Gabor Mezei --- library/ssl_misc.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/library/ssl_misc.h b/library/ssl_misc.h index be01eba33a..eb3f2e97b6 100644 --- a/library/ssl_misc.h +++ b/library/ssl_misc.h @@ -2137,6 +2137,10 @@ static inline int psa_ssl_status_to_mbedtls( psa_status_t status ) return( MBEDTLS_ERR_CIPHER_FEATURE_UNAVAILABLE ); case PSA_ERROR_INVALID_SIGNATURE: return( MBEDTLS_ERR_SSL_INVALID_MAC ); + case PSA_ERROR_INVALID_ARGUMENT: + return( MBEDTLS_ERR_SSL_BAD_INPUT_DATA ); + case PSA_ERROR_BAD_STATE: + return( MBEDTLS_ERR_SSL_INTERNAL_ERROR ); default: return( MBEDTLS_ERR_PLATFORM_HW_ACCEL_FAILED ); }