From 800f1312692b18ff93f02d41ec89b667c97d82eb Mon Sep 17 00:00:00 2001 From: hobbyquaker Date: Tue, 13 Oct 2026 11:16:54 +0200 Subject: [PATCH] fix(rfd): restore the channel AES policy when devices are republished After a coprocessor re-init (a LAN gateway reconnect, a module restart) republishAllDevices() re-adds every device and sets the user keys again, but not the per-channel authentication policy. The coprocessor starts with every channel off, so the events of a remote with AES active come in unauthenticated and rfd rejects them until the next restart or configuration write. Set the policy after a successful re-add with the values the interface keeps for the device, as the concentrator does after adding a device at start-up. Fixes #165 --- src/rfd/hm2/CCU2BidcosRemoteInterface.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/rfd/hm2/CCU2BidcosRemoteInterface.cpp b/src/rfd/hm2/CCU2BidcosRemoteInterface.cpp index 01bb5fcd..9ce7130c 100644 --- a/src/rfd/hm2/CCU2BidcosRemoteInterface.cpp +++ b/src/rfd/hm2/CCU2BidcosRemoteInterface.cpp @@ -501,6 +501,12 @@ bool CCU2BidcosRemoteInterface::republishAllDevices() bool done = AddDeviceRemote(devices.at(i)); if(done) { LOG(Logger::LOG_DEBUG, "CCU2BidcosRemoteInterface::republishAllDevices(): Re-added device with address %d(dec)",devices.at(i)); + //Restore the channel authentication policy, as it is set after adding a device on startup + int aes_key; + uint64 aes_channels; + if(GetDeviceAesPolicy(devices.at(i), &aes_key, &aes_channels)) { + SetDeviceAesPolicy(devices.at(i), aes_key, aes_channels); + } } else { LOG(Logger::LOG_ERROR, "CCU2BidcosRemoteInterface::republishAllDevices(): Could not republish device with address %d(dec) to coprocessor.",devices.at(i));