From 874e987a3b8dc191e3599ccab94e4d4dc5f90342 Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Wed, 11 Mar 2020 15:48:34 +0530 Subject: [PATCH] esp_tls: change argument pointer type to (void *) for esp_crt_bundle_attach --- components/esp-tls/esp_tls.h | 2 +- components/mbedtls/esp_crt_bundle/esp_crt_bundle.c | 6 +++--- components/mbedtls/esp_crt_bundle/include/esp_crt_bundle.h | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/components/esp-tls/esp_tls.h b/components/esp-tls/esp_tls.h index f52eb3b79..a5983b2e3 100644 --- a/components/esp-tls/esp_tls.h +++ b/components/esp-tls/esp_tls.h @@ -197,7 +197,7 @@ typedef struct esp_tls_cfg { then PSK authentication is enabled with configured setup. Important note: the pointer must be valid for connection */ - esp_err_t (*crt_bundle_attach)(mbedtls_ssl_config *conf); + esp_err_t (*crt_bundle_attach)(void *conf); /*!< Function pointer to esp_crt_bundle_attach. Enables the use of certification bundle for server verification, must be enabled in menuconfig */ diff --git a/components/mbedtls/esp_crt_bundle/esp_crt_bundle.c b/components/mbedtls/esp_crt_bundle/esp_crt_bundle.c index b4019e5dd..6d99f781c 100644 --- a/components/mbedtls/esp_crt_bundle/esp_crt_bundle.c +++ b/components/mbedtls/esp_crt_bundle/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(mbedtls_ssl_config *conf) +esp_err_t 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 @@ -195,8 +195,8 @@ esp_err_t esp_crt_bundle_attach(mbedtls_ssl_config *conf) * cacert_ptr passes non-NULL check during handshake */ mbedtls_x509_crt_init(&s_dummy_crt); - conf->ca_chain = &s_dummy_crt; - mbedtls_ssl_conf_verify(conf, esp_crt_verify_callback, NULL); + ((mbedtls_ssl_config *)conf)->ca_chain = &s_dummy_crt; + mbedtls_ssl_conf_verify((mbedtls_ssl_config *)conf, esp_crt_verify_callback, NULL); } return ret; diff --git a/components/mbedtls/esp_crt_bundle/include/esp_crt_bundle.h b/components/mbedtls/esp_crt_bundle/include/esp_crt_bundle.h index a3a691ce5..38fff5463 100644 --- a/components/mbedtls/esp_crt_bundle/include/esp_crt_bundle.h +++ b/components/mbedtls/esp_crt_bundle/include/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(mbedtls_ssl_config *conf); +esp_err_t esp_crt_bundle_attach(void *conf); /** @@ -64,4 +64,4 @@ void esp_crt_bundle_set(const uint8_t *x509_bundle); } #endif -#endif //_ESP_CRT_BUNDLE_H_ \ No newline at end of file +#endif //_ESP_CRT_BUNDLE_H_