diff --git a/CASA/micasad/verbs/EnumerateSecretIds.cs b/CASA/micasad/verbs/EnumerateSecretIds.cs index e8989a88..523172fc 100644 --- a/CASA/micasad/verbs/EnumerateSecretIds.cs +++ b/CASA/micasad/verbs/EnumerateSecretIds.cs @@ -83,34 +83,41 @@ namespace sscs.verbs byte[] keyChainIdArr = new byte[keyChainIdLen]; Array.Copy(inBuf,10,keyChainIdArr,0,keyChainIdLen); - keyChainId = Encoding.UTF8.GetString(keyChainIdArr); + keyChainId = Encoding.UTF8.GetString(keyChainIdArr); // Message Format decipher - End try { SecretStore ssStore = SessionManager.GetUserSecretStore(userId); - if( ssStore.CheckIfKeyChainExists(keyChainId) ) - { - KeyChain keyChain = ssStore.GetKeyChain(keyChainId); - int numSecrets = keyChain.GetNumSecrets(); - int index = 0; - IDictionaryEnumerator etor = (IDictionaryEnumerator)keyChain.GetAllSecrets(); - while(etor.MoveNext()) - { - index++; - secretIds.Append((string)etor.Key,0,(((string)(etor.Key)).Length)-1); - secretIdsLen += ((string)(etor.Key)).Length-1; - if( index != numSecrets ) - { - secretIds.Append("*"); - secretIdsLen += 1; - } - } - } - else - { - retCode = IPCRetCodes.SSCS_E_KEYCHAIN_DOES_NOT_EXIST; - } + if (!ssStore.IsStoreLocked()) + { + if( ssStore.CheckIfKeyChainExists(keyChainId) ) + { + KeyChain keyChain = ssStore.GetKeyChain(keyChainId); + int numSecrets = keyChain.GetNumSecrets(); + int index = 0; + IDictionaryEnumerator etor = (IDictionaryEnumerator)keyChain.GetAllSecrets(); + while(etor.MoveNext()) + { + index++; + secretIds.Append((string)etor.Key,0,(((string)(etor.Key)).Length)-1); + secretIdsLen += ((string)(etor.Key)).Length-1; + if( index != numSecrets ) + { + secretIds.Append("*"); + secretIdsLen += 1; + } + } + } + else + { + retCode = IPCRetCodes.SSCS_E_KEYCHAIN_DOES_NOT_EXIST; + } + } + else + { + retCode = IPCRetCodes.SSCS_SECRET_STORE_IS_LOCKED; + } } catch(UserNotInSessionException) {