Commit ZEN/security issue changes
This commit is contained in:
parent
c17c298d72
commit
91d35ccb7c
25
CASA/micasad/cache/SecretStore.cs
vendored
25
CASA/micasad/cache/SecretStore.cs
vendored
@ -68,7 +68,9 @@ namespace sscs.cache
|
||||
|
||||
string m_persistenceDirectory = null;
|
||||
private static string POLICY_DIRECTORY = "/home/.casa";
|
||||
private MPFileWatcher mpWatcher = null;
|
||||
private MPFileWatcher mpWatcher = null;
|
||||
|
||||
private Secret m_DesktopSecret = new Secret(ConstStrings.MICASA_DESKTOP_PASSWD);
|
||||
|
||||
private DateTime createTime;
|
||||
public DateTime CreateTime
|
||||
@ -883,10 +885,27 @@ namespace sscs.cache
|
||||
{
|
||||
if (mpWatcher != null)
|
||||
mpWatcher.resumeWatcher();
|
||||
}
|
||||
|
||||
internal Secret GetDesktopSecret()
|
||||
{
|
||||
return m_DesktopSecret;
|
||||
}
|
||||
|
||||
internal string GetDesktopPasswd()
|
||||
{
|
||||
{
|
||||
|
||||
try
|
||||
{
|
||||
Secret secret = GetDesktopSecret();
|
||||
string passwd = secret.GetKeyValue(ConstStrings.MICASA_DESKTOP_PASSWD_KEYNAME).GetValue();
|
||||
return passwd;
|
||||
}
|
||||
catch
|
||||
{
|
||||
CSSSLogger.DbgLog("Desktop password not set in Session");
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
string keyChainId = ConstStrings.SSCS_SESSION_KEY_CHAIN_ID + "\0";
|
||||
@ -899,7 +918,9 @@ namespace sscs.cache
|
||||
{
|
||||
CSSSLogger.DbgLog("Desktop password not set");
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
}
|
||||
|
||||
internal string GetUserHomeDirectory()
|
||||
|
@ -33,7 +33,17 @@ using sscs.constants;
|
||||
namespace sscs.common
|
||||
{
|
||||
class CSSSUtils
|
||||
{
|
||||
{
|
||||
|
||||
public static bool AllowDesktopPasswordAccess()
|
||||
{
|
||||
#if LINUX
|
||||
return true;
|
||||
#else
|
||||
return true;
|
||||
#endif
|
||||
}
|
||||
|
||||
public static bool IsFileOwnedByRoot(string filePath)
|
||||
{
|
||||
#if LINUX
|
||||
|
@ -44,7 +44,7 @@ namespace sscs.init
|
||||
string sCredMgrPath = GetCredMgrPath();
|
||||
if (sCredMgrPath != null)
|
||||
{
|
||||
RunProcess(sExePath, "/i /n /s " + "\"" + sCredMgrPath + "\"");
|
||||
RunProcess(sExePath, "/i:thecommandline /n /s " + "\"" + sCredMgrPath + "\"");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -96,8 +96,7 @@ namespace sscs.init
|
||||
}
|
||||
|
||||
foreach (string arg in args)
|
||||
{
|
||||
System.Diagnostics.Trace.WriteLine("arg: " + arg);
|
||||
{
|
||||
System.Diagnostics.Debug.WriteLine("arg: " + arg);
|
||||
}
|
||||
|
||||
|
@ -77,8 +77,8 @@ namespace sscs.verbs
|
||||
// get the store for the src
|
||||
try
|
||||
{
|
||||
WinUserIdentifier srcUser = new WinUserIdentifier(luidLow, luidHigh);
|
||||
SecretStore srcStore = SessionManager.GetUserSecretStore(srcUser);
|
||||
//WinUserIdentifier srcUser = new WinUserIdentifier(luidLow, luidHigh);
|
||||
SecretStore srcStore = SessionManager.GetUserSecretStore(userId);
|
||||
KeyChain kcSrc = null;
|
||||
KeyChain kcDest = null;
|
||||
|
||||
@ -103,8 +103,8 @@ namespace sscs.verbs
|
||||
}
|
||||
|
||||
if (iDestroySrcCache > 0)
|
||||
{
|
||||
SessionManager.RemoveUserSession(srcUser, true);
|
||||
{
|
||||
srcStore.RemoveKeyChain(luidHigh.ToString() + luidLow.ToString());
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -204,19 +204,41 @@ namespace sscs.verbs
|
||||
if( ssStore.CheckIfKeyChainExists(keyChainId) )
|
||||
{
|
||||
keyChain = ssStore.GetKeyChain(keyChainId);
|
||||
Secret secret = null;
|
||||
Secret secret = null;
|
||||
|
||||
|
||||
if (ConstStrings.MICASA_DESKTOP_PASSWD == secretId)
|
||||
{
|
||||
secret = ssStore.GetDesktopSecret();
|
||||
|
||||
if (common.CSSSUtils.AllowDesktopPasswordAccess())
|
||||
{
|
||||
if (keyChain.CheckIfSecretExists(secretId) == false)
|
||||
{
|
||||
keyChain.AddSecret(secret);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// NOTE: This removes secret is session too...
|
||||
//keyChain.RemoveSecret(secretId);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// add this secret if it doesn't already exist
|
||||
if (keyChain.CheckIfSecretExists(secretId) == false)
|
||||
{
|
||||
secret = new Secret(secretId);
|
||||
keyChain.AddSecret(secret);
|
||||
}
|
||||
else
|
||||
{
|
||||
secret = keyChain.GetSecret(secretId);
|
||||
}
|
||||
}
|
||||
|
||||
// add this secret if it doesn't already exist
|
||||
if( keyChain.CheckIfSecretExists(secretId) == false)
|
||||
{
|
||||
secret = new Secret(secretId);
|
||||
keyChain.AddSecret(secret);
|
||||
}
|
||||
else
|
||||
{
|
||||
secret = keyChain.GetSecret(secretId);
|
||||
}
|
||||
string oldPasswd = null;
|
||||
string oldPasswd = null;
|
||||
if((ConstStrings.MICASA_DESKTOP_PASSWD == secretId) &&
|
||||
(ConstStrings.MICASA_DESKTOP_PASSWD_KEYNAME == key)
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user