11/*
2- * SPDX-FileCopyrightText: 2017-2023 Espressif Systems (Shanghai) CO LTD
2+ * SPDX-FileCopyrightText: 2017-2024 Espressif Systems (Shanghai) CO LTD
33 *
44 * SPDX-License-Identifier: Apache-2.0
55 */
@@ -187,9 +187,11 @@ typedef struct esp_tls_cfg {
187187
188188 tls_keep_alive_cfg_t * keep_alive_cfg ; /*!< Enable TCP keep-alive timeout for SSL connection */
189189
190+ #if defined(CONFIG_ESP_TLS_PSK_VERIFICATION )
190191 const psk_hint_key_t * psk_hint_key ; /*!< Pointer to PSK hint and key. if not NULL (and certificates are NULL)
191192 then PSK authentication is enabled with configured setup.
192193 Important note: the pointer must be valid for connection */
194+ #endif /* CONFIG_ESP_TLS_PSK_VERIFICATION */
193195
194196 esp_err_t (* crt_bundle_attach )(void * conf );
195197 /*!< Function pointer to esp_crt_bundle_attach. Enables the use of certification
@@ -322,6 +324,12 @@ typedef struct esp_tls_cfg_server {
322324 TLS extensions, such as ALPN and server_certificate_type . */
323325#endif
324326
327+ #if defined(CONFIG_ESP_TLS_PSK_VERIFICATION )
328+ const psk_hint_key_t * psk_hint_key ; /*!< Pointer to PSK hint and key. if not NULL (and the certificate/key is NULL)
329+ then PSK authentication is enabled with configured setup.
330+ Important note: the pointer must be valid for connection */
331+ #endif
332+
325333} esp_tls_cfg_server_t ;
326334
327335/**
@@ -464,7 +472,7 @@ int esp_tls_conn_http_new_async(const char *url, const esp_tls_cfg_t *cfg, esp_t
464472 * - >=0 if write operation was successful, the return value is the number
465473 * of bytes actually written to the TLS/SSL connection.
466474 * - <0 if write operation was not successful, because either an
467- * error occured or an action must be taken by the calling process.
475+ * error occurred or an action must be taken by the calling process.
468476 * - ESP_TLS_ERR_SSL_WANT_READ/
469477 * ESP_TLS_ERR_SSL_WANT_WRITE.
470478 * if the handshake is incomplete and waiting for data to be available for reading.
@@ -485,7 +493,7 @@ ssize_t esp_tls_conn_write(esp_tls_t *tls, const void *data, size_t datalen);
485493 * - 0 if read operation was not successful. The underlying
486494 * connection was closed.
487495 * - <0 if read operation was not successful, because either an
488- * error occured or an action must be taken by the calling process.
496+ * error occurred or an action must be taken by the calling process.
489497 */
490498ssize_t esp_tls_conn_read (esp_tls_t * tls , void * data , size_t datalen );
491499
@@ -537,7 +545,7 @@ esp_err_t esp_tls_get_conn_sockfd(esp_tls_t *tls, int *sockfd);
537545 *
538546 * @param[in] sockfd sockfd value to set.
539547 *
540- * @return - ESP_OK on success and value of sockfd for the tls connection shall updated withthe provided value
548+ * @return - ESP_OK on success and value of sockfd for the tls connection shall updated with the provided value
541549 * - ESP_ERR_INVALID_ARG if (tls == NULL || sockfd < 0)
542550 */
543551esp_err_t esp_tls_set_conn_sockfd (esp_tls_t * tls , int sockfd );
@@ -549,7 +557,7 @@ esp_err_t esp_tls_set_conn_sockfd(esp_tls_t *tls, int sockfd);
549557 *
550558 * @param[out] conn_state pointer to the connection state value.
551559 *
552- * @return - ESP_OK on success and value of sockfd for the tls connection shall updated withthe provided value
560+ * @return - ESP_OK on success and value of sockfd for the tls connection shall updated with the provided value
553561 * - ESP_ERR_INVALID_ARG (Invalid arguments)
554562 */
555563esp_err_t esp_tls_get_conn_state (esp_tls_t * tls , esp_tls_conn_state_t * conn_state );
@@ -561,7 +569,7 @@ esp_err_t esp_tls_get_conn_state(esp_tls_t *tls, esp_tls_conn_state_t *conn_stat
561569 *
562570 * @param[in] conn_state connection state value to set.
563571 *
564- * @return - ESP_OK on success and value of sockfd for the tls connection shall updated withthe provided value
572+ * @return - ESP_OK on success and value of sockfd for the tls connection shall updated with the provided value
565573 * - ESP_ERR_INVALID_ARG (Invalid arguments)
566574 */
567575esp_err_t esp_tls_set_conn_state (esp_tls_t * tls , esp_tls_conn_state_t conn_state );
@@ -586,7 +594,7 @@ void *esp_tls_get_ssl_context(esp_tls_t *tls);
586594 *
587595 * @return
588596 * - ESP_OK if creating global CA store was successful.
589- * - ESP_ERR_NO_MEM if an error occured when allocating the mbedTLS resources.
597+ * - ESP_ERR_NO_MEM if an error occurred when allocating the mbedTLS resources.
590598 */
591599esp_err_t esp_tls_init_global_ca_store (void );
592600
@@ -605,7 +613,7 @@ esp_err_t esp_tls_init_global_ca_store(void);
605613 *
606614 * @return
607615 * - ESP_OK if adding certificates was successful.
608- * - Other if an error occured or an action must be taken by the calling process.
616+ * - Other if an error occurred or an action must be taken by the calling process.
609617 */
610618esp_err_t esp_tls_set_global_ca_store (const unsigned char * cacert_pem_buf , const unsigned int cacert_pem_bytes );
611619
0 commit comments