mirror of
https://github.com/meshcore-dev/MeshCore.git
synced 2026-04-20 22:13:47 +00:00
* redesigned TRACE packet structure
This commit is contained in:
parent
156741e563
commit
fe4fdeb236
9 changed files with 71 additions and 129 deletions
|
|
@ -14,11 +14,7 @@ void Packet::calculatePacketHash(uint8_t* hash) const {
|
|||
SHA256 sha;
|
||||
uint8_t t = getPayloadType();
|
||||
sha.update(&t, 1);
|
||||
if (t == PAYLOAD_TYPE_TRACE) {
|
||||
sha.update(payload, 3+CIPHER_MAC_SIZE+CIPHER_BLOCK_SIZE); // the 'content' part of TRACE packets is just the fixed-len encrypted part
|
||||
} else {
|
||||
sha.update(payload, payload_len);
|
||||
}
|
||||
sha.update(payload, payload_len);
|
||||
sha.finalize(hash, MAX_HASH_SIZE);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue