return locked on EnumerateSecretIds when the store is locked.
This commit is contained in:
		| @@ -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) | ||||
|             { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user