Merge pull request #397 from fallberg/encryptiontests
Added NRF24 and RFM69 encryption to Jenkins tests
This commit is contained in:
@@ -32,7 +32,7 @@ bool transportInit() {
|
|||||||
#ifdef MY_RFM69_ENABLE_ENCRYPTION
|
#ifdef MY_RFM69_ENABLE_ENCRYPTION
|
||||||
uint8_t _psk[16];
|
uint8_t _psk[16];
|
||||||
hwReadConfigBlock((void*)_psk, (void*)EEPROM_RF_ENCRYPTION_AES_KEY_ADDRESS, 16);
|
hwReadConfigBlock((void*)_psk, (void*)EEPROM_RF_ENCRYPTION_AES_KEY_ADDRESS, 16);
|
||||||
_radio.encrypt(_psk);
|
_radio.encrypt((const char*)_psk);
|
||||||
memset(_psk, 0, 16); // Make sure it is purged from memory when set
|
memset(_psk, 0, 16); // Make sure it is purged from memory when set
|
||||||
#endif
|
#endif
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -31,6 +31,8 @@
|
|||||||
#define PSTR(x) (x)
|
#define PSTR(x) (x)
|
||||||
#elif defined(ARDUINO_ARCH_ESP8266)
|
#elif defined(ARDUINO_ARCH_ESP8266)
|
||||||
#include <pgmspace.h>
|
#include <pgmspace.h>
|
||||||
|
#elif defined(ARDUINO_ARCH_SAMD)
|
||||||
|
#define printf_P printf
|
||||||
#else
|
#else
|
||||||
#include <avr/pgmspace.h>
|
#include <avr/pgmspace.h>
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
+5
-17
@@ -20,25 +20,13 @@
|
|||||||
*/
|
*/
|
||||||
#define MY_DEBUG
|
#define MY_DEBUG
|
||||||
#define MY_DEBUG_VERBOSE_SIGNING
|
#define MY_DEBUG_VERBOSE_SIGNING
|
||||||
#define MY_RADIO_NRF24 //!< NRF24L01 radio driver
|
#define MY_RADIO_NRF24
|
||||||
//#define MY_SIGNING_SOFT //!< Software signing
|
//#define MY_SIGNING_SOFT
|
||||||
#define MY_SIGNING_ATSHA204 //!< Hardware signing using ATSHA204A
|
#define MY_SIGNING_ATSHA204
|
||||||
//#define MY_SIGNING_NODE_WHITELISTING {{.nodeId = GATEWAY_ADDRESS,.serial = {0x09,0x08,0x07,0x06,0x05,0x04,0x03,0x02,0x01}}}
|
//#define MY_SIGNING_NODE_WHITELISTING {{.nodeId = GATEWAY_ADDRESS,.serial = {0x09,0x08,0x07,0x06,0x05,0x04,0x03,0x02,0x01}}}
|
||||||
#define MY_SIGNING_REQUEST_SIGNATURES
|
#define MY_SIGNING_REQUEST_SIGNATURES
|
||||||
#define MY_SIGNING_SOFT_RANDOMSEED_PIN 7 //!< Unconnected analog pin for random seed
|
#define MY_SIGNING_SOFT_RANDOMSEED_PIN 7
|
||||||
#define MY_SIGNING_ATSHA204_PIN 17 //!< A3 - pin where ATSHA204 is attached
|
#define MY_SIGNING_ATSHA204_PIN 17
|
||||||
|
|
||||||
#include <SPI.h>
|
#include <SPI.h>
|
||||||
#include <MySensor.h>
|
#include <MySensor.h>
|
||||||
|
|
||||||
void setup() {
|
|
||||||
}
|
|
||||||
|
|
||||||
void presentation() {
|
|
||||||
// Present locally attached sensors here
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void loop() {
|
|
||||||
// Send locally attached sensors data here
|
|
||||||
}
|
|
||||||
|
|||||||
+5
-17
@@ -20,25 +20,13 @@
|
|||||||
*/
|
*/
|
||||||
#define MY_DEBUG
|
#define MY_DEBUG
|
||||||
#define MY_DEBUG_VERBOSE_SIGNING
|
#define MY_DEBUG_VERBOSE_SIGNING
|
||||||
#define MY_RADIO_NRF24 //!< NRF24L01 radio driver
|
#define MY_RADIO_NRF24
|
||||||
//#define MY_SIGNING_SOFT //!< Software signing
|
//#define MY_SIGNING_SOFT
|
||||||
#define MY_SIGNING_ATSHA204 //!< Hardware signing using ATSHA204A
|
#define MY_SIGNING_ATSHA204
|
||||||
#define MY_SIGNING_NODE_WHITELISTING {{.nodeId = GATEWAY_ADDRESS,.serial = {0x09,0x08,0x07,0x06,0x05,0x04,0x03,0x02,0x01}}}
|
#define MY_SIGNING_NODE_WHITELISTING {{.nodeId = GATEWAY_ADDRESS,.serial = {0x09,0x08,0x07,0x06,0x05,0x04,0x03,0x02,0x01}}}
|
||||||
#define MY_SIGNING_REQUEST_SIGNATURES
|
#define MY_SIGNING_REQUEST_SIGNATURES
|
||||||
#define MY_SIGNING_SOFT_RANDOMSEED_PIN 7 //!< Unconnected analog pin for random seed
|
#define MY_SIGNING_SOFT_RANDOMSEED_PIN 7
|
||||||
#define MY_SIGNING_ATSHA204_PIN 17 //!< A3 - pin where ATSHA204 is attached
|
#define MY_SIGNING_ATSHA204_PIN 17
|
||||||
|
|
||||||
#include <SPI.h>
|
#include <SPI.h>
|
||||||
#include <MySensor.h>
|
#include <MySensor.h>
|
||||||
|
|
||||||
void setup() {
|
|
||||||
}
|
|
||||||
|
|
||||||
void presentation() {
|
|
||||||
// Present locally attached sensors here
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void loop() {
|
|
||||||
// Send locally attached sensors data here
|
|
||||||
}
|
|
||||||
|
|||||||
+33
@@ -0,0 +1,33 @@
|
|||||||
|
/*
|
||||||
|
* The MySensors Arduino library handles the wireless radio link and protocol
|
||||||
|
* between your home built sensors/actuators and HA controller of choice.
|
||||||
|
* The sensors forms a self healing radio network with optional repeaters. Each
|
||||||
|
* repeater and gateway builds a routing tables in EEPROM which keeps track of the
|
||||||
|
* network topology allowing messages to be routed to nodes.
|
||||||
|
*
|
||||||
|
* Created by Henrik Ekblad <henrik.ekblad@mysensors.org>
|
||||||
|
* Copyright (C) 2013-2015 Sensnology AB
|
||||||
|
* Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors
|
||||||
|
*
|
||||||
|
* Documentation: http://www.mysensors.org
|
||||||
|
* Support Forum: http://forum.mysensors.org
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU General Public License
|
||||||
|
* version 2 as published by the Free Software Foundation.
|
||||||
|
*
|
||||||
|
*******************************
|
||||||
|
*/
|
||||||
|
#define MY_DEBUG
|
||||||
|
#define MY_DEBUG_VERBOSE_SIGNING
|
||||||
|
#define MY_RADIO_NRF24
|
||||||
|
//#define MY_SIGNING_SOFT
|
||||||
|
#define MY_SIGNING_ATSHA204
|
||||||
|
#define MY_SIGNING_NODE_WHITELISTING {{.nodeId = GATEWAY_ADDRESS,.serial = {0x09,0x08,0x07,0x06,0x05,0x04,0x03,0x02,0x01}}}
|
||||||
|
#define MY_SIGNING_REQUEST_SIGNATURES
|
||||||
|
#define MY_SIGNING_SOFT_RANDOMSEED_PIN 7
|
||||||
|
#define MY_SIGNING_ATSHA204_PIN 17
|
||||||
|
#define MY_RF24_ENABLE_ENCRYPTION
|
||||||
|
|
||||||
|
#include <SPI.h>
|
||||||
|
#include <MySensor.h>
|
||||||
+33
@@ -0,0 +1,33 @@
|
|||||||
|
/*
|
||||||
|
* The MySensors Arduino library handles the wireless radio link and protocol
|
||||||
|
* between your home built sensors/actuators and HA controller of choice.
|
||||||
|
* The sensors forms a self healing radio network with optional repeaters. Each
|
||||||
|
* repeater and gateway builds a routing tables in EEPROM which keeps track of the
|
||||||
|
* network topology allowing messages to be routed to nodes.
|
||||||
|
*
|
||||||
|
* Created by Henrik Ekblad <henrik.ekblad@mysensors.org>
|
||||||
|
* Copyright (C) 2013-2015 Sensnology AB
|
||||||
|
* Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors
|
||||||
|
*
|
||||||
|
* Documentation: http://www.mysensors.org
|
||||||
|
* Support Forum: http://forum.mysensors.org
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU General Public License
|
||||||
|
* version 2 as published by the Free Software Foundation.
|
||||||
|
*
|
||||||
|
*******************************
|
||||||
|
*/
|
||||||
|
#define MY_DEBUG
|
||||||
|
#define MY_DEBUG_VERBOSE_SIGNING
|
||||||
|
#define MY_RADIO_RFM69
|
||||||
|
//#define MY_SIGNING_SOFT
|
||||||
|
#define MY_SIGNING_ATSHA204
|
||||||
|
#define MY_SIGNING_NODE_WHITELISTING {{.nodeId = GATEWAY_ADDRESS,.serial = {0x09,0x08,0x07,0x06,0x05,0x04,0x03,0x02,0x01}}}
|
||||||
|
#define MY_SIGNING_REQUEST_SIGNATURES
|
||||||
|
#define MY_SIGNING_SOFT_RANDOMSEED_PIN 7
|
||||||
|
#define MY_SIGNING_ATSHA204_PIN 17
|
||||||
|
#define MY_RFM69_ENABLE_ENCRYPTION
|
||||||
|
|
||||||
|
#include <SPI.h>
|
||||||
|
#include <MySensor.h>
|
||||||
+5
-17
@@ -20,25 +20,13 @@
|
|||||||
*/
|
*/
|
||||||
#define MY_DEBUG
|
#define MY_DEBUG
|
||||||
#define MY_DEBUG_VERBOSE_SIGNING
|
#define MY_DEBUG_VERBOSE_SIGNING
|
||||||
#define MY_RADIO_NRF24 //!< NRF24L01 radio driver
|
#define MY_RADIO_NRF24
|
||||||
#define MY_SIGNING_SOFT //!< Software signing
|
#define MY_SIGNING_SOFT
|
||||||
//#define MY_SIGNING_ATSHA204 //!< Hardware signing using ATSHA204A
|
//#define MY_SIGNING_ATSHA204
|
||||||
//#define MY_SIGNING_NODE_WHITELISTING {{.nodeId = GATEWAY_ADDRESS,.serial = {0x09,0x08,0x07,0x06,0x05,0x04,0x03,0x02,0x01}}}
|
//#define MY_SIGNING_NODE_WHITELISTING {{.nodeId = GATEWAY_ADDRESS,.serial = {0x09,0x08,0x07,0x06,0x05,0x04,0x03,0x02,0x01}}}
|
||||||
#define MY_SIGNING_REQUEST_SIGNATURES
|
#define MY_SIGNING_REQUEST_SIGNATURES
|
||||||
#define MY_SIGNING_SOFT_RANDOMSEED_PIN 7 //!< Unconnected analog pin for random seed
|
#define MY_SIGNING_SOFT_RANDOMSEED_PIN 7
|
||||||
#define MY_SIGNING_ATSHA204_PIN 17 //!< A3 - pin where ATSHA204 is attached
|
#define MY_SIGNING_ATSHA204_PIN 17
|
||||||
|
|
||||||
#include <SPI.h>
|
#include <SPI.h>
|
||||||
#include <MySensor.h>
|
#include <MySensor.h>
|
||||||
|
|
||||||
void setup() {
|
|
||||||
}
|
|
||||||
|
|
||||||
void presentation() {
|
|
||||||
// Present locally attached sensors here
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void loop() {
|
|
||||||
// Send locally attached sensors data here
|
|
||||||
}
|
|
||||||
|
|||||||
+5
-17
@@ -20,25 +20,13 @@
|
|||||||
*/
|
*/
|
||||||
#define MY_DEBUG
|
#define MY_DEBUG
|
||||||
#define MY_DEBUG_VERBOSE_SIGNING
|
#define MY_DEBUG_VERBOSE_SIGNING
|
||||||
#define MY_RADIO_NRF24 //!< NRF24L01 radio driver
|
#define MY_RADIO_NRF24
|
||||||
#define MY_SIGNING_SOFT //!< Software signing
|
#define MY_SIGNING_SOFT
|
||||||
//#define MY_SIGNING_ATSHA204 //!< Hardware signing using ATSHA204A
|
//#define MY_SIGNING_ATSHA204
|
||||||
#define MY_SIGNING_NODE_WHITELISTING {{.nodeId = GATEWAY_ADDRESS,.serial = {0x09,0x08,0x07,0x06,0x05,0x04,0x03,0x02,0x01}}}
|
#define MY_SIGNING_NODE_WHITELISTING {{.nodeId = GATEWAY_ADDRESS,.serial = {0x09,0x08,0x07,0x06,0x05,0x04,0x03,0x02,0x01}}}
|
||||||
#define MY_SIGNING_REQUEST_SIGNATURES
|
#define MY_SIGNING_REQUEST_SIGNATURES
|
||||||
#define MY_SIGNING_SOFT_RANDOMSEED_PIN 7 //!< Unconnected analog pin for random seed
|
#define MY_SIGNING_SOFT_RANDOMSEED_PIN 7
|
||||||
#define MY_SIGNING_ATSHA204_PIN 17 //!< A3 - pin where ATSHA204 is attached
|
#define MY_SIGNING_ATSHA204_PIN 17
|
||||||
|
|
||||||
#include <SPI.h>
|
#include <SPI.h>
|
||||||
#include <MySensor.h>
|
#include <MySensor.h>
|
||||||
|
|
||||||
void setup() {
|
|
||||||
}
|
|
||||||
|
|
||||||
void presentation() {
|
|
||||||
// Present locally attached sensors here
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void loop() {
|
|
||||||
// Send locally attached sensors data here
|
|
||||||
}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user