tls: Modify tls optimize both mbedtls and wolfssl

pull/7307/head
liuhan 2021-04-14 16:30:54 +08:00 zatwierdzone przez bot
rodzic afc2bc94b3
commit 37e08d38a4
1 zmienionych plików z 10 dodań i 1 usunięć
components/tcp_transport

Wyświetl plik

@ -309,18 +309,19 @@ static int base_destroy(esp_transport_handle_t t)
return 0;
}
void esp_transport_ssl_enable_global_ca_store(esp_transport_handle_t t)
{
GET_SSL_FROM_TRANSPORT_OR_RETURN(ssl, t);
ssl->cfg.use_global_ca_store = true;
}
#ifdef CONFIG_ESP_TLS_PSK_VERIFICATION
void esp_transport_ssl_set_psk_key_hint(esp_transport_handle_t t, const psk_hint_key_t* psk_hint_key)
{
GET_SSL_FROM_TRANSPORT_OR_RETURN(ssl, t);
ssl->cfg.psk_hint_key = psk_hint_key;
}
#endif
void esp_transport_ssl_set_cert_data(esp_transport_handle_t t, const char *data, int len)
{
@ -371,11 +372,13 @@ void esp_transport_ssl_set_client_key_data_der(esp_transport_handle_t t, const c
ssl->cfg.clientkey_bytes = len;
}
#if defined(CONFIG_MBEDTLS_SSL_ALPN) || defined(CONFIG_WOLFSSL_HAVE_ALPN)
void esp_transport_ssl_set_alpn_protocol(esp_transport_handle_t t, const char **alpn_protos)
{
GET_SSL_FROM_TRANSPORT_OR_RETURN(ssl, t);
ssl->cfg.alpn_protos = alpn_protos;
}
#endif
void esp_transport_ssl_skip_common_name_check(esp_transport_handle_t t)
{
@ -383,17 +386,21 @@ void esp_transport_ssl_skip_common_name_check(esp_transport_handle_t t)
ssl->cfg.skip_common_name = true;
}
#ifdef CONFIG_ESP_TLS_USE_SECURE_ELEMENT
void esp_transport_ssl_use_secure_element(esp_transport_handle_t t)
{
GET_SSL_FROM_TRANSPORT_OR_RETURN(ssl, t);
ssl->cfg.use_secure_element = true;
}
#endif
#ifdef CONFIG_MBEDTLS_CERTIFICATE_BUNDLE
void esp_transport_ssl_crt_bundle_attach(esp_transport_handle_t t, esp_err_t ((*crt_bundle_attach)(void *conf)))
{
GET_SSL_FROM_TRANSPORT_OR_RETURN(ssl, t);
ssl->cfg.crt_bundle_attach = crt_bundle_attach;
}
#endif
static int base_get_socket(esp_transport_handle_t t)
{
@ -404,11 +411,13 @@ static int base_get_socket(esp_transport_handle_t t)
return INVALID_SOCKET;
}
#ifdef CONFIG_ESP_TLS_USE_DS_PERIPHERAL
void esp_transport_ssl_set_ds_data(esp_transport_handle_t t, void *ds_data)
{
GET_SSL_FROM_TRANSPORT_OR_RETURN(ssl, t);
ssl->cfg.ds_data = ds_data;
}
#endif
void esp_transport_ssl_set_keep_alive(esp_transport_handle_t t, esp_transport_keep_alive_t *keep_alive_cfg)
{