mirror of
https://github.com/meshtastic/firmware.git
synced 2025-12-29 14:10:53 +00:00
Add pkc test (#4878)
* Add a second delay() to get the unit tests running on Rak4631 * Add test_PKC_Decrypt * Remove cruft from test case
This commit is contained in:
@@ -102,6 +102,7 @@ bool CryptoEngine::decryptCurve25519(uint32_t fromNode, uint64_t packetNum, size
|
||||
uint8_t *auth; // set to last 8 bytes of text?
|
||||
uint32_t extraNonce; // pointer was not really used
|
||||
auth = bytes + numBytes - 12;
|
||||
#ifndef PIO_UNIT_TESTING
|
||||
memcpy(&extraNonce, auth +8, 4); // do not use dereference on potential non aligned pointers : (uint32_t *)(auth + 8);
|
||||
LOG_INFO("Random nonce value: %d\n", extraNonce);
|
||||
meshtastic_NodeInfoLite *node = nodeDB->getMeshNode(fromNode);
|
||||
@@ -115,6 +116,7 @@ bool CryptoEngine::decryptCurve25519(uint32_t fromNode, uint64_t packetNum, size
|
||||
if (!crypto->setDHKey(fromNode)) {
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
initNonce(fromNode, packetNum, extraNonce);
|
||||
printBytes("Attempting decrypt using nonce: ", nonce, 13);
|
||||
printBytes("Attempting decrypt using shared_key starting with: ", shared_key, 8);
|
||||
|
||||
Reference in New Issue
Block a user