diff --git a/CASA/micasad/cache/SecretStore.cs b/CASA/micasad/cache/SecretStore.cs index 65bcb96b..9176b353 100644 --- a/CASA/micasad/cache/SecretStore.cs +++ b/CASA/micasad/cache/SecretStore.cs @@ -181,6 +181,15 @@ namespace sscs.cache { CSSSLogger.DbgLog("StartPersistenceByDesktopPasswd - Called"); + UIPol uiPolicy = (UIPol)ICASAPol.GetPolicy(CASAPolType.UI_POL, GetUserHomeDirectory()); + string sShouldUseDesktop = uiPolicy.GetConfigSetting(ConstStrings.CONFIG_DECRYPT_USING_DESKTOP_PASS); + + if ((sShouldUseDesktop != null) && (sShouldUseDesktop.Equals("0"))) + { + CSSSLogger.DbgLog("Policy set: Did not start persistent by Desktop Password"); + return false; + } + // make sure we have a Persistence Directory if (GetPersistenceDirectory() == null || GetPersistenceDirectory().Length < 1) { @@ -797,7 +806,7 @@ namespace sscs.cache // the user might have set a different one // load the policy file and check. UIPol uiPolicy = (UIPol)ICASAPol.GetPolicy(CASAPolType.UI_POL, GetUserHomeDirectory()); - string sDir = uiPolicy.GetConfigSetting("PersistentDirectory"); + string sDir = uiPolicy.GetConfigSetting(ConstStrings.CONFIG_PERSISTENT_DIRECTORY); if ((sDir != null) && (sDir.Length > 0)) { m_persistenceDirectory = sDir; diff --git a/CASA/micasad/common/Constants.cs b/CASA/micasad/common/Constants.cs index b742fbf2..39ef0cc2 100644 --- a/CASA/micasad/common/Constants.cs +++ b/CASA/micasad/common/Constants.cs @@ -120,6 +120,11 @@ namespace sscs.constants internal static string MICASA_VALIDATION_STRING = "miCASAValidationString"; + // these are used in the GUI too. + internal static string CONFIG_PERSISTENT_DIRECTORY = "PersistentDirectory"; + internal static string CONFIG_PERSIST_SECRETS = "PersistSecrets"; + internal static string CONFIG_DECRYPT_USING_DESKTOP_PASS = "DecryptUsingDesktopPassword"; + } internal class ConstFlags