As per section 5.5 Commissioning Flows of the spec:
"
In non-concurrent connection commissioning flow the commissioning channel SHALL terminate after successful step 12
(trigger joining of operational network at Commissionee). The PASE-derived encryption keys SHALL be
deleted when commissioning channel terminates. The PASE session SHALL be terminated by both
Commissioner and Commissionee once the CommissioningComplete command is received by the
Commissionee.
"
(Emphasis mine.)
To delete the encryption keys, we call Matter::reset, which - in turn - calls TransportMgr::reset. There are 3 issues with the current method:
(Most important) currently, it also calls mdns.reset() which is a bug, as this removes the just-registered semi-commissioned node from mDNS, and therefore, it is no longer broadcasted and cannot be found over the operational framework;
Its name is too generic (reset) whereas reset_transport is probably more appropriate, as it resets the sessions, exchanges and (desirably - see below) TX+RX transport packet buffers which might contain packets from the previous transport (BLE) in case of abrupt session interruption. But it does not and should not reset other Matter state. Say, fabrics and ACLs;
It does not clear the TX and RX buffers. While the BLE session completes cleanly (no outstanding messages), I think it should clear the buffers, just in case.
As per section 5.5 Commissioning Flows of the spec: " In non-concurrent connection commissioning flow the commissioning channel SHALL terminate after successful step 12 (trigger joining of operational network at Commissionee). The PASE-derived encryption keys SHALL be deleted when commissioning channel terminates. The PASE session SHALL be terminated by both Commissioner and Commissionee once the CommissioningComplete command is received by the Commissionee. "
(Emphasis mine.)
To delete the encryption keys, we call
Matter::reset
, which - in turn - callsTransportMgr::reset
. There are 3 issues with the current method:mdns.reset()
which is a bug, as this removes the just-registered semi-commissioned node from mDNS, and therefore, it is no longer broadcasted and cannot be found over the operational framework;reset
) whereasreset_transport
is probably more appropriate, as it resets the sessions, exchanges and (desirably - see below) TX+RX transport packet buffers which might contain packets from the previous transport (BLE) in case of abrupt session interruption. But it does not and should not reset other Matter state. Say, fabrics and ACLs;This PR fixes all of these three issues.