Bug 143878. Handle more than 100 secrets in GUI.
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user