mirror of
https://github.com/espressif/esp-idf.git
synced 2025-11-27 04:55:53 +00:00
mbedtls-3.0: Fixed ESP32 build issues
- Added MBEDLTS_PRIVATE(...) wherever necessary - For functions like mbedtls_pk_parse_key(...), it is necessary to pass the RNG function pointers as parameter. Solved for dependent components: wpa_supplicant & openSSL - For libcoap, the SSLv2 ClientHello handshake method has been deprecated, need to handle this. Currently, corresponding snippet has been commented. - Examples tested: hello-world | https_request | wifi_prov_mgr mbedtls-3.0: Fixed ESP32-C3 & ESP32-S3 build issues - Removed MBEDTLS_DEPRECATED_REMOVED macro from sha1 port - DS peripheral: esp_ds_rsa_sign -> removed unsused 'mode' argument - Added MBEDTLS_PRIVATE(...) wherever required mbedtls-3.0: Fixed ESP32-S2 build issues - Fixed outdated function prototypes and usage in mbedlts/port/aes/esp_aes_gcm.c due to changes in GCM module mbedtls-3.0: Fixed ESP32-H2 build issues ci: Fixing build stage - Added MBEDTLS_PRIVATE(...) wherever required - Added RNG function parameter - Updated GCM Module changes - Updated Copyright notices - Tests: - build_esp_idf_tests_cmake_esp32 - build_esp_idf_tests_cmake_esp32s2 - build_esp_idf_tests_cmake_esp32c3 - build_esp_idf_tests_cmake_esp32s3 ci: Fixing build stage (mbedtls-related changes) - Added MBEDTLS_PRIVATE(...) wherever required - Updated SHAXXX functions - Updated esp_config according to mbedtls changes - Tests: - build_examples_cmake_esp32 - build_examples_cmake_esp32s2 - build_examples_cmake_esp32c3 - build_examples_cmake_esp32s3 ci: Fixing build stage (example-related changes) - Added MBEDTLS_PRIVATE(...) wherever required - Updated SHAXXX functions - Updated esp_config according to mbedtls changes - Tests: - build_examples_cmake_esp32 - build_examples_cmake_esp32s2 - build_examples_cmake_esp32c3 - build_examples_cmake_esp32s3 ci: Fixing target_test stage - Updated test SSL version to TLS_v1_2 - Tests: - example_test_protocols 1/2 ci: Fixing build stage - Added checks for MBEDTLS_DHM_C (disabled by default) - Updated esp_cryptoauthlib submodule - Updated factory partition size for legacy BLE provisioning example - Tests: - build_examples_cmake_esp32 - build_examples_cmake_esp32s2 - build_examples_cmake_esp32c3 - build_examples_cmake_esp32s3 Co-authored-by: Laukik Hase <laukik.hase@espressif.com>
This commit is contained in:
@@ -3,7 +3,6 @@
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
#include "esp_mbedtls_dynamic_impl.h"
|
||||
|
||||
@@ -27,7 +26,7 @@ static const char *TAG = "SSL TLS";
|
||||
|
||||
static int tx_done(mbedtls_ssl_context *ssl)
|
||||
{
|
||||
if (!ssl->out_left)
|
||||
if (!ssl->MBEDTLS_PRIVATE(out_left))
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
@@ -35,7 +34,7 @@ static int tx_done(mbedtls_ssl_context *ssl)
|
||||
|
||||
static int rx_done(mbedtls_ssl_context *ssl)
|
||||
{
|
||||
if (!ssl->in_msglen) {
|
||||
if (!ssl->MBEDTLS_PRIVATE(in_msglen)) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -178,10 +177,12 @@ int __wrap_mbedtls_ssl_setup(mbedtls_ssl_context *ssl, const mbedtls_ssl_config
|
||||
ssl->conf = conf;
|
||||
CHECK_OK(ssl_handshake_init(ssl));
|
||||
|
||||
ssl->out_buf = NULL;
|
||||
mbedtls_free(ssl->MBEDTLS_PRIVATE(out_buf));
|
||||
ssl->MBEDTLS_PRIVATE(out_buf) = NULL;
|
||||
CHECK_OK(esp_mbedtls_setup_tx_buffer(ssl));
|
||||
|
||||
ssl->in_buf = NULL;
|
||||
mbedtls_free(ssl->MBEDTLS_PRIVATE(in_buf));
|
||||
ssl->MBEDTLS_PRIVATE(in_buf) = NULL;
|
||||
esp_mbedtls_setup_rx_buffer(ssl);
|
||||
|
||||
return 0;
|
||||
@@ -228,14 +229,14 @@ int __wrap_mbedtls_ssl_read(mbedtls_ssl_context *ssl, unsigned char *buf, size_t
|
||||
|
||||
void __wrap_mbedtls_ssl_free(mbedtls_ssl_context *ssl)
|
||||
{
|
||||
if (ssl->out_buf) {
|
||||
esp_mbedtls_free_buf(ssl->out_buf);
|
||||
ssl->out_buf = NULL;
|
||||
if (ssl->MBEDTLS_PRIVATE(out_buf)) {
|
||||
esp_mbedtls_free_buf(ssl->MBEDTLS_PRIVATE(out_buf));
|
||||
ssl->MBEDTLS_PRIVATE(out_buf) = NULL;
|
||||
}
|
||||
|
||||
if (ssl->in_buf) {
|
||||
esp_mbedtls_free_buf(ssl->in_buf);
|
||||
ssl->in_buf = NULL;
|
||||
if (ssl->MBEDTLS_PRIVATE(in_buf)) {
|
||||
esp_mbedtls_free_buf(ssl->MBEDTLS_PRIVATE(in_buf));
|
||||
ssl->MBEDTLS_PRIVATE(in_buf) = NULL;
|
||||
}
|
||||
|
||||
__real_mbedtls_ssl_free(ssl);
|
||||
|
||||
Reference in New Issue
Block a user