Security Audit - Marshal export file to CASAManager for saving.

This commit is contained in:
Jim Norman
2006-12-20 10:22:27 +00:00
parent 98c12387a6
commit 43009ada4f
4 changed files with 198 additions and 207 deletions

View File

@@ -107,8 +107,7 @@ namespace Novell.CASA.GUI
}
#endif
//Store off this location for next export
//Store off this location for next export
int iLastSlash = sFileName.LastIndexOf("/");
if (Common.IS_WINDOWS)
iLastSlash = sFileName.LastIndexOf("\\");
@@ -125,25 +124,28 @@ namespace Novell.CASA.GUI
m_config.WriteConfig();
// call our daemon to get the users secrets
ExportXMLSecrets exportSecrets = new ExportXMLSecrets(sMasterPWD, sEncryptString, sFileName);
object obj = Novell.CASA.MiCasa.Communication.MiCasaRequestReply.Send(MiCasaRequestReply.VERB_EXPORT_SECRETS, null, null, null, exportSecrets);
/*
byte[] theSecrets = (byte[])Novell.CASA.MiCasa.Communication.MiCasaRequestReply.Send(MiCasaRequestReply.VERB_EXPORT_SECRETS, null, null, null, exportSecrets);
// write em out.
FileStream fs = new FileStream(sFileName, FileMode.Create);
fs.Write(theSecrets, 0, theSecrets.Length);
fs.Flush();
fs.Close();
*/
CommonGUI.DisplayMessage(MessageType.Info, "Secrets saved to: \r\n" + sFileName);
ExportXMLSecrets exportSecrets = new ExportXMLSecrets(sMasterPWD, sEncryptString, null);
byte[] baSecrets = (byte[])Novell.CASA.MiCasa.Communication.MiCasaRequestReply.Send(MiCasaRequestReply.VERB_EXPORT_SECRETS, null, null, null, exportSecrets);
if (baSecrets != null)
{
try
{
FileStream fs = new FileStream(sFileName, FileMode.Create);
fs.Write(baSecrets, 0, baSecrets.Length);
fs.Flush();
fs.Close();
CommonGUI.DisplayMessage(MessageType.Info, "Secrets saved to: \r\n" + sFileName);
}
catch
{
CommonGUI.DisplayMessage(MessageType.Error, "Failed to save secrets");
}
}
else
{
CommonGUI.DisplayMessage(MessageType.Error, "No Secrets found");
}
}
}
else