Skip to content

Commit ecf2d5e

Browse files
committed
Rebase
2 parents ff4e2a5 + 90b7ce4 commit ecf2d5e

24 files changed

Lines changed: 3481 additions & 2828 deletions

CHANGELOG.MD

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
- Improved certificate information display with better visual feedback
1818
- Added intuitive forms for managing timestamp server configurations
1919
- Context-aware UI labels that change based on signing type (Trusted Signing vs. traditional methods)
20+
- Added search functionality for certificates (Windows Certificate Store) for name, thumbprint and issuer in the list
2021

2122
### 🔒 Security Improvements
2223
- **Major Security Enhancement**: Completely redesigned password encryption system
@@ -54,6 +55,9 @@
5455
- Improved machine-specific key generation using multiple entropy sources
5556
- Added comprehensive error handling and logging for security operations
5657
- Backward compatibility maintained through automatic password migration system
58+
- Changed configuration file name to `Config.ini` for clarity (previously `Data.ini`)
59+
60+
Think I have it all now, but can be I forgot something - a lot of work went into this release, so please test it thoroughly and report any issues you find 😉
5761

5862
---
5963

src/SignToolGUI.sln

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
1616
EndProject
1717
Project("{840C416C-B8F3-42BC-B0DD-F6BB14C9F8CB}") = "SignToolGUI Installer", "AI Setup Project\SignToolGUI Installer.aiproj", "{EED69928-407C-4C65-89A8-56244E46764D}"
1818
EndProject
19-
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items (2)", "Solution Items (2)", "{17D2B0EB-13B6-4E9E-BEF2-4D99470588B4}"
20-
ProjectSection(SolutionItems) = preProject
21-
..\CHANGELOG.MD = ..\CHANGELOG.MD
22-
..\LICENSE.md = ..\LICENSE.md
23-
..\Notes.md = ..\Notes.md
24-
..\README.md = ..\README.md
25-
..\SECURITY.md = ..\SECURITY.md
26-
EndProjectSection
27-
EndProject
2819
Global
2920
GlobalSection(SolutionConfigurationPlatforms) = preSolution
3021
All|Any CPU = All|Any CPU

src/SignToolGUI/Class/CertificateMonitor.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ namespace SignToolGUI.Class
99
{
1010
public class CertificateMonitor
1111
{
12+
private readonly int _warningThresholdDays;
13+
private readonly int _criticalThresholdDays;
14+
1215
public enum AlertLevel
1316
{
1417
None,
@@ -24,10 +27,7 @@ public class CertificateAlert
2427
public int DaysUntilExpiry { get; set; }
2528
public string Message { get; set; }
2629
public string CertificateName { get; set; }
27-
}
28-
29-
private readonly int _warningThresholdDays;
30-
private readonly int _criticalThresholdDays;
30+
}
3131

3232
public CertificateMonitor(int warningThresholdDays = 90, int criticalThresholdDays = 30)
3333
{

src/SignToolGUI/Class/FileLogger.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ internal class FileLogger
2727
// Get logfile path
2828
public static string GetLogPath(string df)
2929
{
30-
return Files.LogFilePath + @"\" + Globals.ToolName.SignToolGui + " Log " + df + ".log";
30+
return FileManager.LogFilePath + @"\" + Globals.ToolName.SignToolGui + " Log " + df + ".log";
3131
}
3232

3333
// Get datetime
@@ -77,9 +77,9 @@ private static void AppendMessageToFile(string mess, EventType type, string dtf,
7777
// Check if file exists else create it
7878
try
7979
{
80-
if (!Directory.Exists(Files.LogFilePath))
80+
if (!Directory.Exists(FileManager.LogFilePath))
8181
{
82-
Directory.CreateDirectory(Files.LogFilePath);
82+
Directory.CreateDirectory(FileManager.LogFilePath);
8383
//Console.WriteLine("Directory to log files created: " + Files.LogFilePath);
8484
}
8585
}
@@ -97,7 +97,7 @@ private static void AppendMessageToFile(string mess, EventType type, string dtf,
9797
}
9898

9999
// Check if we have write access to the directory
100-
if (!HasWriteAccessToDirectory(Files.LogFilePath))
100+
if (!HasWriteAccessToDirectory(FileManager.LogFilePath))
101101
{
102102
if (WriteToEventLog)
103103
{
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22

33
namespace SignToolGUI.Class
44
{
5-
class Files
5+
class FileManager
66
{
77
public static string ConfigIniPath
88
{
99
get
1010
{
1111
// Path to the configuration file
12-
var configIniPathvar = ProgramDataFilePath + @"\Data.ini";
12+
var configIniPathvar = ProgramDataFilePath + @"\Config.ini";
1313
return configIniPathvar;
1414
}
1515
}

src/SignToolGUI/Class/Globals.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ internal class ToolStates
3232
internal static string MichaelCodeSignThumbprintOffline = "D6A630B8F65C473C19F8B694491130073FCCDB32";
3333
}
3434

35+
internal class ToolStings
36+
{
37+
internal static string URLAzurePortalTrustedSigning = @"https://portal.azure.com/#browse/Microsoft.CodeSigning%2Fcodesigningaccounts";
38+
}
39+
40+
3541
internal static async Task<string> FetchCurrentCertificateThumbprintAsync()
3642
{
3743
const string url = "https://raw.githubusercontent.com/michaelmsonne/michaelmsonne/main/Trusted_Publisher_Certificate/CurrentCertificateThumbprint.txt";

src/SignToolGUI/Class/SecurePasswordManager.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
using System;
22
using System.IO;
3-
using System.Linq;
43
using System.Security.Cryptography;
54
using System.Text;
65
using static SignToolGUI.Class.FileLogger;
@@ -80,6 +79,7 @@ private static string GenerateMachineSpecificKey()
8079
/// <returns>Base64 encoded encrypted password with metadata</returns>
8180
public static string EncryptPassword(string plainText)
8281
{
82+
// Check for null or empty input
8383
if (string.IsNullOrEmpty(plainText))
8484
return string.Empty;
8585

src/SignToolGUI/Class/SignerBase.cs

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
using System;
22
using System.Diagnostics;
33
using System.IO;
4-
using System.Threading;
54
using System.Threading.Tasks;
65
using static SignToolGUI.Class.FileLogger;
76

@@ -212,5 +211,23 @@ protected string GlobalOptionSwitches()
212211
return Debug ? "/debug" : string.Empty;
213212
}
214213
}
214+
215+
public static bool VerifySignature(string signToolExe, string filePath)
216+
{
217+
var psi = new ProcessStartInfo
218+
{
219+
FileName = signToolExe,
220+
Arguments = $"verify /pa \"{filePath}\"",
221+
RedirectStandardOutput = true,
222+
UseShellExecute = false,
223+
CreateNoWindow = true
224+
};
225+
using (var process = System.Diagnostics.Process.Start(psi))
226+
{
227+
string output = process.StandardOutput.ReadToEnd();
228+
process.WaitForExit();
229+
return output.IndexOf("Successfully verified", StringComparison.OrdinalIgnoreCase) >= 0;
230+
}
231+
}
215232
}
216233
}

0 commit comments

Comments
 (0)