Commit Graph
100 Commits
Author SHA1 Message Date
Patrick Fallberg 29fd6d6345 Let signing backend validate personalization (#873)
For soft signing, let backend handle checksum verification of
personalization data. This ensures that the backends sha256 library is
used and avoids an unnecessary instanitation of the public library.
For atsha204 signing, no checksum verification is made, just chip
locking flags.

Fixes #872
2017-06-06 09:51:37 +02:00
Patrick Fallberg 7e6db413c7 Security personalizer rewritten (#794)
* Removed ability to lock data section
* Introduced "guided mode" to simplify process
* Refactored the sketch to be less monolithic
* Print details and instructions in tables
* Use device unique ID as serial when
* Calculate and store personalization checksum
* Print serial in a copy+paste friendly manner (fixes #804)
* Clarify meaning of UART confirmation (fixes #805)
2017-04-02 15:37:21 +02:00
Patrick Fallberg 91cb61b19e Fix doxygen problem in SPI.h 2017-02-02 10:00:29 +01:00
Patrick Fallberg 1040fbebc5 Refactor signing backend (#690)
Cleaned up the AES driver and removed some cppcheck isues
in the process.
2016-12-25 16:12:40 +01:00
Patrick Fallberg 8e1ef13804 Repo restyled using astyle (#683)
The rules are in .tools/astyle/config/style.cfg
and can also be reviewed at
https://www.mysensors.org/view/260#coding-guidelines-core-library
2016-12-07 23:44:29 +01:00
Patrick Fallberg 65bece33fd Add a SublimeText 3 MySensors project (#676)
Various plugins exist to enhance the experience. The project
file contain references for all plugins it holds configurations
for.
2016-12-02 12:26:50 -08:00
Patrick Fallberg ea65c5b150 Move Doxyfile to repository root (#674)
This makes most tools/plugins for Doxygen work without
much adjustment.
Also resolved some Doxygen warnings.
2016-11-29 11:18:49 +01:00
Patrick Fallberg 6564daec3e Update the pre-commit git hook (#667)
It now supports both Linux and Windows and checks
both coding style (astyle) and does static code
analysis (cppcheck).
Tested using "Bash on Ubuntu on Windows" and the
git shell (via GitHub for Windows).

Installation is done by executing hooks/install-hooks.sh
Windows users has to execute it in a cygwin based git shell.

Tools:
astyle (2.05.1 or newer)
cppcheck (1.76.1 or newer)
2016-11-28 14:57:26 -08:00
Patrick Fallberg fb872fae67 Clean up cppcheck suppressions 2016-11-25 14:27:43 +01:00
Patrick Fallberg c1d88b236d Add MySensors specific cppcheck config files (#660) 2016-11-24 23:39:17 +01:00
Patrick Fallberg 410fe2df95 Merge pull request #659 from tekka007/RFM95example
Fix timeout and add RFM95 test
2016-11-24 18:25:28 +01:00
Patrick Fallberg 45b671457d Coding style related changes (#653)
* Add .astylerc with the core coding standard

* Added pre-commit git hook

The hook currently only checks code format using
astyle and will not permit commits which cause
astyle to change the contents of any source file
in the commit.
This is useful to have automatic coding standard
verification done without having to wait for
Jenkins to react to a pull request.

Installation:
Linux:
ln -s ../../tools/hooks/pre-commit.sh .git/hooks/pre-commit
Windows:
copy tools\hooks\pre-commit.sh .git\hooks\pre-commit

* Added editorconfig and updated gitattributes

Unix style line endings are now default.

* Resolved doxygen warning
2016-11-24 16:43:04 +01:00
Patrick Fallberg 26375757cd README.md updated with new Jenkins URL:s 2016-11-21 17:02:25 +01:00
Patrick Fallberg c47a83f1da Make stability improvements in message signing
* Made delay waiting for GW to transmit signing preferences apply
  also if signing is disabled since nodes always sends a signing
  presentation, and GW always replies with it's own presentation.
  This can cause message collition if the node at the same time
  proceed with other presentation messages.

* Made the signing backend "consume" signing presentation
  messages sent by GW when signing is disabled. These messages
  should not be forwarded to the "user".
2016-10-30 12:01:35 +01:00
Patrick Fallberg afd7b7abbb Add MY_SIGNING_GW_REQUEST_SIGNATURES_FROM_ALL flag
This flag, when set in a gateway sketch will make the gateway
require all nodes to sign messages sent to it.
2016-10-18 22:02:19 +02:00
Patrick Fallberg 8cacb4825b Merge pull request #586 from Yveaux/pr585
Fix gateway RX indication
2016-09-22 19:02:11 +02:00
Patrick Fallberg 3519558703 Merge pull request #536 from tbowmo/preHwInit
Added default sketch for sensebender samd GW
2016-08-04 00:10:14 +02:00
Patrick Fallberg 4c0b7d6d02 Merge pull request #531 from henrikekblad/FixMQTTPresentation
Fix #449, Fix #507
2016-07-31 15:46:30 +02:00
Patrick Fallberg dda9cefd93 Merge pull request #517 from tekka007/ChangeInitOrder
Calling WiFi.config() before WiFi.begin()
2016-07-17 13:50:03 +02:00
Patrick Fallberg 934ccf30b2 Merge pull request #513 from tekka007/ShiftSetup
Call _nodeRegistration() before setup()
2016-07-17 13:49:46 +02:00
Patrick Fallberg 50b6277c45 Update README.md
Fixed doxygen links (these are broken on master as well).
2016-07-10 00:20:45 +02:00
Patrick Fallberg bc2cbbbe91 Update README.md
Updated links to Jenkins
2016-07-09 22:54:48 +02:00
Patrick Fallberg 4fd8775227 Fix for nightly IDE builds 2016-07-09 22:23:36 +02:00
Patrick Fallberg e086ba3203 Merge pull request #486 from tekka007/ESPCoreFix
Update MyMainESP8266 to compile with ESPlib 2.3.0
2016-06-28 19:00:10 +02:00
Patrick Fallberg 27ecc89773 Merge pull request #482 from fallberg/signing
Signing troubleshooting guide in Doxygen
2016-06-24 00:09:02 +02:00
Patrick Fallberg 0379330569 Update documentation with signing troubleshooting 2016-06-21 20:45:26 +02:00
Patrick Fallberg 012de4496f Added some RF-related debug prints in signing code
If a failed transmsission is detected, a debug print will give
a hint to why the signing session fails.
2016-06-21 20:34:57 +02:00
Patrick Fallberg 22ce382046 Update README.md
Doxygen links added and a nice headline for the CI statuses
2016-06-20 23:13:25 +02:00
Patrick Fallberg ea0e30683a Merge pull request #477 from tekka007/StaticENUMS
Define static enums in MyMessage
2016-06-20 20:35:00 +02:00
Patrick Fallberg 385d441d0e Merge pull request #474 from tekka007/SigningImprovement
Speedup signing presentation phase
2016-06-14 07:17:19 +02:00
Patrick Fallberg 1336da125b Merge pull request #472 from tekka007/SigningFix
Fix sending buffer in MySigning.cpp
2016-06-12 23:01:08 +02:00
Patrick Fallberg cd5c243f7b Handle inbound and outbound nonces simultaneously
Two separate buffers are used for nonce storage. One for the
nonce used for signing a message and one for the nonce used
for verifying a message.
2016-06-12 15:37:45 +02:00
Patrick Fallberg a0615b53a2 Make test sketches only set IO if not set in board
If a specific board is picked, some IO will be preconfigured
and should not be overridden by a sketch.
2016-06-12 15:37:45 +02:00
Patrick Fallberg 0a8aaedf8b Optimize ATSHA204 respose times
Instead of shutting down the ATSHA between calls in a session,
it is put in idle state. This removes the need for a full resync
when the device is woken and that saves time which translate to
a quicker turnaround time for signed messages with HW signing.
To save power, it is still shut down when not in use.
2016-06-12 15:37:45 +02:00
Patrick Fallberg a5b0e8d8bb Purge ATSHA204 backend of c++ code
There is no need for class structures in the atsha low-end driver.
Removing this saves both code space and compilation time.
2016-06-12 15:37:45 +02:00
Patrick Fallberg b01282c7c7 Improve nonce generation in signing backends
For atsha204, update seed every time and only extract
the full 32-byte random value once.
For both atsha204 and soft backends, XOR all random bytes
with hwMillis() in order to "whiten" the random value a bit.
2016-06-12 15:37:45 +02:00
Patrick Fallberg 6498354546 Merge pull request #470 from tekka007/FixIndication
Fix MyIndication definitions
2016-06-12 15:32:04 +02:00
Patrick Fallberg 4509df40dd Merge pull request #464 from Yveaux/development
Added power metering variables
2016-06-08 21:12:04 +02:00
Patrick Fallberg 585150c46d Add and use timing neutral memcmp for signing
Fixes #443
2016-05-22 18:34:00 +02:00
Patrick Fallberg 99084ec98d Add destination parameter to signingPresentation
In order to allow a node to send signed messages to another node
the signingPresentation function can be called to make a
node2node presentation of signing preferences.
It is up to the sketch developer to make sure updated signing
preferences are communicated accordingly.
2016-05-03 11:03:59 +02:00
Patrick Fallberg 41a9f4cf28 Merge pull request #397 from fallberg/encryptiontests
Added NRF24 and RFM69 encryption to Jenkins tests
2016-03-06 22:12:29 +01:00
Patrick Fallberg 235aa218dc Merge pull request #401 from tbowmo/samd
Interrupt pins was not configured correctly for RFM69
2016-02-17 21:54:12 +01:00
Patrick Fallberg 0d72bf2260 Fix complation error for NRF24 encryption 2016-02-16 10:10:22 +01:00
Patrick Fallberg 2d93722692 Merge pull request #399 from tbowmo/samd
Adapts RFM69 to be used with SAMD
2016-02-16 09:45:13 +01:00
Patrick Fallberg 53ea022035 Fix complation error for RFM69 encryption 2016-02-16 09:45:12 +01:00
Patrick Fallberg 21beab382b Added NRF24 and RFM69 encryption to Jenkins tests
Also cleaned up the other Jenkins test sketches.
2016-02-16 09:45:12 +01:00
Patrick Fallberg 1f27c3dd36 Update library.json version to 1.5.4 2016-02-07 13:08:21 +01:00
Patrick Fallberg 350bf568fb Merge pull request #386 from mysensors/add-optional-before-method
Add before() for initialisations before radio hogs SPI
2016-02-06 21:01:55 +01:00
Patrick Fallberg 72a40d69df Merge pull request #388 from mysensors/turn-off-access-point-on-wifi-mqtt
Turn off access point when running ESP8266 MQTT client
2016-02-06 21:01:39 +01:00
Patrick Fallberg 24aba671c1 Merge pull request #387 from mysensors/fix-udp-compile-problems
Fix compile problems when enabling UDP
2016-02-06 19:52:37 +01:00
Patrick Fallberg 5be0e2e3b5 Merge pull request #365 from ivankravets/patch-2
Fix version to stable
2016-02-02 16:14:49 +01:00
Patrick Fallberg 7de2764d2d Node lock feature
When activated, suspicious signing related activities will eventually
cause the node to lock down and transmit a I_LOCKED message to the
gateway at 30m intervals.
Unlocking is done by grounding a pin or erasing the EEPROM.
See Doxygen for details on use.
Fixes #280
2016-01-29 11:41:53 +01:00
Patrick Fallberg 4c3d700d87 Merge pull request #375 from mysensors/bring-old-prs-up-to-date
Bring old prs up to date
2016-01-28 10:28:12 +01:00
Patrick Fallberg 15167d69e8 Support building test sketches for ESP8266 2016-01-20 22:29:38 +01:00
Patrick Fallberg 4a5c0f9314 Make ESP8266 sketches explicitly declare GW
In order to build core tests, there cannot be any hard coded
GATEWAY flags (like MY_GATEWAY_ESP8266). These needs to be set
in the sketch that implements the gateway.
2016-01-20 22:07:45 +01:00
Patrick Fallberg 94c7f4451e Resolved Doxygen warnings relating to signing 2016-01-20 22:04:19 +01:00
Patrick Fallberg 842d575fc5 Implemented signing test sketches
These will automatically be built for every PR by Jenkins.
The test sketches in this commit evaluates signing (hard/soft) and
whitelisting (on/off). Full verbose signing debug is enabled.
RF24 radio is also enabled.
2016-01-20 20:51:58 +01:00
Patrick Fallberg 5a16cf0b5e Merge pull request #359 from fallberg/doxygen
Cleaned up Doxygen warnings
2016-01-20 01:06:50 +01:00
Patrick Fallberg dcb5cc9928 Cleaned up Doxygen include graphs 2016-01-19 23:56:28 +01:00
Patrick Fallberg 0f55969ace Cleaned up Doxygen warnings in library drivers 2016-01-19 23:56:27 +01:00
Patrick Fallberg 877cac266f Cleaned up Doxygen warnings in examples 2016-01-19 23:56:27 +01:00
Patrick Fallberg 5853cf5fe0 Cleaned up Doxygen warnings in libraries/MySensors/drivers/AVR 2016-01-19 23:56:26 +01:00
Patrick Fallberg 44b52f10be Cleaned up Doxygen warnings in MyConfig.h 2016-01-19 23:56:26 +01:00
Patrick Fallberg 0683709506 Cleaned up Doxygen warnings in libraries/MySensors/core 2016-01-19 23:56:25 +01:00
Patrick Fallberg 92f6585a90 Merge pull request #358 from fallberg/sign-fix
Make sure signing presentation data is sent correctly
2016-01-19 23:46:40 +01:00
Patrick Fallberg 6b6e829f93 Make sure signing presentation data is sent correctly
The message sender was retrieved from the message buffer after
prepareSigningPresentation() was called. This function resets
the message buffer so that is not the proper way to do it. Now,
the message sender is extracted first in signerProcessInternal()
in order to avoid the value being overwritten later on.
2016-01-19 09:17:18 +01:00
Patrick Fallberg f6d482d4ce Merge pull request #333 from Kolbi/patch-2
Update HumiditySensor.ino
2016-01-15 11:16:39 +01:00
Patrick Fallberg e966366968 Merge pull request #339 from tbowmo/samd
Fixes problem with MY_LED_BLINKING_FEATURE being enabled on all builds
2016-01-13 20:53:30 +01:00
Patrick Fallberg 1f365342c2 Merge pull request #342 from marcovannoord/development
Use the internal pullup to be able to hook up this sketch directly to S0 meters
2016-01-13 19:08:57 +01:00
Patrick Fallberg 74a54267d2 Merge pull request #305 from fallberg/signing_refactoring
Signing improvements
2016-01-12 17:08:43 +01:00
Patrick Fallberg c52d2cd643 All software security related data moved to EEPROM
The Sha204Personalizer has been converted to a SecurityPersonalizer.
It takes care of generation and storage of keys and data to both
ATSHA204A and nonvolatile storage (EEPROM).
Library has been updated to read any software security related data
from the corresponding EEPROM locations.

The effect this has is that any node using any security feature has to
execute the personalizer at least once to store appropriate values.
The benefit of this is that the software no longer contain sensitive data
such as HMAC or AES keys.
Whitelists still are stored in software as they are variable in size.
2016-01-12 10:26:58 +01:00
Patrick Fallberg 3bf9184670 Removed signing identifier from nonces
It serves no practical use to have signing identifier in nonces
as nonces are architecture independent.

Fixes #318
2016-01-12 08:43:11 +01:00
Patrick Fallberg 58dbc2ad27 MY_DEBUG_VERBOSE_SIGNING flag implemented
This enables more verbose debug information for signing operations.

Fixes #319
2016-01-12 08:43:10 +01:00
Patrick Fallberg ff015dd373 Signing whitelisting rewritten
Whitelisting is now supported by all nodes that support signing,
while only nodes that define a whitelist with
MY_SIGNING_NODE_WHITELISTING will check signatures against a whitelist.
This allows a single node in a network to have a whitelist without require
all nodes that communicate it to be configured for whitelisting. The node
will publish its whitelisting preferences to the gateway together with its
signing preferences. In other words; whitelisting is now working as signing
requirements does.
A node that use whitelisting will reject any message (signed or unsigned)
from nodes not present in its whitelist.

Fixes #279
2016-01-12 08:41:55 +01:00
Patrick Fallberg 5ecf146f15 Sha256 calculator for library use
The signing infrastructure now supports calculating sha256.
This feature does not require signing support to be activated.
Fixes #315
2016-01-12 08:41:54 +01:00
Patrick Fallberg 02fbe536d4 Signing infrastructure refactored
Signing logic has now been centralized to MySigning.cpp in order to simplify
maintenance and debugging.
Debug prints have been extended and "demoted" to verbose level.
To get signing related debug info, MY_DEBUG_VERBOSE will need to be defined.
This fixes #278
2016-01-12 08:41:54 +01:00
Patrick Fallberg b64f676316 Merge pull request #325 from tekka007/ClearConfig
HW-independent ClearEepromConfig, substitutes #314
2016-01-11 23:41:00 +01:00
Patrick Fallberg 91985beb9d Bumped version to 2.0.0-beta
Considering the magnitude of the delta between master and
development branch currently, 2.0.0-beta apperas to be a
more realistic version than 1.6.0-beta.
2016-01-10 12:52:07 +01:00
Patrick Fallberg cee1dd3a4e Merge pull request #323 from tbowmo/samd
LED HW definitions in arduino HW files overridable
2016-01-07 23:43:59 +01:00
Patrick Fallberg 3e0e4d601b Merge pull request #327 from Br3nda/patch-1
spelling correction in esp8266 example sketch
2016-01-07 15:45:22 +01:00
Patrick Fallberg 7ee39509eb Merge pull request #321 from Mickaelh51/development
Add Oregon decoder library
2016-01-04 23:03:29 +01:00
Patrick Fallberg ebf183c3cf Merge pull request #311 from tbowmo/samd
Samd
2016-01-03 23:35:32 +01:00
Patrick Fallberg 62f522a065 Prevent SecureActuator from accepting ACKs as commands
As ACKs are not currently signed, allowing ACKs as commands
is a considerable security hole for this sketch. This is now resolved.
2015-12-16 10:54:05 +01:00
Patrick Fallberg ca4358591d Make sure nodes not supporting signing informs GW
A node that does not support signing, still needs to inform the
gateway about this to make sure the gateway carries a valid signing
requirement table when a node Id that was requiering signing stops
doing this.
This fixes #286.
2015-12-16 10:53:53 +01:00
Patrick Fallberg 68e8c2438e Better output directory handling in doxygen 2015-12-11 12:35:18 +01:00
Patrick Fallberg ce36a087fa Adjusted MySigning documentation slightly based on feedback 2015-12-11 00:40:03 +01:00
Patrick Fallberg 313bcf05f8 Added some more docs for MyMessage 2015-12-11 00:40:03 +01:00
Patrick Fallberg 5142cdc936 Documentation styling made a bit more "MySensorish" 2015-12-11 00:40:03 +01:00
Patrick Fallberg 6bfe853709 Added doc default style templates and activated graphing 2015-12-11 00:40:03 +01:00
Patrick Fallberg 941503b24f Divided public and private/internal modules
Public modules can be declared as normal. Internal modules should
have @ingroup internals after the group definition.
2015-12-11 00:40:03 +01:00
Patrick Fallberg a69f2889bf Better file documentation for the MySigning group 2015-12-11 00:40:03 +01:00
Patrick Fallberg f34ed5466e Added documentation extension mapping for INO files 2015-12-11 00:40:03 +01:00
Patrick Fallberg 9f0a348fbf Removed obsolete Doxyfile tags 2015-12-11 00:40:02 +01:00
Patrick Fallberg 9d7a2fd6e3 Documented signing related functionality 2015-12-11 00:40:02 +01:00
Patrick Fallberg cc544909ce Doxygen warnings cleanup
But made sure that any undocumented parts generates a warning
2015-12-11 00:40:02 +01:00
Patrick Fallberg e9971285a5 Initial Doxyfile commit
Project named "MySensors Library & Examples"
Index root is libraries/MySensors with recursive search
No LaTeX generation
Documentation/html added to .gitignore
2015-12-11 00:40:02 +01:00
Patrick Fallberg 36dcf2b5b6 Let prints on GW:s be up to MY_GATEWAY_MAX_SEND_LENGTH large 2015-11-30 14:16:58 +01:00
Patrick Fallberg 8280479724 Removed requirement for payload data for signed messages 2015-11-27 13:53:10 +01:00
Patrick Fallberg f6e018f5e3 Fixed bug in repeaters when forwarding signed messages
For repeated messages, sign flag must not be touched.
2015-11-19 09:28:36 +01:00
Patrick Fallberg cec516bc7e Added support for private configuration data
libraries/MySensors/core/MyPrivateConfig.h.sample contain an example for
how private configuration data can be organized.
Rename that file to MyPrivateConfig.h and place it in the same folder
as the sketch you want to build and include it in order to add private
settings that you for various reasons do not want to store in git:
Make sure to place this include before

All MyPrivateConfig.h files are ignored by git.
2015-11-17 14:04:55 +01:00