Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions SparkleShare/Common/BaseController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,7 @@ public virtual void Initialize ()
Logger.LogInfo ("Environment", "SparkleShare " + version);
Logger.LogInfo ("Environment", "Git LFS " + Sparkles.Git.GitCommand.GitLFSVersion);
Logger.LogInfo ("Environment", "Git " + Sparkles.Git.GitCommand.GitVersion);
Logger.LogInfo ("Environment", Sparkles.OpenSSLCommand.OpenSSLVersion);
Logger.LogInfo ("Environment", InstallationInfo.OperatingSystem + " " + InstallationInfo.OperatingSystemVersion);

UserAuthenticationInfo = new SSHAuthenticationInfo ();
Expand Down
6 changes: 3 additions & 3 deletions Sparkles/Git/Git.Fetcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -244,10 +244,10 @@ public override void EnableFetchedRepoCrypto (string password)
var git_config_required = new GitCommand (TargetFolder, "config filter.encryption.required true");

var git_config_smudge = new GitCommand (TargetFolder, "config filter.encryption.smudge " +
string.Format ("\"openssl enc -d -aes-256-cbc -base64 -S {0} -pass file:{1} -md sha256\"", password_salt, password_file));
string.Format ("\"'{0}' enc -d -aes-256-cbc -base64 -S {1} -pass file:{2} -md sha256\"", OpenSSLCommand.OpenSSLCommandPath, password_salt, password_file));

var git_config_clean = new GitCommand (TargetFolder, "config filter.encryption.clean " +
string.Format ("\"openssl enc -e -aes-256-cbc -base64 -S {0} -pass file:{1} -md sha256\"", password_salt, password_file));
string.Format ("\"'{0}' enc -e -aes-256-cbc -base64 -S {1} -pass file:{2} -md sha256\"", OpenSSLCommand.OpenSSLCommandPath, password_salt, password_file));

git_config_required.StartAndWaitForExit ();
git_config_smudge.StartAndWaitForExit ();
Expand Down Expand Up @@ -279,7 +279,7 @@ public override bool IsFetchedRepoPasswordCorrect (string password)
string args = string.Format ("enc -d -aes-256-cbc -base64 -S {0} -pass pass:{1} -in \"{2}\" -md sha256",
password_salt, password.SHA256 (password_salt), password_check_file_path);

var process = new Command ("openssl", args);
var process = new OpenSSLCommand (args);

process.StartInfo.WorkingDirectory = TargetFolder;
process.StartAndWaitForExit ();
Expand Down
57 changes: 57 additions & 0 deletions Sparkles/OpenSSLCommand.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
// SparkleShare, a collaboration and sharing tool.
// Copyright (C) 2010 Hylke Bons <hi@planetpeanut.uk>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.


using System.IO;

namespace Sparkles
{
public class OpenSSLCommand : Command
{
public static string OpenSSLBinary = "openssl";
public static string OpenSSLPath = Path.GetDirectoryName(LocateCommand(OpenSSLBinary)).Replace("\\", "/");

public static string OpenSSLCommandPath
{
get
{
return LocateCommand(OpenSSLBinary).Replace("\\", "/");
}
}


public OpenSSLCommand(string command, string args) :
base(Path.Combine(OpenSSLPath, command), args)
{
}
public OpenSSLCommand(string args) : base(OpenSSLCommandPath, args)
{
}
public static string OpenSSLVersion
{
get {
var openssl_version = new Command (OpenSSLCommandPath, "version", false);

string [] version = openssl_version.StartAndReadStandardOutput ().Split (' ');
string version_string = version [0];
if (version.Length >= 2) {
version_string= version [0] + " " + version [1];
}
return version_string;
}
}
}
}
3 changes: 3 additions & 0 deletions Sparkles/Sparkles.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@
<Compile Include="Command.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="OpenSSLCommand.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="SSHCommand.cs">
<SubType>Component</SubType>
</Compile>
Expand Down
3 changes: 2 additions & 1 deletion Sparkles/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ sparkles_src = ['AuthenticationInfo.cs',
'SSHFetcher.cs',
'TcpListener.cs',
'User.cs',
'Watcher.cs']
'Watcher.cs',
'OpenSSLCommand.cs']


sparkles = library('Sparkles',
Expand Down