Commit Graph
31 Commits
Author SHA1 Message Date
Patrick Fallberg 2d5404de97 CppCheck cleanup (#975)
* Add support for inline cppcheck suppressions
* Clean out all known cppcheck issues
* Terminate toll-gate on found cppcheck issues
2017-11-07 20:37:36 +01:00
tekka e2ac85afbb Reshuffle arch files (#974) 2017-11-06 21:24:38 +01:00
tekka b892aef6c3 Jenkins: Add STM32F1 support (#972) 2017-11-05 14:19:42 +01:00
tekka 9663d4c6b7 Harmonize type definitions (#970) 2017-11-04 14:38:33 +01:00
Patrick Fallberg 901258f165 Implement Jenkins pipelines as code (#948)
Jenkins has been updated with new jobs that scan and execute
Jenkinsfiles. These Jenkinsfiles encapsulates all logic for building
and validating the commits in both pull requests and merged pull
requests.

Filestructure is as follows:
  .ci/Jenkinsfile - This is the main Jenkinsfile that handles normal
                    pull request builds as well as merged pull request
                    post-validation.
		    Any repository in the MySensors GitHub organization
		    can implement this file and Jenkins will pick up
		    and execute it automatically.
  .ci/Jenkinsfile-nightly - This perform merged pull request
                            post-validation using the nightly builds of
			    the Arduino IDE to provide early compliancy
			    status of the MySensors library for
			    upcoming releases of the Arduino IDE
  .ci/ - This folder contain all the auxiliary scripts executed by the
         Jenkinsfiles as well

Fixes #934
2017-10-13 20:55:02 +02:00
d00616 f8e132fdb8 NRF5 fix 8 bit inttype handling (#943) 2017-10-01 20:40:32 +02:00
d00616 1b1cf8ff9c Nrf5 improvements (#938)
* Fix NRF5_ESB_readMessage, allways enable radio

* NRF5: fixes and improvements

- Compiles with arduino core for nRF52 (primo)
  MY_RADIO_NRF5_ESB stays unsupported with primo!

- Split ACK negation flag into
    MY_NRF5_ESB_REVERSE_ACK_TX
    MY_NRF5_ESB_REVERSE_ACK_RX

- MY_RADIO_NRF5_ESB changes to act more than NRF24

- MY_RADIO_NRF5_ESB better support for powerdown/standby

- Moved initialization from MyMainNRF5 to hwInit()
2017-09-30 22:55:55 +02:00
Olivier 0ed558f1d0 Make debug prints portable (#929) 2017-09-17 20:54:20 +02:00
Olivier a9ef29fa67 Update hwUniqueID() function (#921) 2017-09-04 23:37:11 +02:00
Frank Holtz 46557d129e NRF5: Fix sleep()
Fixes commit 5776d2b650
      NRF5: Fix and improve sleep(0) (#909)
2017-08-29 18:43:49 +02:00
d00616 5776d2b650 NRF5: Fix and improve sleep(0) (#909) 2017-08-29 09:29:03 +02:00
Olivier 463358209d Update STM32 support (#908) 2017-08-13 08:11:14 +02:00
Marcelo Aquino 90793e734c Prepend debug message only on serial gateway (#882) 2017-07-24 21:40:46 +02:00
Rainer Clasen 6f10745f0a Keep Serial from being linked when disabled (#877)
Even with MY_DISABLED_SERIAL defined, the linker is still adding the
Serial object to the binary.

That's because a) the MySensors *.cpp files are actually included
into the sketch and compiled as part of it (and not compiled
separately and then linked) and b) due the the default(?) behavior of
the linker (https://github.com/arduino/Arduino/issues/4579).
2017-07-24 21:33:46 +02:00
Olivier 4820475e5c NRF5: Enable critical section (#879) 2017-06-13 18:49:14 +02:00
d00616 e6925f69e8 Update more usage of hwGetentropy() (#869)
* Update more usage of hwGetentropy()

* Add hwGetentropy() to Teensy 3.5/3.6
2017-06-03 21:58:40 +02:00
Marcelo Aquino 28c4f3f19e Signing improvements package (#871)
* Signing support with MAX_PAYLOAD>32

Support in the signing backends to handle configurations
where MAX_PAYLOAD is more than 32 bytes.

Fixes #748

* Support big message signatures

Support for signing messages larger than 32 bytes.
This is not fully testable with the current version of
the library but the change would add theoretical support
for signing any sized messages.

Fixes #749

* Have gw properly indicate whitelisting preferences

If the gateway hold a signing whitelist, inform all
nodes of this requirement and not just nodes that hold
whitelists themselves.

Fixes #806

* Harden security

The flag MY_SIGNING_GW_REQUEST_SIGNATURES_FROM_ALL
has been removed. Gateway will now request signatures
from everyone by default.
In addition to this, no nodes in the network will allow
clearing of signing/whitelisting preferences by OTA
commands by default.
If the old behaviour is needed (suitable for gradual
signing roll out and development purposes) a new flag,
MY_SIGNING_WEAK_SECURITY can be set.

Fixes #807

* Signing debug messages rewritten

All signing related debug has been rewritten to
better match other core debug printouts.
Also, backends are updated to have a smaller
implementation delta.

* Simplified signing option implemented

Enable by MY_SIGNING_SIMPLE_PASSWD. Signing, and signing requirements
will be enabled, as will encryption. Whitelisting is optional.
The value provided to MY_SIGNING_SIMPLE_PASSWD is used as HMAC and AES
key. Whitelists use the first 8 bytes of the password and the ninth
byte from the node ID as serial.
Password is required to be at least 8 characters wide. It is zero
padded if it is not long enough to cover the AES (16 bytes) and HMAC
(32 bytes) keys. It is not recommended to have a password shorter than
32 bytes, and there is no need for a password longer than 32 bytes.

* Add documentation section for signing debug

* Add nRF5 encryption to simple signing option

* Restructure MySigning documentation

* Minor fixes for Linux
2017-05-31 17:13:29 +02:00
Marcelo Aquino 53d485828c Linux: Fix hwRandomNumberInit() (#861)
Fix #860.
Makes hwRandomNumberInit() independent of hwInit().
2017-05-23 20:34:59 -03:00
d00616 aeceb0b683 Fix rasperry pi hwGetentropy() (#856) 2017-05-23 16:41:46 -03:00
Olivier 97ed21ef3b Teensy3.5/3.6: Use TRNG for random seed (#859) 2017-05-23 20:37:12 +02:00
Olivier b5595e870d Teensy3: Define default radio pins (#857) 2017-05-21 22:22:01 +02:00
Olivier 00a4deddd6 Teensy: Update hwCPUVoltage() (#853) 2017-05-21 16:12:36 +02:00
Olivier abba1ec377 Minor updates STM32F1 support (#851) 2017-05-21 14:20:07 +02:00
d00616 6c12dddf5a Enhance randomness (AVR, ESP8266, Linux, NRF5) (#845)
This commit changes the way random numbers are available
with MySensors.

The AVR platform uses a 32 Bit random seed build from a floating
analog pin. The way of the generation of this seed is FIPS 140-2
compliant.

For support MCU with a fast way to generate random data, the
hwGetentropy() command is now available to allow rapid generation
of random data.

The ESP8266 platform uses the internal random source for randomness
for hwGetentropy() and Arduino's random() function.

The NRF5 platform initializes the pseudo random number generator
from internal hardware number generator. The internal AES-ECB unit
generates random data after filling with HWRNG data by AES-CBC.

On Linux getrandom() is implemented via syscall().

signerAtsha204SoftGetNonce speed:
AVR = ~14000us (sha204Soft)
NRF51 = ~152us (AES-CBC), 1739us (old sha204Soft)
NRF52 = ~31us (AES-CBC), 183us (old sha204Soft)
ESP8266 = ~20us (RANDOM_REG32), 380us (old sha204Soft)

All Nonce results tested for FIPS 140-2 compliance successfully.
2017-05-21 14:12:09 +02:00
Olivier b479a0cf3f Support for Teensy3 boards (#850) 2017-05-21 08:43:26 +02:00
Olivier e041bf4d74 NRF5: Updates for Jenkins verifier (#852) 2017-05-21 08:41:11 +02:00
d00616 726a20dad9 Add nrf5 platform (#830)
* Add NVRAM support

This is an EEPROM replacement based on MCU's internal Flash memory.
The NVRAM class is designed to be stateless. Each operation is
written to flash immediately.

The last 16k(nRF51)/32k(nRF52) of Flash memory are managed by the
VirtualPage class.  This class allows writing a single emulated 4k
page up 40,000 times.

The NVRAM class is a log based byte-wise storage allowing up to
40,000,000 writes depending on the number of used addresses.  Each
four allocated addresses from the beginning of the NVRAM reduce the
write log by one.

When first 256 bytes of the emulated storage are used, there is an
average writing capacity of 145,000 cycles per byte.

When the write log is full, the NVRAM is compressed into a new flash
page. After a new page is ready, the old page is released. This
process can take up to 4500 ms and cannot be interrupted.

The NVRAM functionality can easily be ported to ESP8266 or SAMD by
providing a Flash interface.

* Add NRF5 platform support

This is the support of the Nordic Semiconductor NRF51 (nrf51822,
nrf51422) and NRF52 (nrf52832) platform. Based on arduino-nRF5
(https://github.com/sandeepmistry/arduino-nRF5).

The included radio driver is compatible with the NRF24 devices.
Using a SoftDevice (BLE)is not supported and must be removed before
flashing MySensors with a "mass_erase" operation.
2017-05-14 11:53:01 +02:00
Marcelo Aquino 66ff5b2880 Linux: Add support for RFM69 (#823) 2017-04-19 22:40:21 +02:00
Olivier 26c237adad Restructure HAL files (arch) (#820) 2017-04-17 20:33:08 +02:00
Olivier 818f887926 Polishing code (#803) 2017-04-02 20:03:59 +02:00
Olivier b132a8a81e Transport update (#722)
* Major transport rework

* Adjust signal report calculations

* Minor driver optimizations

* Implement sanity check in legacy RFM69 driver

* Additional RFM69 rework

* RFM95 encryption

* Polishing
2017-03-28 20:31:08 +02:00