controller: block on GenerateKeyPair. eliminates race condition on first setup

This commit is contained in:
Hylke Bons 2011-05-11 06:48:27 -07:00
parent 23d7550ce8
commit 5f1fa163df

View file

@ -856,7 +856,6 @@ namespace SparkleShare {
// -P is the password (none) // -P is the password (none)
// -f is the file name to store the private key in // -f is the file name to store the private key in
process.StartInfo.Arguments = "-t rsa -P \"\" -f " + key_file_name; process.StartInfo.Arguments = "-t rsa -P \"\" -f " + key_file_name;
process.Start ();
process.Exited += delegate { process.Exited += delegate {
SparkleHelpers.DebugInfo ("Config", "Created private key '" + key_file_name + "'"); SparkleHelpers.DebugInfo ("Config", "Created private key '" + key_file_name + "'");
@ -867,6 +866,9 @@ namespace SparkleShare {
File.Copy (key_file_path + ".pub", File.Copy (key_file_path + ".pub",
Path.Combine (SparklePath, UserName + "'s key.txt")); Path.Combine (SparklePath, UserName + "'s key.txt"));
}; };
process.Start ();
process.WaitForExit ();
} }
} }