From 7b6dcdab8b434f25ae92c46f2db7100744f3e325 Mon Sep 17 00:00:00 2001 From: gojimmypi Date: Wed, 1 Oct 2025 10:37:42 -0700 Subject: [PATCH] feat(esp-tls): Update headers for improved wolfssl support --- .../esp-tls/private_include/esp_tls_private.h | 8 ++++++++ .../esp-tls/private_include/esp_tls_wolfssl.h | 17 ++++++++++++----- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/components/esp-tls/private_include/esp_tls_private.h b/components/esp-tls/private_include/esp_tls_private.h index 728b538d13a5..da7cbd048745 100644 --- a/components/esp-tls/private_include/esp_tls_private.h +++ b/components/esp-tls/private_include/esp_tls_private.h @@ -32,6 +32,9 @@ #elif CONFIG_ESP_TLS_USING_WOLFSSL #include "wolfssl/wolfcrypt/settings.h" #include "wolfssl/ssl.h" +#include "wolfssl/openssl/x509.h" +#include "wolfssl/wolfcrypt/port/Espressif/esp_crt_bundle.h" +#include "private_include/esp_tls_wolfssl.h" #endif struct esp_tls { @@ -74,6 +77,11 @@ struct esp_tls { size_t client_session_len; /*!< Length of the serialized client session ticket context. */ #endif /* CONFIG_MBEDTLS_SSL_PROTO_TLS1_3 && CONFIG_ESP_TLS_CLIENT_SESSION_TICKETS */ #elif CONFIG_ESP_TLS_USING_WOLFSSL + #ifndef WOLFSSL_NO_CONF_COMPATIBILITY + wolfssl_ssl_config conf; + void (*sync)(struct esp_tls*); + #endif + void *priv_ctx; void *priv_ssl; #endif diff --git a/components/esp-tls/private_include/esp_tls_wolfssl.h b/components/esp-tls/private_include/esp_tls_wolfssl.h index 121c13477f2d..cc9ccb95993c 100644 --- a/components/esp-tls/private_include/esp_tls_wolfssl.h +++ b/components/esp-tls/private_include/esp_tls_wolfssl.h @@ -7,6 +7,13 @@ #pragma once #include "esp_tls.h" #include "esp_tls_private.h" +#ifdef CONFIG_ESP_TLS_USING_WOLFSSL + +/* wolfssl_ssl_config is ESP-IDF specific helper for Certificate Bundles */ +#include "wolfssl/wolfcrypt/settings.h" +#include "wolfssl/ssl.h" +#include "wolfssl/openssl/x509.h" + /** * Internal Callback for creating ssl handle for wolfssl @@ -72,10 +79,7 @@ void *esp_wolfssl_get_ssl_context(esp_tls_t *tls); /** * wolfSSL function for Initializing socket wrappers (no-operation for wolfSSL) */ -static inline void esp_wolfssl_net_init(esp_tls_t *tls) -{ -} - +void esp_wolfssl_net_init(esp_tls_t *tls); /** * Function to Create ESP-TLS Server session with wolfssl Stack @@ -85,4 +89,7 @@ int esp_wolfssl_server_session_create(esp_tls_cfg_server_t *cfg, int sockfd, esp /* * Delete Server Session */ -void esp_wolfssl_server_session_delete(esp_tls_t *tls); +int esp_wolfssl_server_session_delete(esp_tls_t *tls); + + +#endif /* CONFIG_ESP_TLS_USING_WOLFSSL */