Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix conflict with ESP-IDF's esp_crt_bundle #7560

Merged
merged 4 commits into from
Dec 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions libraries/WiFiClientSecure/src/WiFiClientSecure.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -264,10 +264,10 @@ void WiFiClientSecure::setCACert (const char *rootCA)
{
if (bundle != NULL)
{
esp_crt_bundle_set(bundle);
arduino_esp_crt_bundle_set(bundle);
_use_ca_bundle = true;
} else {
esp_crt_bundle_detach(NULL);
arduino_esp_crt_bundle_detach(NULL);
_use_ca_bundle = false;
}
}
Expand Down
6 changes: 3 additions & 3 deletions libraries/WiFiClientSecure/src/esp_crt_bundle.c
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ static esp_err_t esp_crt_bundle_init(const uint8_t *x509_bundle)
return ESP_OK;
}

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

void esp_crt_bundle_detach(mbedtls_ssl_config *conf)
void arduino_esp_crt_bundle_detach(mbedtls_ssl_config *conf)
{
free(s_crt_bundle.crts);
s_crt_bundle.crts = NULL;
Expand All @@ -208,7 +208,7 @@ void esp_crt_bundle_detach(mbedtls_ssl_config *conf)
}
}

void esp_crt_bundle_set(const uint8_t *x509_bundle)
void arduino_esp_crt_bundle_set(const uint8_t *x509_bundle)
{
// Free any previously used bundle
free(s_crt_bundle.crts);
Expand Down
6 changes: 3 additions & 3 deletions libraries/WiFiClientSecure/src/esp_crt_bundle.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ extern "C" {
* - ESP_OK if adding certificates was successful.
* - Other if an error occured or an action must be taken by the calling process.
*/
esp_err_t esp_crt_bundle_attach(void *conf);
esp_err_t arduino_esp_crt_bundle_attach(void *conf);


/**
Expand All @@ -46,7 +46,7 @@ esp_err_t esp_crt_bundle_attach(void *conf);
*
* @param[in] conf The config struct for the SSL connection.
*/
void esp_crt_bundle_detach(mbedtls_ssl_config *conf);
void arduino_esp_crt_bundle_detach(mbedtls_ssl_config *conf);


/**
Expand All @@ -58,7 +58,7 @@ void esp_crt_bundle_detach(mbedtls_ssl_config *conf);
*
* @param[in] x509_bundle A pointer to the certificate bundle.
*/
void esp_crt_bundle_set(const uint8_t *x509_bundle);
void arduino_esp_crt_bundle_set(const uint8_t *x509_bundle);


#ifdef __cplusplus
Expand Down
2 changes: 1 addition & 1 deletion libraries/WiFiClientSecure/src/ssl_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ int start_ssl_client(sslclient_context *ssl_client, const char *host, uint32_t p
}
} else if (useRootCABundle) {
log_v("Attaching root CA cert bundle");
ret = esp_crt_bundle_attach(&ssl_client->ssl_conf);
ret = arduino_esp_crt_bundle_attach(&ssl_client->ssl_conf);

if (ret < 0) {
return handle_error(ret);
Expand Down