Skip to content

Commit 0ecf632

Browse files
committed
Merge pull request arduino#301 from fallberg/security
Resolve open bugs relating to security
2 parents 9e8d0cf + 62f522a commit 0ecf632

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

libraries/MySensors/core/MyTransport.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -555,6 +555,9 @@ void transportPresentNode() {
555555
#else
556556
_sendRoute(build(_msg, _nc.nodeId, GATEWAY_ADDRESS, NODE_SENSOR_ID, C_INTERNAL, I_REQUEST_SIGNING, false).set(false));
557557
#endif
558+
#else
559+
// We do not support signing, make sure gateway knows this
560+
_sendRoute(build(_msg, _nc.nodeId, GATEWAY_ADDRESS, NODE_SENSOR_ID, C_INTERNAL, I_REQUEST_SIGNING, false).set(false));
558561
#endif
559562

560563
// Send presentation for this radio node

libraries/MySensors/examples/SecureActuator/SecureActuator.ino

+2-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,8 @@ void loop()
111111
*/
112112
void receive(const MyMessage &message) {
113113
// We only expect one type of message from controller. But we better check anyway.
114-
if (message.type==V_LOCK_STATUS && message.sensor<=NOF_LOCKS) {
114+
// And acks are not accepted as control messages
115+
if (message.type==V_LOCK_STATUS && message.sensor<=NOF_LOCKS && !mGetAck(message)) {
115116
// Change relay state
116117
digitalWrite(message.sensor-1+LOCK_1, message.getBool()?LOCK_LOCK:LOCK_UNLOCK);
117118
// Store state in eeprom

0 commit comments

Comments
 (0)