From f9f1bdfa7b2c6eca1e88174fd28235f3947b99f5 Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Wed, 23 Jun 2021 20:32:27 +0200 Subject: [PATCH] Translate MBEDTLS_ERR_PK_BUFFER_TOO_SMALL for PSA The error is currently never returned to any function that PSA calls, but keep mbedtls_to_psa_error up to date in case this changes. Signed-off-by: Gilles Peskine --- library/psa_crypto.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/library/psa_crypto.c b/library/psa_crypto.c index 4f932c6c7..7c90102f5 100644 --- a/library/psa_crypto.c +++ b/library/psa_crypto.c @@ -267,6 +267,8 @@ psa_status_t mbedtls_to_psa_error( int ret ) return( PSA_ERROR_NOT_SUPPORTED ); case MBEDTLS_ERR_PK_SIG_LEN_MISMATCH: return( PSA_ERROR_INVALID_SIGNATURE ); + case MBEDTLS_ERR_PK_BUFFER_TOO_SMALL: + return( PSA_ERROR_BUFFER_TOO_SMALL ); case MBEDTLS_ERR_PLATFORM_HW_ACCEL_FAILED: return( PSA_ERROR_HARDWARE_FAILURE );