You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Surface integrity-check failure when parsing a bad manual pairing code
A Manual Pairing Code with a wrong Verhoeff check digit causes
ManualSetupPayloadParser::populatePayload to return
CHIP_ERROR_INTEGRITY_CHECK_FAILED, but the MTR layer was discarding the
specific code: -[MTRSetupPayload initWithManualPairingCode:] dropped it on
the floor (no error out-param), and downstream call sites
(+setupPayloadWithOnboardingPayload:error:,
-[MTRManualSetupPayloadParser populatePayload:],
-[MTRDeviceController pairDevice:onboardingPayload:error:]) all flattened
parse failures to MTRErrorCodeInvalidArgument. Callers had no way to tell
"the user typed a bad setup code" apart from any other parse error.
Add an NSError**-bearing -initWithManualPairingCode:error: variant that
maps the underlying CHIP_ERROR via [MTRError errorForCHIPErrorCode:],
and route the three downstream call sites through it. The existing
no-error initWithManualPairingCode: is preserved as a thin wrapper.
The CHIP_ERROR_INTEGRITY_CHECK_FAILED -> MTRErrorCodeIntegrityCheckFailed
mapping already exists in MTRError.mm; no new error code is needed.
Adds three XCTests against MTRSetupPayloadTests.m pinning the new error
shape on both APIs plus the happy path. The existing C++ regression
guard (TestManualCode.TestPayloadParser_InvalidEntry) is left intact.
0 commit comments