/* * SPDX-FileCopyrightText: 2021-2023 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 *//* ... */#pragmaonce/** * @brief ESP-TLS Connection Handle *//* ... */#include<stdbool.h>#include<sys/socket.h>#include<fcntl.h>#include"esp_err.h"#include"esp_tls_errors.h"5 includes#ifdefCONFIG_ESP_TLS_USING_MBEDTLS#include"mbedtls/platform.h"#include"mbedtls/net_sockets.h"#include"mbedtls/esp_debug.h"#include"mbedtls/ssl.h"#include"mbedtls/entropy.h"#include"mbedtls/ctr_drbg.h"#include"mbedtls/error.h"7 includes#ifdefCONFIG_ESP_TLS_SERVER_SESSION_TICKETS#include"mbedtls/ssl_ticket.h"#endif#ifdefCONFIG_MBEDTLS_SSL_PROTO_TLS1_3#include"psa/crypto.h"#endif/* ... */#elifCONFIG_ESP_TLS_USING_WOLFSSL#include"wolfssl/wolfcrypt/settings.h"#include"wolfssl/ssl.h"/* ... */#endifstructesp_tls{#ifdefCONFIG_ESP_TLS_USING_MBEDTLSmbedtls_ssl_contextssl;/*!< TLS/SSL context */mbedtls_entropy_contextentropy;/*!< mbedTLS entropy context structure */mbedtls_ctr_drbg_contextctr_drbg;/*!< mbedTLS ctr drbg context structure. CTR_DRBG is deterministic random bit generation based on AES-256 *//* ... */mbedtls_ssl_configconf;/*!< TLS/SSL configuration to be shared between mbedtls_ssl_context structures *//* ... */mbedtls_net_contextserver_fd;/*!< mbedTLS wrapper type for sockets */mbedtls_x509_crtcacert;/*!< Container for the X.509 CA certificate */mbedtls_x509_crt*cacert_ptr;/*!< Pointer to the cacert being used. */union{mbedtls_x509_crtclientcert;/*!< Container for the X.509 client certificate */mbedtls_x509_crtservercert;/*!< Container for the X.509 server certificate */}{ ... };union{mbedtls_pk_contextclientkey;/*!< Container for the private key of the client certificate *//* ... */mbedtls_pk_contextserverkey;/*!< Container for the private key of the server certificate *//* ... */}{ ... };#ifdefCONFIG_MBEDTLS_HARDWARE_ECDSA_SIGNbooluse_ecdsa_peripheral;/*!< Use the ECDSA peripheral for the private key operations. */uint8_tecdsa_efuse_blk;/*!< The efuse block number where the ECDSA key is stored. *//* ... */#endif/* ... */#elifCONFIG_ESP_TLS_USING_WOLFSSLvoid*priv_ctx;void*priv_ssl;/* ... */#endifintsockfd;/*!< Underlying socket file descriptor. */ssize_t(*read)(esp_tls_t*tls,char*data,size_tdatalen);/*!< Callback function for reading data from TLS/SSL connection. *//* ... */ssize_t(*write)(esp_tls_t*tls,constchar*data,size_tdatalen);/*!< Callback function for writing data to TLS/SSL connection. *//* ... */esp_tls_conn_state_tconn_state;/*!< ESP-TLS Connection state */fd_setrset;/*!< read file descriptors */fd_setwset;/*!< write file descriptors */boolis_tls;/*!< indicates connection type (TLS or NON-TLS) */esp_tls_role_trole;/*!< esp-tls role - ESP_TLS_CLIENT - ESP_TLS_SERVER *//* ... */esp_tls_error_handle_terror_handle;/*!< handle to error descriptor */}{ ... };// Function pointer for the server configuration APItypedefesp_err_t(*set_server_config_func_ptr)(esp_tls_cfg_server_t*cfg,esp_tls_t*tls);// This struct contains any data that is only specific to the server session and not required by the client.typedefstructesp_tls_server_params{set_server_config_func_ptrset_server_cfg;}{ ... }esp_tls_server_params_t;
Details
Show: from
Types: Columns:
All items filtered out
All items filtered out
This file uses the notable symbols shown below. Click anywhere in the file to view more details.