@@ -231,6 +231,21 @@ static esp_err_t esp_mqtt_set_ssl_transport_properties(esp_transport_list_handle
231231 goto esp_mqtt_set_transport_failed ;
232232#endif
233233 }
234+
235+ if (cfg -> use_ecdsa_peripheral ) {
236+ #ifdef MQTT_SUPPORTED_FEATURE_ECDSA_PERIPHERAL
237+ #ifdef CONFIG_MBEDTLS_HARDWARE_ECDSA_SIGN
238+ esp_transport_ssl_set_client_key_ecdsa_peripheral (ssl , cfg -> ecdsa_key_efuse_blk );
239+ #else
240+ ESP_LOGE (TAG , "ECDSA peripheral not enabled for esp-tls in menuconfig" );
241+ goto esp_mqtt_set_transport_failed ;
242+ #endif /* CONFIG_MBEDTLS_HARDWARE_ECDSA_SIGN */
243+ #else
244+ ESP_LOGE (TAG , "ECDSA peripheral feature is not available in IDF version %s" , IDF_VER );
245+ goto esp_mqtt_set_transport_failed ;
246+ #endif /* MQTT_SUPPORTED_FEATURE_ECDSA_PERIPHERAL */
247+ }
248+
234249 ESP_OK_CHECK (TAG , esp_mqtt_set_cert_key_data (ssl , MQTT_SSL_DATA_API_CLIENT_CERT , cfg -> clientcert_buf , cfg -> clientcert_bytes ),
235250 goto esp_mqtt_set_transport_failed );
236251 ESP_OK_CHECK (TAG , esp_mqtt_set_cert_key_data (ssl , MQTT_SSL_DATA_API_CLIENT_KEY , cfg -> clientkey_buf , cfg -> clientkey_bytes ),
@@ -570,6 +585,8 @@ esp_err_t esp_mqtt_set_config(esp_mqtt_client_handle_t client, const esp_mqtt_cl
570585 client -> config -> common_name = config -> broker .verification .common_name ;
571586 client -> config -> use_secure_element = config -> credentials .authentication .use_secure_element ;
572587 client -> config -> ds_data = config -> credentials .authentication .ds_data ;
588+ client -> config -> use_ecdsa_peripheral = config -> credentials .authentication .use_ecdsa_peripheral ;
589+ client -> config -> ecdsa_key_efuse_blk = config -> credentials .authentication .ecdsa_key_efuse_blk ;
573590
574591 if (config -> credentials .authentication .key_password && config -> credentials .authentication .key_password_len ) {
575592 client -> config -> clientkey_password_len = config -> credentials .authentication .key_password_len ;
0 commit comments