Summary
Replace the fragile hardcoded PROVISION_KEY bypass opcodes in PROVESFlightControllerReference/Components/ProvesRouter/Bypasser.cpp with an authoritative command-ID source or generated binding.
Rationale
The current bypass allowlist uses literal values for the UART, LoRa, and S-band TcSecurityDeframer.PROVISION_KEY commands:
0x2100B002
0x2200B002
0x2300B002
These values depend on the command order in TcSecurityDeframer.fpp. Adding or reordering commands before PROVISION_KEY could silently cause authentication bypass to apply to a different command.
Affected area
PROVESFlightControllerReference/Components/ProvesRouter/Bypasser.cpp
- Generated/deployment command-ID definitions or the deployment topology dictionary
- Tests for bypass policy / command-ID mapping, if available
Required changes
- Identify a build-time or generated source of truth for the deployed command IDs.
- Make the bypass policy refer to that source instead of manually maintained opcode literals, while retaining the UART, LoRa, and S-band provisioning mappings.
- Add validation or tests that catch a command-order change causing the provisioning bypass mapping to drift.
- Keep the bootstrap-only behavior: only
PROVISION_KEY should bypass authentication.
Acceptance criteria
- No manually maintained
0x2100B002, 0x2200B002, or 0x2300B002 provisioning opcode literals remain in the bypass allowlist.
- The three intended
PROVISION_KEY commands remain bypassable.
- A future insertion/reordering of
TcSecurityDeframer commands cannot silently bypass a different command.
- Relevant tests or validation pass.
Backlinks
Requested by: @nateinaction
Summary
Replace the fragile hardcoded
PROVISION_KEYbypass opcodes inPROVESFlightControllerReference/Components/ProvesRouter/Bypasser.cppwith an authoritative command-ID source or generated binding.Rationale
The current bypass allowlist uses literal values for the UART, LoRa, and S-band
TcSecurityDeframer.PROVISION_KEYcommands:0x2100B0020x2200B0020x2300B002These values depend on the command order in
TcSecurityDeframer.fpp. Adding or reordering commands beforePROVISION_KEYcould silently cause authentication bypass to apply to a different command.Affected area
PROVESFlightControllerReference/Components/ProvesRouter/Bypasser.cppRequired changes
PROVISION_KEYshould bypass authentication.Acceptance criteria
0x2100B002,0x2200B002, or0x2300B002provisioning opcode literals remain in the bypass allowlist.PROVISION_KEYcommands remain bypassable.TcSecurityDeframercommands cannot silently bypass a different command.Backlinks
Requested by: @nateinaction