Code needed for Change Master Password
This commit is contained in:
@@ -183,6 +183,11 @@ namespace sscs.verbs
|
||||
{
|
||||
return DoGetKeyList(ssStore, wo);
|
||||
}
|
||||
case MiCasaRequestReply.VERB_RESET_MASTER_PASSWORD:
|
||||
{
|
||||
return DoResetMasterPassword(ssStore, wo);
|
||||
}
|
||||
|
||||
default:
|
||||
{
|
||||
wo.SetError(constants.RetCodes.FAILURE, "Verb Not Supported");
|
||||
@@ -654,6 +659,39 @@ namespace sscs.verbs
|
||||
return wo;
|
||||
}
|
||||
|
||||
|
||||
private WrappedObject DoResetMasterPassword(SecretStore ssStore, WrappedObject wo)
|
||||
{
|
||||
ResetMasterPassword rmp = (ResetMasterPassword)wo.GetObject();
|
||||
// verify current master password
|
||||
try
|
||||
{
|
||||
string sMasterPassword = rmp.m_currentPassword;
|
||||
ssStore.UnlockStore(null, sMasterPassword);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
wo.SetError(constants.RetCodes.FAILURE, e.ToString());
|
||||
return wo;
|
||||
}
|
||||
|
||||
// change master master password
|
||||
string sNewPassword = rmp.m_newPassword;
|
||||
if (sNewPassword == null || sNewPassword.Length < 8)
|
||||
{
|
||||
wo.SetError(constants.RetCodes.FAILURE, null);
|
||||
return wo;
|
||||
}
|
||||
|
||||
if (!ssStore.ChangeMasterPassword(rmp.m_currentPassword, rmp.m_newPassword))
|
||||
wo.SetError(constants.RetCodes.FAILURE, null);
|
||||
else
|
||||
wo.SetError(constants.RetCodes.SUCCESS, null);
|
||||
|
||||
|
||||
return wo;
|
||||
}
|
||||
|
||||
private WrappedObject DoPing(WrappedObject wo)
|
||||
{
|
||||
//Console.WriteLine("MICASAD received Ping from Client");
|
||||
|
||||
Reference in New Issue
Block a user