Dummy signing driver backend

The dummy signing driver implements the most rudimentary form of
signing. No pre-shared key is used, nonce is simply incremeted
each turn and signature is only calculated on the fist byte using
data XOR nonce.
This driver is intended for library debugging and sensor network
integrity verification (signed messages will force the radio to
transmit all 32 bytes of data).
It does check SIGNING_IDENTIFIER byte to avoid illegal mixing of
signing backends in the network (as seen by this node) and it does
verify proper execution order on the API.
The dummy driver rejects all other signing backend protocols.

Signing backend is selected in MyConfig.h
This commit is contained in:
Patrick Fallberg
2015-02-17 23:25:16 +01:00
parent c2a75d064e
commit fca0d4b544
3 changed files with 191 additions and 2 deletions
+12 -2
View File
@@ -15,9 +15,13 @@
#define MYSENSORS_RF_NRF24
//#define MYSENSORS_RF_RF69
// Choose signing backend by enabling one of the following
#define MYSENSORS_SIGNING_DUMMY
// Define a suitable timeout for a signature verification session
// Consider the turnaround from a nonce being generated to a signed message being received
// which might vary, especially in networks with many hops. 5s ought to be enough for anyone.
#define VERIFICATION_TIMEOUT_MS 5000
#ifdef MYSENSORS_RF_NRF24
#include "MyRFDriverNRF24.h"
@@ -29,6 +33,12 @@ typedef class MyRFDriverNRF24 MyRFDriverClass;
typedef class MyRFDriverRF69 MyRFDriverClass;
#endif
#ifdef MYSENSORS_SIGNING_DUMMY
#include "MySigningDriverDummy.h"
#define SIGNING_IDENTIFIER (0) // Reserved for dummy implementation, will not work with other backends
typedef class MySigningDriverDummy MySigningDriverClass;
#endif
/***
* Enable/Disable debug logging
*/