mirror of
https://github.com/meshtastic/firmware.git
synced 2025-08-05 21:24:34 +00:00
Don't attempt PKI decryption on broadcast packets
This commit is contained in:
parent
e61bd84116
commit
cec8233cd1
@ -320,9 +320,9 @@ bool perhapsDecode(meshtastic_MeshPacket *p)
|
||||
memcpy(ScratchEncrypted, p->encrypted.bytes, rawSize);
|
||||
#if !(MESHTASTIC_EXCLUDE_PKI)
|
||||
// Attempt PKI decryption first
|
||||
if (p->channel == 0 && p->to == nodeDB->getNodeNum() && p->to > 0 && nodeDB->getMeshNode(p->from) != nullptr &&
|
||||
nodeDB->getMeshNode(p->from)->user.public_key.size > 0 && nodeDB->getMeshNode(p->to)->user.public_key.size > 0 &&
|
||||
rawSize > 8) {
|
||||
if (p->channel == 0 && p->to == nodeDB->getNodeNum() && p->to > 0 && p->to != NODENUM_BROADCAST &&
|
||||
nodeDB->getMeshNode(p->from) != nullptr && nodeDB->getMeshNode(p->from)->user.public_key.size > 0 &&
|
||||
nodeDB->getMeshNode(p->to)->user.public_key.size > 0 && rawSize > 8) {
|
||||
LOG_DEBUG("Attempting PKI decryption\n");
|
||||
|
||||
if (crypto->decryptCurve25519(p->from, p->id, rawSize, ScratchEncrypted, bytes)) {
|
||||
|
Loading…
Reference in New Issue
Block a user