mirror of
https://github.com/mikecarper/MeshCore.git
synced 2026-10-23 06:22:48 +00:00
Retry identity startup and harden replay state and permissions
Read identities up to three times before allowing replacement, publish only complete reads, and require new startup keys to be saved with bounded retries. Use authoritative replay-file metadata throughout persistence and clock recovery. Validate setperm input before narrowing or mutating roles, and add production-path regression coverage.
This commit is contained in:
1 parent
24b1b1167f
commit
b847b46ef7
21 files changed
+272
-73
No files matched your search
@@ -103,14 +103,14 @@ void setup() {
|
||||
bool identity_ready = true;
|
||||
if (needs_identity) {
|
||||
identity_ready = mesh::generateUsableLocalIdentity(the_mesh.self_id, radio_new_identity);
|
||||
if (identity_ready) store.save("_main", the_mesh.self_id);
|
||||
if (identity_ready) identity_ready = store.saveWithRetry("_main", the_mesh.self_id);
|
||||
}
|
||||
|
||||
#if defined(ESP32_PLATFORM)
|
||||
mesh::discardESP32TrueRandom();
|
||||
#endif
|
||||
if (!identity_ready) {
|
||||
MESH_DEBUG_PRINTLN("Identity generation exhausted all attempts; rebooting");
|
||||
MESH_DEBUG_PRINTLN("Identity generation or persistence failed after retries; rebooting");
|
||||
board.reboot();
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user