diff --git a/3rdparty/everest/library/x25519.c b/3rdparty/everest/library/x25519.c index 6763d04aed..68b636f487 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_BAD_INPUT_DATA ); + return( MBEDTLS_ERR_ECP_BUFFER_TOO_SMALL ); /* scalarmult modifies this input, let's make a copy... */ unsigned char secret[MBEDTLS_X25519_KEY_SIZE_BYTES]; diff --git a/library/ecdh.c b/library/ecdh.c index 8f83fa842e..d0ebe3f9c5 100644 --- a/library/ecdh.c +++ b/library/ecdh.c @@ -649,7 +649,7 @@ static int ecdh_calc_secret_internal(mbedtls_ecdh_context_mbed *ctx, size_t p_bytes = ctx->grp.pbits / 8 + ((ctx->grp.pbits % 8) != 0); if (p_bytes > blen) { - return MBEDTLS_ERR_ECP_BAD_INPUT_DATA; + return MBEDTLS_ERR_ECP_BUFFER_TOO_SMALL; } *olen = p_bytes; diff --git a/tests/suites/test_suite_ecdh.function b/tests/suites/test_suite_ecdh.function index 9f469a4ed3..121ae4657a 100644 --- a/tests/suites/test_suite_ecdh.function +++ b/tests/suites/test_suite_ecdh.function @@ -441,7 +441,7 @@ void ecdh_exchange_calc_secret(int grp_id, /* Try again with an output buffer that's too short. */ TEST_CALLOC(buf, min_buf_size - 1); - TEST_EQUAL(MBEDTLS_ERR_ECP_BAD_INPUT_DATA, + TEST_EQUAL(MBEDTLS_ERR_ECP_BUFFER_TOO_SMALL, mbedtls_ecdh_calc_secret( &ecdh, &shared_secret_length, buf, min_buf_size - 1,