From a2ca5fb23a2c16d09f0283d425c5e029c2c80f33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= Date: Tue, 31 Mar 2026 10:28:45 +0200 Subject: [PATCH] ECDH: Everest: align error code with ecdh.c MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Arguably the value returned by Everest was more precise, but considering we're in an LTS branch, I'd rather not change the value returned by ecdh.c, and align the special case on the general case. The added tests made it apparent that Everest and the generic code were not returning the same value here. Alignment between the two values is desirable to keep the test code simple and sweet. Signed-off-by: Manuel Pégourié-Gonnard --- 3rdparty/everest/library/x25519.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/3rdparty/everest/library/x25519.c b/3rdparty/everest/library/x25519.c index 68b636f487..6763d04aed 100644 --- a/3rdparty/everest/library/x25519.c +++ b/3rdparty/everest/library/x25519.c @@ -129,7 +129,7 @@ int mbedtls_x25519_calc_secret( mbedtls_x25519_context *ctx, size_t *olen, *olen = MBEDTLS_X25519_KEY_SIZE_BYTES; if( blen < *olen ) - return( MBEDTLS_ERR_ECP_BUFFER_TOO_SMALL ); + return( MBEDTLS_ERR_ECP_BAD_INPUT_DATA ); /* scalarmult modifies this input, let's make a copy... */ unsigned char secret[MBEDTLS_X25519_KEY_SIZE_BYTES];