Cumulative update (#1347)

This commit is contained in:
Olivier
2019-09-24 10:24:53 +02:00
committed by Mikael Falkvidd
parent 18fee01db3
commit 40ba986240
3 changed files with 5 additions and 2 deletions

View File

@@ -171,6 +171,7 @@ bool signerAtsha204SignMsg(MyMessage &msg)
msg.setSigned(true); // make sure signing flag is set before signature is calculated
signerCalculateSignature(msg, true);
#if defined(MY_SIGNING_NODE_WHITELISTING)
if (DO_WHITELIST(msg.destination)) {
// Salt the signature with the senders nodeId and the unique serial of the ATSHA device
// We can reuse the nonce buffer now since it is no longer needed
@@ -185,6 +186,7 @@ bool signerAtsha204SignMsg(MyMessage &msg)
SIGN_DEBUG(PSTR("SGN:BND:SIG WHI,SERIAL=%s\n"), hwDebugPrintStr);
#endif
}
#endif
// Put device back to sleep
atsha204_sleep();

View File

@@ -186,7 +186,7 @@ bool signerAtsha204SoftSignMsg(MyMessage &msg)
// Calculate signature of message
msg.setSigned(true); // make sure signing flag is set before signature is calculated
signerCalculateSignature(msg, true);
#if defined(MY_SIGNING_NODE_WHITELISTING)
if (DO_WHITELIST(msg.getDestination())) {
// Salt the signature with the senders nodeId and the (hopefully) unique serial The Creator has
// provided. We can reuse the nonce buffer now since it is no longer needed
@@ -200,6 +200,7 @@ bool signerAtsha204SoftSignMsg(MyMessage &msg)
SIGN_DEBUG(PSTR("SGN:BND:SIG WHI,SERIAL=%s\n"), hwDebugPrintStr);
#endif
}
#endif
// Overwrite the first byte in the signature with the signing identifier
_signing_hmac[0] = SIGNING_IDENTIFIER;

View File

@@ -199,7 +199,7 @@ void SPIFlash::command(uint8_t cmd, bool isWrite)
// that is because some chips can take several seconds to carry out a chip erase or other similar multi block or entire-chip operations
// a recommended alternative to such situations where chip can be or not be present is to add a 10k or similar weak pulldown on the
// open drain MISO input which can read noise/static and hence return a non 0 status byte, causing the while() to hang when a flash chip is not present
while(busy());
if (cmd != SPIFLASH_WAKE) while(busy());
select();
SPI.transfer(cmd);
}