Skip to content

Commit 62f522a

Browse files
committed
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.
1 parent ca43585 commit 62f522a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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)