Commit Graph
276 Commits
Author SHA1 Message Date
Patrick Fallberg c2a75d064e Signing driver framework
The signing driver framework resembles the radio driver framework
in the sense that it relies on MyConfig.h for driver specific
settings. This allows the constructor to be clean and the API less
likely to need change.

The API is designed with function pairs for sender and receiver of
a signed message.
The sender of a signed message uses putNonce() and signMsg()
and the receiver of a signed message uses getNonce() and
verifyMsg().
In addition, receiver is expected to call checkTimer() at regular
intervals to make sure the message session does not time out.

The program flow is that the sender transmit, after determining
that the message needs signing, a request to the receiver for a
nonce (I_GET_NONCE). The receiver calls getNonce() to obtain a
nonce and transmits the nonce back to the sender
(I_GET_NONCE_RESPONSE).
The sender stores the received nonce in the driver with putNonce()
and then calls signMsg() to sign the message to be transmitted.
The receiver then calls verifyMsg() to authenticate the signed
message using the nonce transmitted earlier.

The flow is described below:
---------------- --------            ---------- ------------------
|senders driver| |sender|            |receiver| |receivers driver|
---------------- --------            ---------- ------------------
        |            |    I_GET_NONCE     |  getNonce()  |
        |            |------------------->|------------->|
        |            |                    |              |
        | setNonce() |I_GET_NONCE_RESPONSE|              |
        |<-----------|<-------------------|<-------------|
        | signMsg()  |                    |              |
        |<-----------|                    | verifyMsg()  |
        |----------->|------------------->|------------->|
        |            |                    | OK / not OK  |
        |            |                    |<-------------|

It is expected that all signing schemes is built upon this
principle.
2015-02-17 23:25:08 +01:00
Patrick Fallberg 9f337e3cae Message header updates for signing support
One bit in the protocol version field is converted to a sign
indicator. '1' means the message carries a signature in the
unused part of the payload data buffer.

Three new internal message types have been defined:

 * I_REQUEST_SIGNING    carries a boolean and is used to exchange
                        signing requirement information between
                        nodes.
                        If the I_REQUEST_SIGNING carries 'true'
                        the receiver is informed that the sender
                        require properly signed messages in order
                        to be able to accept the messages.
 * I_GET_NONCE          is passed from sender to a receiver that
                        require signing tellig it to submit a
                        cryptographic 'nonce' that the sender needs
                        in order to be able to sign the message it
                        intend to send. The I_GET_NONCE carries no
                        payload.
 * I_GET_NONCE_RESPONSE is sent by the receiver of a signed
                        message in response to I_GET_NONCE.
                        The first byte of the payload is a signing
                        identifier informing the sender of the
                        signed message about the type of signature
                        the receiver is expecting.
2015-02-17 23:25:00 +01:00
Henrik Ekblad 8b8f623627 Merge branch 'development' of https://github.com/mysensors/Arduino.git into development 2015-02-17 22:29:01 +01:00
Henrik Ekblad 8b6463608a Fix merge error 2015-02-17 22:28:47 +01:00
Marcelo Aquino 60d6c4fc3c add MYSENSORS_MQTT_GATEWAY definition 2015-02-17 17:24:51 -02:00
Henrik Ekblad 75ea4bc26a Merge branch 'development' of https://github.com/mysensors/Arduino.git into development 2015-02-17 14:32:08 +01:00
Henrik Ekblad 93a23442e1 Add V_RGB, V_RGBW payload types and S_COLOR device type. 2015-02-17 14:31:52 +01:00
Patrick Fallberg 4d3fc96ebf ATSHA204 personalization sketch updated
New default pin is A3.

New option to skip UART confirmation: SKIP_UART_CONFIRMATION
This option prohibits the possibility to auto-generate key as there
will probably not be a way to show the generated key to the user.

More copy+paste friendly serial output of the generated key for
insertion into personalization sketch.
2015-02-16 22:30:50 +01:00
Marcelo Aquino f3c60a068f process() uses sendRoute() for routing decisions
To keep routing decisions in one place, and avoid rewriting the same
code to add failedTransmissions count to process()
2015-02-13 02:01:18 -02:00
Henrik Ekblad 50c8c44b08 Merge branch 'master' into development
Conflicts:
	libraries/MySensors/MyGateway.cpp
	libraries/MySensors/MySensor.cpp
2015-02-12 22:42:50 +01:00
Henrik Ekblad 9fecc53dfb Merge pull request #62 from mapnull/hotfix-autoFindParent_response
Accept a new parent only when autoFindParent is 1
2015-02-12 22:23:13 +01:00
Henrik Ekblad 80bd4df230 Merge pull request #61 from mapnull/hotfix-parentId_eeprom
Write parentNodeId to eeprom only when differ
2015-02-12 22:15:37 +01:00
Henrik Ekblad de2bfbf833 Merge pull request #60 from mapnull/hotfix-chk_invalid_gw_input
check for invalid input on gateway
2015-02-12 22:12:41 +01:00
Henrik Ekblad 6f0ea1f943 Merge branch 'master' into development 2015-02-12 22:11:42 +01:00
Henrik Ekblad c8883c61e6 Request parent missing in setup() 2015-02-12 21:58:16 +01:00
Marcelo Aquino d92918c80a Accept a new parent only when autoFindParent is 1
In a gateway, I_FIND_PARENT_RESPONSE messages was returning as true by
process(). With this commit it will return as false, is this the right
expected behavior?
2015-02-11 12:22:27 -02:00
Marcelo Aquino 57e8947218 Write parentNodeId to eeprom only when differ 2015-02-11 11:42:07 -02:00
Marcelo Aquino ca272743e6 check for invalid input on gateway
To prevent incomplete or chunked data being sent by the gateway
2015-02-11 11:24:45 -02:00
Marcelo Aquino 652d589fe3 add node to routing table before send an ack 2015-02-11 10:49:05 -02:00
Henrik Ekblad 17a680f1de Fix broadcast check for RF69 2015-02-11 00:07:19 +01:00
Henrik Ekblad b238a2e61e Merge branch 'master' into development
Conflicts:
	libraries/MySensors/MySensor.cpp
2015-02-10 23:38:05 +01:00
Henrik Ekblad 7b99a2ef94 Removed waitForReply(). Not needed anymore. 2015-02-10 22:25:13 +01:00
tekka007 08a0bc25ff simply wait() & adding watchdog resets
Simplify wait(), added watchdog reset to wait() and waitForReply().
Substituted all waitForReply() for wait(2000) to reduce code
size/complexity
2015-02-08 01:00:39 +01:00
tekka007 a6301f8521 Fixing endless loop 2015-02-07 21:42:49 +01:00
Marcelo Aquino ace0a38c93 Node set up only after having an id 2015-02-07 10:59:25 -02:00
Henrik Ekblad 576c092fd6 Merge pull request #54 from mapnull/hotfix-r255
Relay messages only after receiving an id
2015-02-07 10:56:12 +01:00
Henrik Ekblad db3dbadb9e Merge pull request #55 from mapnull/hotfix-rt_size
fix clear routing table data
2015-02-07 00:40:32 +01:00
Marcelo Aquino 381d98648f fix clear routing table data
childNodeTable is a pointer, will always return 2
2015-02-06 20:59:57 -02:00
Marcelo Aquino ff1ddc3807 Relay messages only after receiving an id 2015-02-06 19:09:51 -02:00
Thomas Mørch c3e30662af Added default mysensorMicro sketch 2015-02-05 19:17:44 +01:00
Thomas Mørch e462bc214c Added libraries for SPI flash, BMP180 and Si7021 2015-02-05 19:10:52 +01:00
Henrik Ekblad 97641902c9 Merge branch 'master' into development
Conflicts:
	libraries/MySensors/MySensor.cpp
2015-02-04 23:03:27 +01:00
Henrik Ekblad 08221e6567 Merge pull request #46 from tekka007/master
Failed transmissions count fixed  & Clear routing table extendend
2015-02-04 22:22:43 +01:00
Henrik Ekblad 42885d456b Merge branch 'master' of https://github.com/mysensors/Arduino.git 2015-02-04 22:09:02 +01:00
Henrik Ekblad 09f3ba5862 Save static parent to eeprom (for bootloader) 2015-02-04 22:08:50 +01:00
Henrik Ekblad 83be24d2be Return length from receive() 2015-02-04 22:04:32 +01:00
Marcelo Aquino 70e457d635 fix convBuf size to print P_CUSTOM payloads 2015-02-03 21:13:53 -02:00
Henrik Ekblad 615da4509c Fix ack problems RF24 2015-02-03 23:58:38 +01:00
Henrik Ekblad 8aeaceb35f Merge branch 'master' into development
Conflicts:
	libraries/MySensors/MyGateway.cpp
	libraries/MySensors/MySensor.cpp
	libraries/MySensors/examples/EthernetGateway/EthernetGateway.ino
2015-02-03 22:50:06 +01:00
Henrik Ekblad e1fa3dcd8e Merge pull request #45 from rhooper/wait-helper
Add wait() helper that doesn't sleep.
2015-02-03 22:06:17 +01:00
Marcelo Aquino 7f4f76580a get custom string from msg that isn't a stream type 2015-02-03 18:31:03 -02:00
Marcelo Aquino e8f7cb16a2 Fetch id through repeaters 2015-02-03 13:33:28 -02:00
tekka007 f06e91569c failedTransmissions=1 after findParentNode() 2015-02-03 12:15:31 +01:00
tekka007 6cfafab052 Revert "failedTransmissions=1 after findParentNode()"
This reverts commit 43755e51b8.
2015-02-03 12:08:09 +01:00
tekka007 43755e51b8 failedTransmissions=1 after findParentNode() 2015-02-03 12:04:30 +01:00
tekka007 81b6d3aa30 Clear routing table extendend
I_CHILDREN + "C" clears routing table, parent node and gw distance
followed by findParentNode.
2015-02-02 13:50:06 +01:00
Henrik Ekblad 7fb94546eb Merge pull request #44 from mapnull/hotfix-1.4
fix a possible parent repeater loop
2015-02-01 21:37:54 +01:00
Roy Hooper d45a48d8b7 Add wait() helper that doesn't sleep. Useful for repeaters and sensors that read from the network. 2015-02-01 15:00:45 -05:00
Henrik Ekblad dfd38ff3bc Removed arguments from constructor (use default). 2015-02-01 15:31:39 +01:00
Henrik Ekblad 2d214a1e58 Fix static id problem when using OTA bootloader. Reported by tekka. 2015-02-01 15:29:02 +01:00