Fix: RestrictionMode property change handler

RestrictionMode PropertiesChanged signal handler is fixed to
read the property list correctly, and use the same. Bug was
causing ipmid to crash when RestrictionMode property was
updated

Tested:
Verfied that ipmid didn't crash and updates the filed, when
RestrictionMode property is updated.

Change-Id: I33ff977b2d06d96a9591a9d650a8b76b3119b1fe
Signed-off-by: Richard Marian Thomaiyar <richard.marian.thomaiyar@linux.intel.com>
diff --git a/whitelist-filter.cpp b/whitelist-filter.cpp
index a24ccad..9f1e7c8 100644
--- a/whitelist-filter.cpp
+++ b/whitelist-filter.cpp
@@ -105,13 +105,23 @@
 void WhitelistFilter::handleRestrictedModeChange(sdbusplus::message::message& m)
 {
     using namespace sdbusplus::xyz::openbmc_project::Control::Security::server;
-    std::string mode;
-    m.read(mode);
-    RestrictionMode::Modes restrictionMode =
-        RestrictionMode::convertModesFromString(mode);
-    restrictedMode = (restrictionMode == RestrictionMode::Modes::Whitelist);
-    log<level::INFO>((restrictedMode ? "Updated restrictedMode = true"
-                                     : "Updated restrictedMode = false"));
+    std::string intf;
+    std::vector<std::pair<std::string, ipmi::Value>> propertyList;
+    m.read(intf, propertyList);
+    for (const auto& property : propertyList)
+    {
+        if (property.first == "RestrictionMode")
+        {
+            RestrictionMode::Modes restrictionMode =
+                RestrictionMode::convertModesFromString(
+                    std::get<std::string>(property.second));
+            restrictedMode =
+                (restrictionMode == RestrictionMode::Modes::Whitelist);
+            log<level::INFO>((restrictedMode
+                                  ? "Updated restrictedMode = true"
+                                  : "Updated restrictedMode = false"));
+        }
+    }
 }
 
 void WhitelistFilter::postInit()