fix bug where a login from a new identity silently removes an admin

This commit is contained in:
Pablo Ramón Guevara committed 2026-11-26 18:33:12 +01:00
1 parent 505ae195dd
commit 6ae61bbb40
5 files changed
+8 -2

No files matched your search

+1
View File
@@ -123,6 +123,7 @@ uint8_t MyMesh::handleLoginReq(const mesh::Identity& sender, const uint8_t* secr
}
client = acl.putClient(sender, 0); // add to contacts (if not already known)
if (client == NULL) return 0;
if (sender_timestamp <= client->last_timestamp) {
MESH_DEBUG_PRINTLN("Possible login replay attack!");
return 0; // FATAL: client table is full -OR- replay attack
+2
View File
@@ -357,6 +357,8 @@ void MyMesh::onAnonDataRecv(mesh::Packet *packet, const uint8_t *secret, const m
}
client = acl.putClient(sender, 0); // add to known clients (if not already known)
if (client == NULL) return;
if (sender_timestamp <= client->last_timestamp) {
MESH_DEBUG_PRINTLN("possible replay attack!");
return;
+1
View File
@@ -383,6 +383,7 @@ uint8_t SensorMesh::handleLoginReq(const mesh::Identity& sender, const uint8_t*
}
client = acl.putClient(sender, PERM_RECV_ALERTS_HI | PERM_RECV_ALERTS_LO); // add to contacts (if not already known)
if (client == NULL) return 0;
if (sender_timestamp <= client->last_timestamp) {
MESH_DEBUG_PRINTLN("Possible login replay attack!");
return 0; // FATAL: client table is full -OR- replay attack