Fix for Zen/Security issue, MasterPassword on Windows is optional by a setting in the Registry.

This commit is contained in:
Jim Norman 2008-03-31 22:08:18 +00:00
parent b83f659d48
commit 487efaec37
2 changed files with 15 additions and 8 deletions

View File

@ -898,7 +898,7 @@ namespace sscs.cache
mpWatcher.resumeWatcher();
}
internal Secret GetDesktopSecret()
internal Secret GetDesktopSecret(bool bCreateIfNeeded)
{
if (common.CSSSUtils.StoreDesktopPasswordInCache())
{
@ -914,11 +914,18 @@ namespace sscs.cache
return secret;
}
catch (SecretNotFoundException e)
{
CSSSLogger.DbgLog("Desktop password not found in cache, creating one");
secret = new Secret(ConstStrings.MICASA_DESKTOP_PASSWD);
keyChain.AddSecret(secret);
return secret;
{
if (bCreateIfNeeded)
{
CSSSLogger.DbgLog("Desktop password not found in cache, creating one");
secret = new Secret(ConstStrings.MICASA_DESKTOP_PASSWD);
keyChain.AddSecret(secret);
return secret;
}
else
{
return null;
}
}
catch (Exception e1)
{
@ -942,7 +949,7 @@ namespace sscs.cache
{
try
{
Secret secret = GetDesktopSecret();
Secret secret = GetDesktopSecret(false);
if (secret != null)
{
string passwd = secret.GetKeyValue(ConstStrings.MICASA_DESKTOP_PASSWD_KEYNAME).GetValue();

View File

@ -208,7 +208,7 @@ namespace sscs.verbs
if (ConstStrings.MICASA_DESKTOP_PASSWD == secretId)
{
secret = ssStore.GetDesktopSecret();
secret = ssStore.GetDesktopSecret(true);
}
else
{