Add boolean to only warn a user of a duplicated key once per boot

This commit is contained in:
Jonathan Bennett
2025-06-10 13:28:36 -05:00
parent 720add72b2
commit e5f6804421
2 changed files with 3 additions and 1 deletions
+2 -1
View File
@@ -1566,7 +1566,8 @@ bool NodeDB::updateUser(uint32_t nodeId, meshtastic_User &p, uint8_t channelInde
printBytes("Incoming Pubkey: ", p.public_key.bytes, 32);
// Alert the user if a remote node is advertising public key that matches our own
if (owner.public_key.size == 32 && memcmp(p.public_key.bytes, owner.public_key.bytes, 32) == 0) {
if (owner.public_key.size == 32 && memcmp(p.public_key.bytes, owner.public_key.bytes, 32) == 0 && !duplicateWarned) {
duplicateWarned = true;
char warning[] = "Remote device %s has advertised your public key. This may indicate a low-entropy key. You may need "
"to regenerate your public keys.";
LOG_WARN(warning, p.long_name);