Skip to content

Commit 7c09346

Browse files
authored
Fix conflict with ESP-IDF's esp_crt_bundle (#7560)
1 parent deca150 commit 7c09346

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

Diff for: libraries/WiFiClientSecure/src/WiFiClientSecure.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -264,10 +264,10 @@ void WiFiClientSecure::setCACert (const char *rootCA)
264264
{
265265
if (bundle != NULL)
266266
{
267-
esp_crt_bundle_set(bundle);
267+
arduino_esp_crt_bundle_set(bundle);
268268
_use_ca_bundle = true;
269269
} else {
270-
esp_crt_bundle_detach(NULL);
270+
arduino_esp_crt_bundle_detach(NULL);
271271
_use_ca_bundle = false;
272272
}
273273
}

Diff for: libraries/WiFiClientSecure/src/esp_crt_bundle.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ static esp_err_t esp_crt_bundle_init(const uint8_t *x509_bundle)
176176
return ESP_OK;
177177
}
178178

179-
esp_err_t esp_crt_bundle_attach(void *conf)
179+
esp_err_t arduino_esp_crt_bundle_attach(void *conf)
180180
{
181181
esp_err_t ret = ESP_OK;
182182
// If no bundle has been set by the user then use the bundle embedded in the binary
@@ -199,7 +199,7 @@ esp_err_t esp_crt_bundle_attach(void *conf)
199199
return ret;
200200
}
201201

202-
void esp_crt_bundle_detach(mbedtls_ssl_config *conf)
202+
void arduino_esp_crt_bundle_detach(mbedtls_ssl_config *conf)
203203
{
204204
free(s_crt_bundle.crts);
205205
s_crt_bundle.crts = NULL;
@@ -208,7 +208,7 @@ void esp_crt_bundle_detach(mbedtls_ssl_config *conf)
208208
}
209209
}
210210

211-
void esp_crt_bundle_set(const uint8_t *x509_bundle)
211+
void arduino_esp_crt_bundle_set(const uint8_t *x509_bundle)
212212
{
213213
// Free any previously used bundle
214214
free(s_crt_bundle.crts);

Diff for: libraries/WiFiClientSecure/src/esp_crt_bundle.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ extern "C" {
3636
* - ESP_OK if adding certificates was successful.
3737
* - Other if an error occured or an action must be taken by the calling process.
3838
*/
39-
esp_err_t esp_crt_bundle_attach(void *conf);
39+
esp_err_t arduino_esp_crt_bundle_attach(void *conf);
4040

4141

4242
/**
@@ -46,7 +46,7 @@ esp_err_t esp_crt_bundle_attach(void *conf);
4646
*
4747
* @param[in] conf The config struct for the SSL connection.
4848
*/
49-
void esp_crt_bundle_detach(mbedtls_ssl_config *conf);
49+
void arduino_esp_crt_bundle_detach(mbedtls_ssl_config *conf);
5050

5151

5252
/**
@@ -58,7 +58,7 @@ void esp_crt_bundle_detach(mbedtls_ssl_config *conf);
5858
*
5959
* @param[in] x509_bundle A pointer to the certificate bundle.
6060
*/
61-
void esp_crt_bundle_set(const uint8_t *x509_bundle);
61+
void arduino_esp_crt_bundle_set(const uint8_t *x509_bundle);
6262

6363

6464
#ifdef __cplusplus

Diff for: libraries/WiFiClientSecure/src/ssl_client.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ int start_ssl_client(sslclient_context *ssl_client, const char *host, uint32_t p
193193
}
194194
} else if (useRootCABundle) {
195195
log_v("Attaching root CA cert bundle");
196-
ret = esp_crt_bundle_attach(&ssl_client->ssl_conf);
196+
ret = arduino_esp_crt_bundle_attach(&ssl_client->ssl_conf);
197197

198198
if (ret < 0) {
199199
return handle_error(ret);

0 commit comments

Comments
 (0)