MY_DEBUG_VERBOSE_SIGNING flag implemented

This enables more verbose debug information for signing operations.

Fixes #319
This commit is contained in:
Patrick Fallberg
2016-01-12 08:43:10 +01:00
parent ff015dd373
commit 58dbc2ad27
6 changed files with 15 additions and 6 deletions
+7 -1
View File
@@ -35,10 +35,16 @@
// final sketch but is helpful to see what is actually is happening during development // final sketch but is helpful to see what is actually is happening during development
//#define MY_DEBUG //#define MY_DEBUG
// Enable MY_DEBUG_VERBOSE flag for verbose debug prints. Requires DEBUG to be enabled. // Enable MY_DEBUG_VERBOSE flag for verbose debug prints related to RF24 radio.
// Requires DEBUG to be enabled.
// This will add even more to the size of the final sketch! // This will add even more to the size of the final sketch!
//#define MY_DEBUG_VERBOSE //#define MY_DEBUG_VERBOSE
// Enable MY_DEBUG_VERBOSE_SIGNING flag for verbose debug prints related to signing.
// Requires DEBUG to be enabled.
// This will add even more to the size of the final sketch!
//#define MY_DEBUG_VERBOSE_SIGNING
// Enable this in sketch if you want to use TX(1), RX(0) as normal I/O pin // Enable this in sketch if you want to use TX(1), RX(0) as normal I/O pin
//#define MY_DISABLED_SERIAL //#define MY_DISABLED_SERIAL
+1 -1
View File
@@ -24,7 +24,7 @@
#define SIGNING_PRESENTATION_REQUIRE_SIGNATURES (1 << 0) #define SIGNING_PRESENTATION_REQUIRE_SIGNATURES (1 << 0)
#define SIGNING_PRESENTATION_REQUIRE_WHITELISTING (1 << 1) #define SIGNING_PRESENTATION_REQUIRE_WHITELISTING (1 << 1)
#if defined(MY_DEBUG_VERBOSE) #if defined(MY_DEBUG_VERBOSE_SIGNING)
#define SIGN_DEBUG(x,...) debug(x, ##__VA_ARGS__) #define SIGN_DEBUG(x,...) debug(x, ##__VA_ARGS__)
#else #else
#define SIGN_DEBUG(x,...) #define SIGN_DEBUG(x,...)
@@ -29,7 +29,7 @@
#define SIGNING_IDENTIFIER (1) #define SIGNING_IDENTIFIER (1)
// Define MY_DEBUG_VERBOSE in your sketch to enable signing backend debugprints // Define MY_DEBUG_VERBOSE_SIGNING in your sketch to enable signing backend debugprints
ATSHA204Class atsha204(MY_SIGNING_ATSHA204_PIN); ATSHA204Class atsha204(MY_SIGNING_ATSHA204_PIN);
unsigned long _signing_timestamp; unsigned long _signing_timestamp;
@@ -48,7 +48,7 @@ static void signerCalculateSignature(MyMessage &msg);
static uint8_t* signerSha256(const uint8_t* data, size_t sz); static uint8_t* signerSha256(const uint8_t* data, size_t sz);
#ifdef MY_DEBUG_VERBOSE #ifdef MY_DEBUG_VERBOSE_SIGNING
static char i2h(uint8_t i) static char i2h(uint8_t i)
{ {
uint8_t k = i & 0x0F; uint8_t k = i & 0x0F;
@@ -33,7 +33,7 @@
#define SIGNING_IDENTIFIER (1) #define SIGNING_IDENTIFIER (1)
// Define MY_DEBUG_VERBOSE in your sketch to enable signing backend debugprints // Define MY_DEBUG_VERBOSE_SIGNING in your sketch to enable signing backend debugprints
Sha256Class _signing_sha256; Sha256Class _signing_sha256;
unsigned long _signing_timestamp; unsigned long _signing_timestamp;
@@ -51,7 +51,7 @@ const uint8_t _signing_node_serial_info[SHA204_SERIAL_SZ] = {MY_SIGNING_SOFT_SER
static void signerCalculateSignature(MyMessage &msg); static void signerCalculateSignature(MyMessage &msg);
#ifdef MY_DEBUG_VERBOSE #ifdef MY_DEBUG_VERBOSE_SIGNING
static char i2h(uint8_t i) static char i2h(uint8_t i)
{ {
uint8_t k = i & 0x0F; uint8_t k = i & 0x0F;
@@ -43,6 +43,7 @@
*/ */
#define MY_DEBUG //!< Enable debug prints to serial monitor #define MY_DEBUG //!< Enable debug prints to serial monitor
#define MY_DEBUG_VERBOSE_SIGNING //!< Enable signing related debug prints to serial monitor
// Enable and select radio type attached // Enable and select radio type attached
#define MY_RADIO_NRF24 //!< NRF24L01 radio driver #define MY_RADIO_NRF24 //!< NRF24L01 radio driver
+2
View File
@@ -32,6 +32,8 @@ smartSleep KEYWORD2
AUTO LITERAL1 AUTO LITERAL1
MY_DEBUG LITERAL1 MY_DEBUG LITERAL1
MY_CORE_ONLY LITERAL1 MY_CORE_ONLY LITERAL1
MY_DEBUG_VERBOSE LITERAL1
MY_DEBUG_VERBOSE_SIGNING LITERAL1
MY_REPEATER_FEATURE LITERAL1 MY_REPEATER_FEATURE LITERAL1
MY_RADIO_NRF24 LITERAL1 MY_RADIO_NRF24 LITERAL1
MY_RADIO_RFM69 LITERAL1 MY_RADIO_RFM69 LITERAL1