fetcher git crypto: Send password to openssl command through stdin. Closes #1443
This commit is contained in:
parent
dd8c8a8fdf
commit
765fe05f81
|
@ -284,16 +284,18 @@ namespace SparkleLib.Git {
|
||||||
process.StartInfo.WorkingDirectory = TargetFolder;
|
process.StartInfo.WorkingDirectory = TargetFolder;
|
||||||
process.StartInfo.UseShellExecute = false;
|
process.StartInfo.UseShellExecute = false;
|
||||||
process.StartInfo.RedirectStandardOutput = true;
|
process.StartInfo.RedirectStandardOutput = true;
|
||||||
|
process.StartInfo.RedirectStandardInput = true;
|
||||||
process.StartInfo.CreateNoWindow = true;
|
process.StartInfo.CreateNoWindow = true;
|
||||||
|
|
||||||
process.StartInfo.FileName = "openssl";
|
process.StartInfo.FileName = "openssl";
|
||||||
process.StartInfo.Arguments = "enc -d -aes-256-cbc -base64 -S " + this.crypto_salt +
|
process.StartInfo.Arguments = "enc -d -aes-256-cbc -base64 -pass stdin" +
|
||||||
" -pass pass:\"" + password + "\" -in \"" + password_check_file_path + "\"";
|
"-in \"" + password_check_file_path + "\"";
|
||||||
|
|
||||||
SparkleLogger.LogInfo ("Cmd | " + System.IO.Path.GetFileName (process.StartInfo.WorkingDirectory),
|
SparkleLogger.LogInfo ("Cmd | " + System.IO.Path.GetFileName (process.StartInfo.WorkingDirectory),
|
||||||
System.IO.Path.GetFileName (process.StartInfo.FileName) + " " + process.StartInfo.Arguments);
|
System.IO.Path.GetFileName (process.StartInfo.FileName) + " " + process.StartInfo.Arguments);
|
||||||
|
|
||||||
process.Start ();
|
process.Start ();
|
||||||
|
process.StandardInput.WriteLine (password);
|
||||||
process.WaitForExit ();
|
process.WaitForExit ();
|
||||||
|
|
||||||
if (process.ExitCode == 0) {
|
if (process.ExitCode == 0) {
|
||||||
|
|
|
@ -515,8 +515,10 @@ namespace SparkleShare {
|
||||||
|
|
||||||
public void CheckCryptoPasswordPage (string password)
|
public void CheckCryptoPasswordPage (string password)
|
||||||
{
|
{
|
||||||
bool is_password_correct = Program.Controller.CheckPassword (password);
|
new Thread(() => {
|
||||||
UpdateCryptoPasswordContinueButtonEvent (is_password_correct);
|
bool is_password_correct = Program.Controller.CheckPassword (password);
|
||||||
|
UpdateCryptoPasswordContinueButtonEvent (is_password_correct);
|
||||||
|
}).Start ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue