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.
This commit is contained in:
Patrick Fallberg
2016-01-10 14:04:32 +01:00
parent ed75b16ea2
commit ae7a889389
@@ -102,7 +102,8 @@ void loop()
void incomingMessage(const MyMessage &message) {
// We only expect one type of message from controller. But we better check anyway.
if (message.type==V_LOCK_STATUS && message.sensor<=NOF_LOCKS) {
// And acks are not accepted as control messages
if (message.type==V_LOCK_STATUS && message.sensor<=NOF_LOCKS && !mGetAck(message)) {
// Change relay state
digitalWrite(message.sensor-1+LOCK_1, message.getBool()?LOCK_LOCK:LOCK_UNLOCK);
// Store state in eeprom