Skip to content

Commit ae7a889

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 ed75b16 commit ae7a889

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

libraries/MySensors/examples/SecureActuator/SecureActuator.ino

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,8 @@ void loop()
102102

103103
void incomingMessage(const MyMessage &message) {
104104
// We only expect one type of message from controller. But we better check anyway.
105-
if (message.type==V_LOCK_STATUS && message.sensor<=NOF_LOCKS) {
105+
// And acks are not accepted as control messages
106+
if (message.type==V_LOCK_STATUS && message.sensor<=NOF_LOCKS && !mGetAck(message)) {
106107
// Change relay state
107108
digitalWrite(message.sensor-1+LOCK_1, message.getBool()?LOCK_LOCK:LOCK_UNLOCK);
108109
// Store state in eeprom

0 commit comments

Comments
 (0)