feat(tft): configure packet authenticity policy#341
Conversation
|
@coderabbitai review |
📝 WalkthroughWalkthroughAdds a TFT packet authenticity policy selector with Compatible, Balanced, and Strict modes, strict-transition confirmation, XEdDSA capability gating, protobuf source updates, device metadata propagation, connection-state handling, and policy mapping tests. ChangesPacket authenticity policy
Estimated code review effort: 4 (Complex) | ~45 minutes Possibly related issues
Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
Comment |
✅ Action performedReview finished.
|
6d8342a to
e23cffa
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
tests/test_PacketAuthPolicy.cpp (1)
6-12: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winCover all outbound policy values.
Line 11 only protects Compatible; add Balanced and Strict so future enum changes cannot silently persist the wrong firmware policy.
Proposed test additions
CHECK(PacketAuthPolicy::fromWireValue(99) == Selection::Balanced); + CHECK(PacketAuthPolicy::toWireValue(Selection::Balanced) == 0); CHECK(PacketAuthPolicy::toWireValue(Selection::Compatible) == 1); + CHECK(PacketAuthPolicy::toWireValue(Selection::Strict) == 2);🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@tests/test_PacketAuthPolicy.cpp` around lines 6 - 12, Extend the test case “packet authenticity wire values map to UI selections” to assert PacketAuthPolicy::toWireValue for Selection::Balanced and Selection::Strict, expecting their corresponding firmware wire values alongside the existing Compatible assertion.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@source/graphics/common/ViewController.cpp`:
- Around line 874-878: Replace the invalid meta.has_xeddsa member access in the
meshtastic_FromRadio_metadata_tag handler with meta.has_xeddsa_signed when
calling view->setDeviceMetaData.
---
Nitpick comments:
In `@tests/test_PacketAuthPolicy.cpp`:
- Around line 6-12: Extend the test case “packet authenticity wire values map to
UI selections” to assert PacketAuthPolicy::toWireValue for Selection::Balanced
and Selection::Strict, expecting their corresponding firmware wire values
alongside the existing Compatible assertion.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 689e52e0-cafd-42bb-a5ce-be09c7c6b36f
⛔ Files ignored due to path filters (2)
generated/ui_240x320/ui_tabview_settings.cis excluded by!**/generated/**generated/ui_320x240/ui_tabview_settings.cis excluded by!**/generated/**
📒 Files selected for processing (9)
cmake/protobuf.cmakeinclude/graphics/common/MeshtasticView.hinclude/graphics/view/TFT/PacketAuthPolicy.hinclude/graphics/view/TFT/PacketAuthUI.hinclude/graphics/view/TFT/TFTView_320x240.hsource/graphics/TFT/TFTView_320x240.cppsource/graphics/common/MeshtasticView.cppsource/graphics/common/ViewController.cpptests/test_PacketAuthPolicy.cpp
e23cffa to
b64f464
Compare
b64f464 to
f9c0db8
Compare
|
@coderabbitai review |
✅ Action performedReview finished.
|
Summary
Adds the device-enforced Packet authenticity receive-policy setting to the TFT Security UI for firmware that reports XEdDSA support.
SecurityConfig.packet_signature_policydirectlyThis is configuration UI only; packet acceptance remains enforced by firmware.
Validation
TFTView_320x240,MeshtasticView,ViewController, and both UI orientations against nanopb generated from protobufs#983git diff --checkpassedA full macOS CMake build was attempted but stops before DeviceUI compilation in existing third-party Portduino/LVGL dependencies (
argp.h, xkb header discovery, and ArduinoCore case-collidingString.h/string.h). No hardware validation has been performed, so this remains a draft.Draft dependency
Depends on meshtastic/protobufs#983. The draft pins that exact schema commit from the contributor fork for reproducible validation. Before this PR can leave draft, replace the temporary fork pin with the merged upstream protobuf release/tag and complete hardware verification.
Closes #340
Design: meshtastic/design#121
Summary by CodeRabbit