From 30ebe11f869ef6c04396e77bc091ca2d31a45c17 Mon Sep 17 00:00:00 2001 From: Valerio Setti Date: Thu, 17 Nov 2022 16:23:34 +0100 Subject: [PATCH] tls: psa_pake: add a check on read size on both rounds Signed-off-by: Valerio Setti --- library/ssl_tls.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/library/ssl_tls.c b/library/ssl_tls.c index 35262cb885..06a5ec53dc 100644 --- a/library/ssl_tls.c +++ b/library/ssl_tls.c @@ -8231,6 +8231,9 @@ int mbedtls_psa_ecjpake_read_round_one( } } + if ( input_offset != len ) + return PSA_ERROR_INVALID_ARGUMENT; + return( 0 ); } @@ -8286,6 +8289,9 @@ int mbedtls_psa_ecjpake_read_round_two( input_offset += length; } + if ( input_offset != len ) + return PSA_ERROR_INVALID_ARGUMENT; + return( 0 ); }