keys: Keep keys in ssh/ subfolder
This commit is contained in:
parent
ce5adbe4ba
commit
c840050c78
|
@ -780,7 +780,10 @@ namespace SparkleShare {
|
|||
|
||||
private string [] CreateKeys ()
|
||||
{
|
||||
string keys_path = Path.GetDirectoryName (SparkleConfig.DefaultConfig.FullPath);
|
||||
// TODO: Make a proper member for this
|
||||
string config_path = Path.GetDirectoryName (SparkleConfig.DefaultConfig.FullPath);
|
||||
|
||||
string keys_path = Path.Combine (config_path, "ssh");
|
||||
string key_file_name = DateTime.Now.ToString ("yyyy-MM-dd_HH\\hmm");
|
||||
|
||||
return SparkleKeys.GenerateKeyPair (keys_path, key_file_name);
|
||||
|
|
|
@ -31,6 +31,9 @@ namespace SparkleShare {
|
|||
key_name += ".key";
|
||||
string key_file_path = Path.Combine (output_path, key_name);
|
||||
|
||||
if (!Directory.Exists (output_path))
|
||||
Directory.CreateDirectory (output_path);
|
||||
|
||||
if (File.Exists (key_file_path)) {
|
||||
SparkleLogger.LogInfo ("Auth", "A key pair exists ('" + key_name + "'), leaving it untouched");
|
||||
return new string [] { key_file_path, key_file_path + ".pub" };
|
||||
|
|
Loading…
Reference in a new issue