Add configurable packet authenticity settings#2066
Conversation
Expose firmware packet authenticity policy levels in Security settings, including capability gating and confirmation before Strict mode. Persist the policy and XEdDSA capability and regenerate the required Swift protobuf fields.
📝 WalkthroughWalkthroughAdds configurable Packet Authenticity policies, XEdDSA capability tracking, protobuf and persistence support, a gated Security settings UI with Strict confirmation, localization, documentation, and tests. ChangesPacket Authenticity configuration
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant User
participant SecurityConfig
participant Firmware
participant SwiftData
User->>SecurityConfig: Select protection level
SecurityConfig->>SecurityConfig: Confirm Strict when required
SecurityConfig->>Firmware: Save packetSignaturePolicy
Firmware-->>SecurityConfig: Return security configuration
SecurityConfig->>SwiftData: Persist policy and XEdDSA capability
Possibly related issues
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Comment |
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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 `@Meshtastic/Views/Settings/Config/SecurityConfig.swift`:
- Around line 87-95: The packet authenticity labels in
SecurityConfig.packetAuthenticityTitle do not match the PR contract terminology.
Update the SwiftUI strings for the .balanced and .strict cases to use “Balanced
— Prefer signed (recommended/default)” and “Strict — Require signed,” and make
the same wording change in the corresponding localized strings/documentation so
all references stay consistent.
🪄 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: 6567280a-2a6f-49fc-9f7e-2bbc96b89231
📒 Files selected for processing (14)
Localizable.xcstringsMeshtastic/Helpers/MeshPackets.swiftMeshtastic/Model/ConfigModels.swiftMeshtastic/Model/DeviceMetadataEntity.swiftMeshtastic/Persistence/NodeBackupManager+Import.swiftMeshtastic/Persistence/UpdateSwiftData.swiftMeshtastic/Resources/docs/index.jsonMeshtastic/Resources/docs/markdown/user/settings.mdMeshtastic/Resources/docs/user/settings.htmlMeshtastic/Views/Settings/Config/SecurityConfig.swiftMeshtasticProtobufs/Sources/meshtastic/config.pb.swiftMeshtasticProtobufs/Sources/meshtastic/mesh.pb.swiftMeshtasticTests/XEdDSASigningTests.swiftdocs/user/settings.md
What changed?
SecurityConfig.packet_signature_policy, with Balanced as the default.DeviceMetadata.has_xeddsapersistence and capability gating for unsupported/older firmware.Closes #2065. Coordinated by design#121.
Why did it change?
The packet authenticity policy is enforced by firmware, but every official client needs a consistent way to inspect and configure it. Apple platforms now use the same ordered values and compatibility warnings as Android/Desktop and Web, without adding an app-local message filter.
How is this tested?
config.pb.swiftandmesh.pb.swifttypecheck against SwiftProtobuf.AccessoryManagersend/persist behavior.Full Xcode execution is currently blocked before feature compilation by the upstream GzipSwift 7.0.0 manifest requiring Swift tools 6.3 while the installed Xcode provides Swift 6.2. This draft also depends on protobufs#983.
Screenshots/Videos (when applicable)
The source includes iPhone light/dark previews for supported policies and an unsupported iPad preview. Complete reviewed screenshots for all values, confirmation, and macOS remain pending alongside hardware configuration round-trip verification.
Checklist
docs/user/settings.mdand regenerated the in-app documentation bundle.Keep this PR draft until the protobuf dependency, full Xcode test matrix, screenshots, and hardware verification are complete.
Summary by CodeRabbit
New Features
Bug Fixes
Documentation