From 765fe05f815e9fcbeca71b06770ec3e0c4860493 Mon Sep 17 00:00:00 2001 From: Hylke Bons Date: Fri, 6 Dec 2013 23:38:12 +0000 Subject: [PATCH] fetcher git crypto: Send password to openssl command through stdin. Closes #1443 --- SparkleLib/Git/SparkleFetcherGit.cs | 6 ++++-- SparkleShare/SparkleSetupController.cs | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/SparkleLib/Git/SparkleFetcherGit.cs b/SparkleLib/Git/SparkleFetcherGit.cs index b7c1440d..f5f13b41 100755 --- a/SparkleLib/Git/SparkleFetcherGit.cs +++ b/SparkleLib/Git/SparkleFetcherGit.cs @@ -284,16 +284,18 @@ namespace SparkleLib.Git { process.StartInfo.WorkingDirectory = TargetFolder; process.StartInfo.UseShellExecute = false; process.StartInfo.RedirectStandardOutput = true; + process.StartInfo.RedirectStandardInput = true; process.StartInfo.CreateNoWindow = true; process.StartInfo.FileName = "openssl"; - process.StartInfo.Arguments = "enc -d -aes-256-cbc -base64 -S " + this.crypto_salt + - " -pass pass:\"" + password + "\" -in \"" + password_check_file_path + "\""; + process.StartInfo.Arguments = "enc -d -aes-256-cbc -base64 -pass stdin" + + "-in \"" + password_check_file_path + "\""; SparkleLogger.LogInfo ("Cmd | " + System.IO.Path.GetFileName (process.StartInfo.WorkingDirectory), System.IO.Path.GetFileName (process.StartInfo.FileName) + " " + process.StartInfo.Arguments); process.Start (); + process.StandardInput.WriteLine (password); process.WaitForExit (); if (process.ExitCode == 0) { diff --git a/SparkleShare/SparkleSetupController.cs b/SparkleShare/SparkleSetupController.cs index ec282c9c..2b4cb734 100755 --- a/SparkleShare/SparkleSetupController.cs +++ b/SparkleShare/SparkleSetupController.cs @@ -515,8 +515,10 @@ namespace SparkleShare { public void CheckCryptoPasswordPage (string password) { - bool is_password_correct = Program.Controller.CheckPassword (password); - UpdateCryptoPasswordContinueButtonEvent (is_password_correct); + new Thread(() => { + bool is_password_correct = Program.Controller.CheckPassword (password); + UpdateCryptoPasswordContinueButtonEvent (is_password_correct); + }).Start (); }