Skip to content

Commit

Permalink
Cumulative update (#1347)
Browse files Browse the repository at this point in the history
  • Loading branch information
tekka007 authored and mfalkvidd committed Sep 24, 2019
1 parent 18fee01 commit 40ba986
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions core/MySigningAtsha204.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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();
Expand Down
3 changes: 2 additions & 1 deletion core/MySigningAtsha204Soft.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion drivers/SPIFlash/SPIFlash.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 40ba986

Please sign in to comment.