Bug 150644. Prevent removal of secrets when store is locked.

This commit is contained in:
Jim Norman 2006-02-14 21:04:17 +00:00
parent 7e9883fe5e
commit 433961874f
3 changed files with 27 additions and 11 deletions

View File

@ -1,3 +1,13 @@
-------------------------------------------------------------------
Tue Feb 14 14:01:20 MST 2006 - jnorman@novell.com
- Bug 150644. Prevent removal of secrets when store is locked.
-------------------------------------------------------------------
Tue Feb 14 13:45:20 MST 2006 - jnorman@novell.com
- Bug 150037. For windows, change build options to not require msvcr71.dll.
-------------------------------------------------------------------
Tue Feb 14 10:15:20 MST 2006 - smanojna@novell.com

View File

@ -53,6 +53,7 @@ namespace sscs.constants
internal static int SSCS_STORE_IS_NOT_PERSISTENT = -23;
internal static int SSCS_SECRET_IS_PERSISTENT = -24;
internal static int SSCS_SECRET_IS_NOT_PERSISTENT = -25;
internal static int SSCS_SECRET_STORE_IS_LOCKED = -26;
}

View File

@ -97,25 +97,30 @@ namespace sscs.verbs
try
{
SecretStore ssStore = SessionManager.GetUserSecretStore(userId);
if( ssStore.CheckIfKeyChainExists(keyChainId) )
if (!ssStore.IsStoreLocked())
{
KeyChain keyChain = ssStore.GetKeyChain(keyChainId);
if( keyChain.CheckIfSecretExists(secretId) == false)
if (ssStore.CheckIfKeyChainExists(keyChainId))
{
retCode = IPCRetCodes.SSCS_E_SECRETID_DOES_NOT_EXIST;
KeyChain keyChain = ssStore.GetKeyChain(keyChainId);
if (keyChain.CheckIfSecretExists(secretId) == false)
{
retCode = IPCRetCodes.SSCS_E_SECRETID_DOES_NOT_EXIST;
}
else
{
// TODO: get the secret and remove linked keys
keyChain.RemoveSecret(secretId);
ssStore.UpdatePersistentStore();
}
}
else
{
// TODO: get the secret and remove linked keys
keyChain.RemoveSecret(secretId);
ssStore.UpdatePersistentStore();
retCode = IPCRetCodes.SSCS_E_KEYCHAIN_DOES_NOT_EXIST;
}
}
else
{
retCode = IPCRetCodes.SSCS_E_KEYCHAIN_DOES_NOT_EXIST;
}
retCode = IPCRetCodes.SSCS_SECRET_STORE_IS_LOCKED;
}
catch(UserNotInSessionException)
{