diff --git a/libraries/WiFiClientSecure/src/WiFiClientSecure.cpp b/libraries/WiFiClientSecure/src/WiFiClientSecure.cpp index 101252c125f..a6814b0a60b 100644 --- a/libraries/WiFiClientSecure/src/WiFiClientSecure.cpp +++ b/libraries/WiFiClientSecure/src/WiFiClientSecure.cpp @@ -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; } } diff --git a/libraries/WiFiClientSecure/src/esp_crt_bundle.c b/libraries/WiFiClientSecure/src/esp_crt_bundle.c index 9a555b218d0..82a0708662c 100644 --- a/libraries/WiFiClientSecure/src/esp_crt_bundle.c +++ b/libraries/WiFiClientSecure/src/esp_crt_bundle.c @@ -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 @@ -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; @@ -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); diff --git a/libraries/WiFiClientSecure/src/esp_crt_bundle.h b/libraries/WiFiClientSecure/src/esp_crt_bundle.h index 33fb98b9969..a1d95194af4 100644 --- a/libraries/WiFiClientSecure/src/esp_crt_bundle.h +++ b/libraries/WiFiClientSecure/src/esp_crt_bundle.h @@ -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); /** @@ -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); /** @@ -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 diff --git a/libraries/WiFiClientSecure/src/ssl_client.cpp b/libraries/WiFiClientSecure/src/ssl_client.cpp index 95e4f023d93..299c47beaf1 100644 --- a/libraries/WiFiClientSecure/src/ssl_client.cpp +++ b/libraries/WiFiClientSecure/src/ssl_client.cpp @@ -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);