From b556a426561ef676ca309d3c336aab0138c1a9a6 Mon Sep 17 00:00:00 2001 From: Neil Armstrong Date: Fri, 25 Feb 2022 08:58:12 +0100 Subject: [PATCH] Use now shared RSA_PRV_DER_MAX_BYTES define in pk_wrap.c Signed-off-by: Neil Armstrong --- library/pk_wrap.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/library/pk_wrap.c b/library/pk_wrap.c index 1735dd76e6..33200782e8 100644 --- a/library/pk_wrap.c +++ b/library/pk_wrap.c @@ -225,9 +225,7 @@ static int rsa_decrypt_wrap( void *ctx, psa_status_t status; mbedtls_pk_context key; int key_len; - /* see RSA_PRV_DER_MAX_BYTES in pkwrite.c */ - unsigned char buf[47 + 3 * MBEDTLS_MPI_MAX_SIZE + \ - 5 * ( MBEDTLS_MPI_MAX_SIZE / 2 + MBEDTLS_MPI_MAX_SIZE % 2 )]; + unsigned char buf[MBEDTLS_PK_RSA_PRV_DER_MAX_BYTES]; mbedtls_pk_info_t pk_info = mbedtls_rsa_info; psa_algorithm_t psa_sig_md;