1- //! TLS transport for the Embassy MQTT client (design 044) .
1+ //! TLS transport for the Embassy MQTT client.
22//!
33//! `mqtts://` broker sessions: an `embedded-tls` 1.3 session over the Embassy
44//! TCP socket, wrapped in mountain-mqtt's [`ConnectionEmbedded`] so the MQTT
1010//! The session loop ([`handle_messages`], [`State`], [`ChannelEventHandler`])
1111//! is a port of mountain-mqtt-embassy's private equivalents (MIT OR
1212//! Apache-2.0): upstream `run()` constructs a bare `TcpSocket` internally and
13- //! offers no seam for a TLS session (design 044 D6) . Keep the loop in sync
14- //! with the fork when bumping it.
13+ //! offers no seam for a TLS session. Keep the loop in sync with the fork when
14+ //! bumping it.
1515
1616use alloc:: string:: String ;
1717use alloc:: vec:: Vec ;
@@ -53,7 +53,7 @@ use crate::sntp::{self, SntpClock};
5353/// covers RSA-4096 leaves with headroom.
5454const CERT_BUFFER_SIZE : usize = 4096 ;
5555
56- /// TLS materials for a `mqtts://` broker connection (design 044 §4) .
56+ /// TLS materials for a `mqtts://` broker connection.
5757///
5858/// All references are `'static`: the session outlives `build()`, so buffers
5959/// and the RNG live in `StaticCell`s (or equivalents) owned by the
@@ -155,10 +155,10 @@ impl embedded_io_async::Write for SharedTcp<'_, '_> {
155155/// undecrypted bytes on the wire (`can_recv` on the shared socket). Checking
156156/// both keeps coalesced packets flowing promptly.
157157///
158- /// Known limitation (documented in design 044) : wire bytes that decrypt to
159- /// *no* application data (unsolicited session tickets, KeyUpdate) make
160- /// `receive` wait for the next real record; if the broker stays silent, the
161- /// keep-alive lapse tears the session down and the manager reconnects.
158+ /// Known limitation: wire bytes that decrypt to *no* application data
159+ /// (unsolicited session tickets, KeyUpdate) make `receive` wait for the next
160+ /// real record; if the broker stays silent, the keep-alive lapse tears the
161+ /// session down and the manager reconnects.
162162struct TlsSession < ' r , ' a , ' b > {
163163 tls : TlsConnection < ' b , SharedTcp < ' r , ' a > , Aes128GcmSha256 > ,
164164 socket : SharedTcp < ' r , ' a > ,
@@ -204,7 +204,7 @@ impl Connection for TlsSession<'_, '_, '_> {
204204/// [`CryptoProvider`] pairing the injected TRNG with `rustpki` certificate
205205/// verification (time from [`SntpClock`]). Client-certificate signing is
206206/// deliberately absent — the mesh authenticates with MQTT credentials
207- /// (design 044 non-goals) .
207+ /// instead .
208208struct TrngProvider < ' a > {
209209 rng : & ' a mut dyn CryptoRngCore ,
210210 verifier : CertVerifier < ' static , Aes128GcmSha256 , SntpClock , CERT_BUFFER_SIZE > ,
@@ -227,7 +227,7 @@ impl CryptoProvider for TrngProvider<'_> {
227227/// The TLS broker manager: resolve → TCP → TLS handshake → MQTT session,
228228/// reconnecting forever with the same [`Settings`] cadence as the plain
229229/// path's `mqtt_manager::run` (`settings.address` is unused — the TLS path
230- /// resolves `host` per attempt, design 044 D7 ).
230+ /// resolves `host` per attempt instead ).
231231#[ allow( clippy:: too_many_arguments) ]
232232pub ( crate ) async fn run_tls (
233233 stack : Stack < ' static > ,
@@ -255,7 +255,7 @@ pub(crate) async fn run_tls(
255255
256256 loop {
257257 // Certificate validity needs real time — hold the first handshake
258- // until SNTP has synced (design 044 D5) .
258+ // until SNTP has synced.
259259 if sntp:: unix_now ( ) . is_none ( ) {
260260 #[ cfg( feature = "defmt" ) ]
261261 defmt:: info!( "MQTT-TLS: waiting for SNTP time sync..." ) ;
0 commit comments