From fe628d59513534d19f3d652c48879dda87e75a36 Mon Sep 17 00:00:00 2001
From: "nilesh.kale" <nilesh.kale@espressif.com>
Date: Wed, 3 Apr 2024 11:45:09 +0530
Subject: [PATCH] feat(mbedtls): updated mbedtls version from 3.5.2 to 3.6.0

This MR updated MbedTLS version to latest version 3.6.0.
---
 components/mbedtls/mbedtls            |  2 +-
 components/mbedtls/port/ecc/ecc_alt.c | 12 ++++--------
 2 files changed, 5 insertions(+), 9 deletions(-)

diff --git a/components/mbedtls/mbedtls b/components/mbedtls/mbedtls
index 09bba150d0d8..72aa687352a4 160000
--- a/components/mbedtls/mbedtls
+++ b/components/mbedtls/mbedtls
@@ -1 +1 @@
-Subproject commit 09bba150d0d822aad2e58d71723f5407da5c21e0
+Subproject commit 72aa687352a469044cbb946f3fdb261430e41ce1
diff --git a/components/mbedtls/port/ecc/ecc_alt.c b/components/mbedtls/port/ecc/ecc_alt.c
index ad3c1d63e9cf..ef0b76fe05af 100644
--- a/components/mbedtls/port/ecc/ecc_alt.c
+++ b/components/mbedtls/port/ecc/ecc_alt.c
@@ -1,5 +1,5 @@
 /*
- * SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
+ * SPDX-FileCopyrightText: 2021-2024 Espressif Systems (Shanghai) CO LTD
  *
  * SPDX-License-Identifier: Apache-2.0
  */
@@ -11,11 +11,6 @@
 #include "mbedtls/ecp.h"
 #include "mbedtls/platform_util.h"
 
-#define ECP_VALIDATE_RET( cond )    \
-    MBEDTLS_INTERNAL_VALIDATE_RET( cond, MBEDTLS_ERR_ECP_BAD_INPUT_DATA )
-#define ECP_VALIDATE( cond )        \
-    MBEDTLS_INTERNAL_VALIDATE( cond )
-
 #if defined(MBEDTLS_ECP_MUL_ALT) || defined(MBEDTLS_ECP_MUL_ALT_SOFT_FALLBACK)
 
 #define MAX_SIZE            32     // 256 bits
@@ -94,8 +89,9 @@ int mbedtls_ecp_check_pubkey( const mbedtls_ecp_group *grp,
 #endif
     }
 
-    ECP_VALIDATE_RET( grp != NULL );
-    ECP_VALIDATE_RET( pt  != NULL );
+    if (grp == NULL || pt == NULL) {
+        return MBEDTLS_ERR_ECP_BAD_INPUT_DATA;
+    }
 
     /* Must use affine coordinates */
     if( mbedtls_mpi_cmp_int( &pt->MBEDTLS_PRIVATE(Z), 1 ) != 0 )