Skip to content

Commit 7b6dcda

Browse files
committed
feat(esp-tls): Update headers for improved wolfssl support
1 parent 25c40d4 commit 7b6dcda

File tree

2 files changed

+20
-5
lines changed

2 files changed

+20
-5
lines changed

components/esp-tls/private_include/esp_tls_private.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@
3232
#elif CONFIG_ESP_TLS_USING_WOLFSSL
3333
#include "wolfssl/wolfcrypt/settings.h"
3434
#include "wolfssl/ssl.h"
35+
#include "wolfssl/openssl/x509.h"
36+
#include "wolfssl/wolfcrypt/port/Espressif/esp_crt_bundle.h"
37+
#include "private_include/esp_tls_wolfssl.h"
3538
#endif
3639

3740
struct esp_tls {
@@ -74,6 +77,11 @@ struct esp_tls {
7477
size_t client_session_len; /*!< Length of the serialized client session ticket context. */
7578
#endif /* CONFIG_MBEDTLS_SSL_PROTO_TLS1_3 && CONFIG_ESP_TLS_CLIENT_SESSION_TICKETS */
7679
#elif CONFIG_ESP_TLS_USING_WOLFSSL
80+
#ifndef WOLFSSL_NO_CONF_COMPATIBILITY
81+
wolfssl_ssl_config conf;
82+
void (*sync)(struct esp_tls*);
83+
#endif
84+
7785
void *priv_ctx;
7886
void *priv_ssl;
7987
#endif

components/esp-tls/private_include/esp_tls_wolfssl.h

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@
77
#pragma once
88
#include "esp_tls.h"
99
#include "esp_tls_private.h"
10+
#ifdef CONFIG_ESP_TLS_USING_WOLFSSL
11+
12+
/* wolfssl_ssl_config is ESP-IDF specific helper for Certificate Bundles */
13+
#include "wolfssl/wolfcrypt/settings.h"
14+
#include "wolfssl/ssl.h"
15+
#include "wolfssl/openssl/x509.h"
16+
1017

1118
/**
1219
* Internal Callback for creating ssl handle for wolfssl
@@ -72,10 +79,7 @@ void *esp_wolfssl_get_ssl_context(esp_tls_t *tls);
7279
/**
7380
* wolfSSL function for Initializing socket wrappers (no-operation for wolfSSL)
7481
*/
75-
static inline void esp_wolfssl_net_init(esp_tls_t *tls)
76-
{
77-
}
78-
82+
void esp_wolfssl_net_init(esp_tls_t *tls);
7983

8084
/**
8185
* 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
8589
/*
8690
* Delete Server Session
8791
*/
88-
void esp_wolfssl_server_session_delete(esp_tls_t *tls);
92+
int esp_wolfssl_server_session_delete(esp_tls_t *tls);
93+
94+
95+
#endif /* CONFIG_ESP_TLS_USING_WOLFSSL */

0 commit comments

Comments
 (0)