mirror of
https://github.com/meshcore-dev/MeshCore.git
synced 2026-04-20 22:13:47 +00:00
* simple_secure_chat: bug fixes
This commit is contained in:
parent
d291c6d31e
commit
d06532d6f1
3 changed files with 17 additions and 6 deletions
|
|
@ -70,6 +70,7 @@ DispatcherAction Mesh::onRecvPacket(Packet* pkt) {
|
|||
// scan contacts DB, for all matching hashes of 'src_hash' (max 4 matches supported ATM)
|
||||
int num = searchPeersByHash(&src_hash);
|
||||
// for each matching contact, try to decrypt data
|
||||
bool found = false;
|
||||
for (int j = 0; j < num; j++) {
|
||||
uint8_t secret[PUB_KEY_SIZE];
|
||||
getPeerSharedSecret(secret, j);
|
||||
|
|
@ -89,9 +90,13 @@ DispatcherAction Mesh::onRecvPacket(Packet* pkt) {
|
|||
} else {
|
||||
onPeerDataRecv(pkt, pkt->getPayloadType(), j, data, len);
|
||||
}
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!found) {
|
||||
MESH_DEBUG_PRINTLN("recv matches no peers, src_hash=%02X", (uint32_t)src_hash);
|
||||
}
|
||||
}
|
||||
action = routeRecvPacket(pkt);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue