mirror of
https://github.com/meshtastic/firmware.git
synced 2025-08-06 21:54:44 +00:00
Retroactive trunkinate
This commit is contained in:
parent
5f6d9c3e27
commit
30356dcd97
@ -70,7 +70,8 @@ bool CryptoEngine::encryptCurve25519(uint32_t toNode, uint32_t fromNode, uint64_
|
|||||||
long extraNonceTmp = random();
|
long extraNonceTmp = random();
|
||||||
auth = bytesOut + numBytes;
|
auth = bytesOut + numBytes;
|
||||||
extraNonce = (uint32_t *)(auth + 8);
|
extraNonce = (uint32_t *)(auth + 8);
|
||||||
memcpy(extraNonce, &extraNonceTmp, 4); // do not use dereference on potential non aligned pointers : *extraNonce = extraNonceTmp;
|
memcpy(extraNonce, &extraNonceTmp,
|
||||||
|
4); // do not use dereference on potential non aligned pointers : *extraNonce = extraNonceTmp;
|
||||||
LOG_INFO("Random nonce value: %d\n", extraNonceTmp);
|
LOG_INFO("Random nonce value: %d\n", extraNonceTmp);
|
||||||
meshtastic_NodeInfoLite *node = nodeDB->getMeshNode(toNode);
|
meshtastic_NodeInfoLite *node = nodeDB->getMeshNode(toNode);
|
||||||
if (node->num < 1 || node->user.public_key.size == 0) {
|
if (node->num < 1 || node->user.public_key.size == 0) {
|
||||||
@ -87,7 +88,8 @@ bool CryptoEngine::encryptCurve25519(uint32_t toNode, uint32_t fromNode, uint64_
|
|||||||
printBytes("Attempting encrypt using shared_key starting with: ", shared_key, 8);
|
printBytes("Attempting encrypt using shared_key starting with: ", shared_key, 8);
|
||||||
aes_ccm_ae(shared_key, 32, nonce, 8, bytes, numBytes, nullptr, 0, bytesOut,
|
aes_ccm_ae(shared_key, 32, nonce, 8, bytes, numBytes, nullptr, 0, bytesOut,
|
||||||
auth); // this can write up to 15 bytes longer than numbytes past bytesOut
|
auth); // this can write up to 15 bytes longer than numbytes past bytesOut
|
||||||
memcpy(extraNonce, &extraNonceTmp, 4); // do not use dereference on potential non aligned pointers : *extraNonce = extraNonceTmp;
|
memcpy(extraNonce, &extraNonceTmp,
|
||||||
|
4); // do not use dereference on potential non aligned pointers : *extraNonce = extraNonceTmp;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user