Bug 143878. Handle more than 100 secrets in GUI.

This commit is contained in:
Jim Norman
2006-01-29 03:25:06 +00:00
parent 6055982262
commit 526c3d0706
4 changed files with 95 additions and 39 deletions

View File

@@ -23,6 +23,7 @@
using System;
using System.Collections;
using System.Collections.Specialized;
using System.Text;
using System.Threading;
using sscs.verbs;
@@ -210,6 +211,10 @@ namespace sscs.verbs
{
return DoResetMasterPassword(ssStore, wo);
}
case MiCasaRequestReply.VERB_GET_SECRETIDS:
{
return DoGetSecretIDs(ssStore, wo);
}
default:
{
@@ -227,6 +232,41 @@ namespace sscs.verbs
return wo;
}
private WrappedObject DoGetSecretIDs(SecretStore ssStore, WrappedObject wo)
{
if (!ssStore.IsStoreLocked())
{
// look up keychain
string sKeyChainID = wo.GetKeychainID();
if (sKeyChainID != null)
{
KeyChain kc = ssStore.GetKeyChain(sKeyChainID);
if (kc != null)
{
StringCollection sc = (StringCollection)wo.GetObject();
if (sc != null)
{
IDictionaryEnumerator etor = (IDictionaryEnumerator)kc.GetAllSecrets();
while(etor.MoveNext())
{
sc.Add((string)etor.Key);
}
}
}
else
{
wo.SetError(constants.RetCodes.FAILURE, "KeyChain not found");
}
}
}
else
{
wo.SetError(constants.RetCodes.FAILURE, "Store locked");
}
return wo;
}
private WrappedObject DoRemoveAllSecrets(SecretStore ssStore, WrappedObject wo)
{