Changed HW signing (atsha204) to be SAMD compatible

This commit is contained in:
Thomas Mørch
2015-12-06 23:16:44 +01:00
parent c62aca4125
commit 5b3fac51cc
4 changed files with 21 additions and 34 deletions
@@ -24,7 +24,6 @@
* HMAC-SHA256 authentication with a readout-protected key.
*
*/
#if defined(ARDUINO_ARCH_AVR)
#include "MySigning.h"
@@ -281,4 +280,3 @@ uint8_t* signerSha256(const uint8_t* data, size_t sz) {
DEBUG_SIGNING_PRINTBUF(F("SHA256: "), &_singning_rx_buffer[SHA204_BUFFER_POS_DATA], 32);
return &_singning_rx_buffer[SHA204_BUFFER_POS_DATA];
}
#endif // #if defined(ARDUINO_ARCH_AVR)
+3 -3
View File
@@ -199,11 +199,11 @@ inline void transportProcess() {
#if defined (MY_GATEWAY_FEATURE)
#ifdef MY_SIGNING_REQUEST_SIGNATURES
if (DO_SIGN(sender))
_sendRoute(build(_msg, _nc.nodeId, sender, NODE_SENSOR_ID, C_INTERNAL, I_REQUEST_SIGNING, false).set(true));
_sendRoute(build(_msg, _nc.nodeId, sender, NODE_SENSOR_ID, C_INTERNAL, I_REQUEST_SIGNING, false).set((uint8_t)true));
else
_sendRoute(build(_msg, _nc.nodeId, sender, NODE_SENSOR_ID, C_INTERNAL, I_REQUEST_SIGNING, false).set(false));
_sendRoute(build(_msg, _nc.nodeId, sender, NODE_SENSOR_ID, C_INTERNAL, I_REQUEST_SIGNING, false).set((uint8_t)false));
#else
_sendRoute(build(_msg, _nc.nodeId, sender, NODE_SENSOR_ID, C_INTERNAL, I_REQUEST_SIGNING, false).set(false));
_sendRoute(build(_msg, _nc.nodeId, sender, NODE_SENSOR_ID, C_INTERNAL, I_REQUEST_SIGNING, false).set((uint8_t)false));
#endif
#endif
return; // Signing request is an internal MySensor protocol message, no need to inform caller about this