Repeater, room server, sensor, companion: build flag LOCKED_NODE for a node that keeps its secrets from whoever holds it

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
tthandClaude Opus 5.5 committed 2026-11-19 17:21:29 +01:00
1 parent 769139999d
commit b7249f449a
3 files changed
+26

No files matched your search

+10
View File
@@ -927,6 +927,16 @@ void CommonCLI::handleSetCmd(uint32_t sender_timestamp, char* command, char* rep
void CommonCLI::handleGetCmd(uint32_t sender_timestamp, char* command, char* reply) {
const char* config = &command[4];
#ifdef LOCKED_NODE
// CUSTOM (TeTeHacko): a locked node gives its secrets to nobody -- not to the
// USB console (no login: whoever holds the board), not to the BLE console, not
// to an admin over the mesh. docs/locked-bootloader.md, point 4.
if (memcmp(config, "prv.key", 7) == 0 || memcmp(config, "guest.password", 14) == 0 ||
memcmp(config, "bridge.secret", 13) == 0) {
strcpy(reply, "Error: locked build");
return;
}
#endif
if (memcmp(config, "allow.read.only", 15) == 0) {
sprintf(reply, "> %s", _prefs->allow_read_only ? "on" : "off");
} else if (memcmp(config, "flood.advert.interval", 21) == 0) {