1200 Commits

Author SHA1 Message Date
david-cermak
d5db1fc1ec Merge pull request #985 from david-cermak/fix/asio_mbedtls_psa
fix(asio): Add support for mbedtls-v4 API (IDF v6.0+ support)
2026-01-12 11:06:47 +01:00
david-cermak
b06cf1c426 Merge pull request #983 from david-cermak/fix/mbedtls_psa
fix(mbedtls_cxx): Add support for mbedtls psa api
2026-01-09 18:32:45 +01:00
David Cermak
a465ad411e fix(asio): Use mbedtls-v4 API (PSA-crypto support) 2026-01-09 12:54:11 +01:00
David Cermak
884d8fe6f5 fix(mbedtls_cxx): Add support for mbedtls psa api 2026-01-08 16:11:18 +01:00
Suren Gabrielyan
b7f3de500a Merge pull request #979 from gabsuren/bump/ws_1_6_1
bump(websocket): 1.6.0 -> 1.6.1
2026-01-08 13:13:24 +04:00
david-cermak
68c22558b3 Merge pull request #977 from david-cermak/feat/mosq_linux_build
[mosq]: Add support for linux build
2026-01-06 14:53:58 +01:00
David Cermak
be35e7cee2 bump(mosq): 2.0.20~5 -> 2.0.20~6
2.0.20~6
Features
- Add support for linux build (58380585)
Bug Fixes
- Fix mosquitto build on latest master (ebc1258e)
- Fix build with the new picolibc (dc68bf87)
2026-01-06 13:44:51 +01:00
David Cermak
b52d2ecb40 fix(sock_utils): Pass empty cmake for linux target
In order to support linux builds, we define this component as a no-op
Also make an option to force linux build for host tests
2026-01-06 12:14:04 +01:00
surengab
07b3c318ee bump(websocket): 1.6.0 -> 1.6.1
1.6.1
Bug Fixes
- Fix race conditions, memory leak, and data loss (23ca97d5)
    - Add state check in abort_connection to prevent double-close
    - Fix memory leak: free errormsg_buffer on disconnect
    - Reset connection state on reconnect to prevent stale data
    - Implement lock ordering for separate TX lock mode
    - Read buffered data immediately after connection to prevent data loss
    - Added sdkconfig.ci.tx_lock config
2025-12-29 14:46:17 +04:00
Ross Tyler
9590aecc15 change mbedtls_*_free destruction order 2025-12-19 09:19:12 -08:00
Ross Tyler
d33cb616da fix(asio): memory leaks over ssl::stream lifetime
asio::ssl::stream leaks a significant amount (>20KB) of memory over its
lifetime.

asio::ssl::mbedtls::engine::impl has these members ...

	mbedtls_ssl_context ssl_{};
	mbedtls_entropy_context entropy_{};
	mbedtls_ctr_drbg_context ctr_drbg_{};
	mbedtls_ssl_config conf_{};
	mbedtls_x509_crt public_cert_{};
	mbedtls_pk_context pk_key_{};
	mbedtls_x509_crt ca_cert_{};

... which are properly init'ed in its constructor ...

	mbedtls_ssl_init(&ssl_);
	mbedtls_ssl_config_init(&conf_);
	mbedtls_ctr_drbg_init(&ctr_drbg_);
	mbedtls_entropy_init(&entropy_);
	mbedtls_x509_crt_init(&public_cert_);
	mbedtls_pk_init(&pk_key_);
	mbedtls_x509_crt_init(&ca_cert_);

... but are never free'd ... until now

	~impl()
	{
	    mbedtls_x509_crt_free(&ca_cert_);
	    mbedtls_pk_free(&pk_key_);
	    mbedtls_x509_crt_free(&public_cert_);
	    mbedtls_entropy_free(&entropy_);
	    mbedtls_ctr_drbg_free(&ctr_drbg_);
	    mbedtls_ssl_config_free(&conf_);
	    mbedtls_ssl_free(&ssl_);
	}

asio::ssl::mbedtls::engine::impl::configure calls ...

	mbedtls_x509_crt_init(&public_cert_);
	mbedtls_pk_init(&pk_key_);
	mbedtls_x509_crt_init(&ca_cert_);

... again without first free'ing any resources that might be held by such.
now this is done first:

	mbedtls_x509_crt_free(&ca_cert_);
	mbedtls_pk_free(&pk_key_);
	mbedtls_x509_crt_free(&public_cert_);

asio::ssl::engine has this member

	std::pair<std::shared_ptr<bio>, std::shared_ptr<bio>> bio_;

which is made in its constructor

	explicit engine(std::shared_ptr<context> ctx): ctx_(std::move(ctx)),
	    bio_(bio::new_pair("mbedtls-engine")), state_(IDLE), verify_mode_(0) {}

asio::ssl::mbedtls::bio::new_pair creates a cyclic reference between its
paired elements

	static std::pair<std::shared_ptr<bio>, std::shared_ptr<bio>>  new_pair(const char *error_location)
	{
	    auto b1 = std::shared_ptr<bio>(new (std::nothrow) bio);
	    auto b2 = std::shared_ptr<bio>(new (std::nothrow) bio);
	    if (b1 == nullptr || b2 == nullptr) {
	        throw_alloc_failure(error_location);
	    } else {
	        b1->peer_ = b2;
	        b2->peer_ = b1;
	    }
	    return std::make_pair(b1, b2);
	}

there is no asio::ssl::engine destructor to untie this cycle so when the
pair member is destroyed, its elements will leak.
a destructor is needed to fix this ...

	~engine()
	{
	    bio::untie_pair(bio_);
	}

... along with untie_pair ...

	// untie cyclic shared_ptr references made by new_pair in preparation for destruction
	static void untie_pair(std::pair<std::shared_ptr<bio>, std::shared_ptr<bio>>& pair)
	{
	    if (pair.first) {
	        pair.first->peer_.reset();
	    }
	    if (pair.second) {
	        pair.second->peer_.reset();
	    }
	}
2025-12-19 07:57:52 -08:00
Suren Gabrielyan
767a090dc5 Merge pull request #924 from gabsuren/fix/ws_race_on_abort
fix(websocket): Fix websocket client race on abort and memory leak(IDFGH-16555)
2025-12-16 21:02:17 +04:00
David Cermak
583805850d feat(mosq): Add support for linux build 2025-12-16 18:00:27 +01:00
surengab
23ca97d5ec fix(websocket): Fix race conditions, memory leak, and data loss
- Add state check in abort_connection to prevent double-close
- Fix memory leak: free errormsg_buffer on disconnect
- Reset connection state on reconnect to prevent stale data
- Implement lock ordering for separate TX lock mode
- Read buffered data immediately after connection to prevent data loss
- Added sdkconfig.ci.tx_lock config
2025-12-16 20:11:29 +04:00
david-cermak
77abff48e1 Merge pull request #973 from david-cermak/fix/mosq_build
fix(mosq): Fix build with the new picolibc
2025-12-16 08:59:55 +01:00
david-cermak
7f8494a4b1 Merge pull request #974 from david-cermak/fix/asio_picolib
[asio]: Fix picolib missing pthread_sigmask() declaration
2025-12-15 13:31:08 +01:00
David Cermak
25d54efd3a fix(asio): Fix picolib missing pthread_sigmask() declaration 2025-12-15 11:11:35 +01:00
David Cermak
7f4e3690db fix(test): Fix catch based target tests with v6.0 2025-12-15 10:52:21 +01:00
David Cermak
ebc1258ea6 fix(mosq): Fix mosquitto build on latest master 2025-12-15 10:06:28 +01:00
David Cermak
dc68bf87cc fix(mosq): Fix build with the new picolibc 2025-12-15 08:34:46 +01:00
David Cermak
853e8e2810 fix(modem): Fix deinit function in ap2ppp example 2025-12-12 16:08:55 +01:00
david-cermak
072781fcd9 Merge pull request #970 from david-cermak/bump/mqtt_cxx_0.5
[mqtt_cxx]: Bump -> v0.5.0
2025-12-11 13:03:32 +01:00
David Cermak
7ce85c7389 bump(mqtt_cxx): 0.4.0 -> 0.5.0
0.5.0
Bug Fixes
- Implement simple unit tests (f41c4a0a)
- Fix to construct in two steps (d979e1b3, #631)
- Add explicit dependency on esp-mqtt if needed (3d5e11b8)
2025-12-11 11:46:04 +01:00
David Cermak
f41c4a0ad0 fix(mqtt_cxx): Implement simple unit tests 2025-12-11 11:45:58 +01:00
david-cermak
25513d0dc3 Merge pull request #969 from david-cermak/bump/lws_v4.3.3_1
[lws]: Bump 4.3.3 -> 4.3.3~1
2025-12-09 06:37:22 +01:00
David Cermak
d979e1b333 fix(mqtt_cxx): Fix to construct in two steps
to avoid issues with receiving initial (on-connect) event before construction

Closes https://github.com/espressif/esp-protocols/issues/631
2025-12-05 18:30:25 +01:00
David Cermak
742adea26d bump(lws): 4.3.3 -> 4.3.3~1
4.3.3~1
Bug Fixes
- Remove lws support for IDF>=v6.0 (b70cc3fc)
- Update websocket Echo server (#894) (318e41b3)
- Adds missing license info (7ea6879a)
Updated
- chore(lws): fixed formatting (91e7e9fa)
2025-12-05 16:00:25 +01:00
David Cermak
2535b3fefc bump(eppp): 1.1.3 -> 1.1.4
1.1.4
Bug Fixes
- Fixed missing freertos deps (f1e35977)
- Add optional mqtt dependency (911c2dbe)
2025-12-05 15:51:54 +01:00
David Cermak
f1e35977e5 fix(eppp): Fixed missing freertos deps 2025-12-05 12:54:37 +01:00
David Cermak
726c41f842 fix(sock_utils): Use minimal build for examples 2025-12-04 08:32:06 +01:00
david-cermak
c7de9251ed Merge pull request #959 from david-cermak/fix/mdns_v1.10
[mdns]: v1.10: Fix to keep TXT/SRV in answers to queries
2025-12-03 12:43:28 +01:00
David Cermak
0f6235f13e fix(mdns): Fix to keep TXT/SRV in answers to queries
unlike discoveries, where they need to stay in additional section
Quick fix of regression b7b8c5dbd7
2025-12-03 11:58:57 +01:00
David Cermak
6c2c2cd22b fix(mdns): Create a test to check answer section for PTR/ANY
to differentiate between discoveries and actual queries

fix(mdns): Revert the fix to check if CI fails
2025-12-03 11:58:01 +01:00
david-cermak
9e0bcd4b08 Merge pull request #957 from david-cermak/bump/mosq_2.0.20_5
[mosq]: Bump 2.0.20~4 -> 2.0.20~5
2025-11-28 11:28:17 +01:00
David Cermak
f20a234f65 fix(mdns): Fix unused variable dcst warning for wifi-remote chips
Forward-port of 081eef88
2025-11-25 17:35:13 +01:00
David Cermak
63082b996d feat(mdns): support null value for boolean txt records
Forward port of fa96de3bd
2025-11-25 17:34:44 +01:00
David Cermak
27d43277d2 fix(mdns): put srv/txt records in additional section for ptr queries
Forward port of b7b8c5db
2025-11-25 17:34:17 +01:00
David Cermak
4d8d25a345 fix(mdns): Host test to use hw_support include dir
Forward port of 8bba3a97
2025-11-25 17:32:59 +01:00
David Cermak
bed116d98b feat(mdns): Refactor mdns library (stage #1)
The MDNS component has been refactored from a single monolithic file mdns.c
into a set of focused modules with clear responsibilities.
This restructuring maintains the same functionality while improving code organization,
maintainability, and testability.
In the stage#2 we will focus on module based tests
In the stage#3 we will focus on small scale refators and optimizations
2025-11-25 17:30:27 +01:00
David Cermak
9ec006a3e4 bump(mosq): 2.0.20~4 -> 2.0.20~5
2.0.20~5
Features
- Add support for basic MQTT authentication (65b58aa0)
Bug Fixes
- Add optional mqtt deps to examples (6f6110e3)
- Update example to optionally use basic mqtt auth (38384852)
- Fix unpwd-check wrap function (ba3377b2)
- Fix the version check (9fbb6e6d)
2025-11-25 13:47:02 +01:00
david-cermak
245b5a2ffb Merge pull request #956 from david-cermak/fix/modem_ping_in_examples
[modem]: Bump -> v2.0
2025-11-25 12:23:15 +01:00
David Cermak
b9ea0c31ce bump(modem): 1.4.0 -> 2.0.0
2.0.0
Breaking changes
- inc headers for AT command definitions are no longer used directly, but pregenerated into *.h(pp) (Use generated AT command definitions for IDE navigation)
Features
- Add support for multiple connection in AT based example (2826287d)
- Add enhanced URC observer API (4889dd6f)
- Support esp-modem use without PPP (858f8570, #851)
- Modem simulator based on esp-at (e5787e3d)
Bug Fixes
- Update tests and examples to use modem-v2.0 (4aa0e4ba)
- Replace MQTT client with simple ping command (0ccaf2c0)
- Replace MQTT client with simple ping command (9b2b1f68)
- Update example to use optional mqtt deps (3141d6ca)
- Minor fixed in the test code (e772ce67)
- Add missing set_echo() C wrapper (d1e67080, #926)
- Fix modem console dependencies (453be4cd)
- Address build issues (018ba58e)
- Fix driver dependency issue on v6.0 (67c682d9)
- Fix CI build issues with IDFv6.0 (15140e04)
- Add support for ESP-AT based tcp-client example (14d3cb6b)
- Use idf-build-apps for building target tests (e9d9b3a8)
- Make MQTT public broker endpoint configurable (6d541194)
- Fix URC handling in DTE data callback (93029946)
- Use another public broker for examples and tests (fac2edbe)
- Fix incompatible iterator in std::search() in new gcc (ed0f6334)
- Fix autodetect to support ACFC mode in PPP frames (8b328a69, #801)
- Fix get_network_registration_state() to accept two params (5f54d907, #826)
- Consume buffer after handled URC (6eceb28f)
- Use generated AT command definitions for IDE navigation (e2fa1110, !BREAKING)
2025-11-24 15:57:10 +01:00
David Cermak
4aa0e4ba49 fix(modem): Update tests and examples to use modem-v2.0 2025-11-24 15:57:06 +01:00
David Cermak
0ccaf2c0bb fix(modem): Replace MQTT client with simple ping command 2025-11-24 14:43:08 +01:00
david-cermak
ed569d8509 Merge pull request #954 from david-cermak/fix/mosq_mqtt_deps
[mosq]: Add optional mqtt deps to examples
2025-11-21 13:28:33 +01:00
David Cermak
9b2b1f680d fix(modem): Replace MQTT client with simple ping command 2025-11-21 12:37:09 +01:00
david-cermak
370dfecc15 Merge pull request #933 from david-cermak/fix/modem_set_echo
fix(modem): Add missing set_echo() C wrapper
2025-11-20 13:12:17 +01:00
David Cermak
6f6110e30e fix(mosq): Add optional mqtt deps to examples 2025-11-20 08:33:01 +01:00
david-cermak
83ffeb0d12 Merge pull request #950 from david-cermak/fix/lws_remove_v6.0_support
[lws]: Remove lws support for IDF>=v6.0
2025-11-19 13:39:29 +01:00
david-cermak
6e99202a18 Merge pull request #948 from david-cermak/fix/ci_v6.0
Common fixes per v6.0/6.1 changes
2025-11-19 13:39:16 +01:00