Allow mfg commands in validation unsecure mode

Execute all the manufacturing commands in validation
unsecure mode, which will be available if validation-unsecure
feature is enabled.

Tested:
Depends on patch, which enables this flag
based on validation-unsecure
1. Verified that features is enabled with validation-unsecure
2. Verified mfg commands are executed in both mfg & validation
unsecure mode.

Change-Id: Id75086d9998b334d5d138ee8ebeade0fc305bc08
Signed-off-by: Richard Marian Thomaiyar <richard.marian.thomaiyar@linux.intel.com>
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 218c5c6..42af35a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -105,7 +105,13 @@
 
 install (TARGETS zinteloemcmds DESTINATION lib/ipmid-providers)
 option (INTEL_PFR_ENABLED "Intel PFR Enabled" OFF)
+option (BMC_VALIDATION_UNSECURE_FEATURE
+        "Enables unsecure features required by validation. Note: must
+        be turned off for production images."
+        OFF)
 target_compile_definitions (
     zinteloemcmds PRIVATE
     $<$<BOOL:${INTEL_PFR_ENABLED}>: -DINTEL_PFR_ENABLED>
+    $<$<BOOL:${BMC_VALIDATION_UNSECURE_FEATURE}>:
+    -DBMC_VALIDATION_UNSECURE_FEATURE>
 )
diff --git a/include/manufacturingcommands.hpp b/include/manufacturingcommands.hpp
index f68142e..9246de9 100644
--- a/include/manufacturingcommands.hpp
+++ b/include/manufacturingcommands.hpp
@@ -247,6 +247,14 @@
         {
             return true;
         }
+#ifdef BMC_VALIDATION_UNSECURE_FEATURE
+        if (std::get<std::string>(mode) ==
+            "xyz.openbmc_project.Control.Security.SpecialMode.Modes."
+            "ValidationUnsecure")
+        {
+            return true;
+        }
+#endif
         return false;
     }