Merge pull request #301 from fallberg/security

Resolve open bugs relating to security
This commit is contained in:
tekka007
2015-12-16 14:52:55 +01:00
2 changed files with 5 additions and 1 deletions
+3
View File
@@ -555,6 +555,9 @@ void transportPresentNode() {
#else #else
_sendRoute(build(_msg, _nc.nodeId, GATEWAY_ADDRESS, NODE_SENSOR_ID, C_INTERNAL, I_REQUEST_SIGNING, false).set(false)); _sendRoute(build(_msg, _nc.nodeId, GATEWAY_ADDRESS, NODE_SENSOR_ID, C_INTERNAL, I_REQUEST_SIGNING, false).set(false));
#endif #endif
#else
// We do not support signing, make sure gateway knows this
_sendRoute(build(_msg, _nc.nodeId, GATEWAY_ADDRESS, NODE_SENSOR_ID, C_INTERNAL, I_REQUEST_SIGNING, false).set(false));
#endif #endif
// Send presentation for this radio node // Send presentation for this radio node
@@ -111,7 +111,8 @@ void loop()
*/ */
void receive(const MyMessage &message) { void receive(const MyMessage &message) {
// We only expect one type of message from controller. But we better check anyway. // 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 // Change relay state
digitalWrite(message.sensor-1+LOCK_1, message.getBool()?LOCK_LOCK:LOCK_UNLOCK); digitalWrite(message.sensor-1+LOCK_1, message.getBool()?LOCK_LOCK:LOCK_UNLOCK);
// Store state in eeprom // Store state in eeprom