Merge branch 'bugfix/change_function_pointer_esp_crt_bundle_attach' into 'master'

esp_tls: change argument pointer type to (void *) for esp_crt_bundle_attach

See merge request espressif/esp-idf!7947
This commit is contained in:
Mahavir Jain 2020-03-11 19:39:47 +08:00
commit 1cde594460
3 changed files with 6 additions and 6 deletions

View file

@ -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 */

View file

@ -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;

View file

@ -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_
#endif //_ESP_CRT_BUNDLE_H_