Skip to content

Commit 06f048e

Browse files
Fixed #1. Fixed #2. Allow signing using SHA1 thumbprint instead of file path and add .vbs + .ps1 file extensions to list of allowed file extensions of drag 'n' drop field. Release 1.1.0
1 parent 5b269a8 commit 06f048e

File tree

4 files changed

+49
-21
lines changed

4 files changed

+49
-21
lines changed

src/constants.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ struct Constants
3535
};
3636

3737
static inline const char* appName = "SigntoolGUI";
38-
static inline const char* appVersion = "1.0.0";
39-
static inline const char* orgName = "Glitched Polygons";
38+
static inline const char* appVersion = "1.1.0";
39+
static inline const char* orgName = "Glitched Polygons GmbH";
4040
static inline const char* orgDomain = "glitchedpolygons.com";
4141

4242
};

src/mainwindow.cpp

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,9 @@ void MainWindow::on_pushButtonSign_clicked()
209209
return;
210210
}
211211

212-
if (!QFile::exists(pfxFilePath)) [[unlikely]]
212+
const bool useSHA1 = !QFile::exists(pfxFilePath) && pfxFilePath.length() == 40;
213+
214+
if (!QFile::exists(pfxFilePath) && !useSHA1) [[unlikely]]
213215
{
214216
ui->textEditSignOutput->setText("The specified .pfx/.p12 file does not exist or access to it failed.");
215217
busy = false;
@@ -226,15 +228,28 @@ void MainWindow::on_pushButtonSign_clicked()
226228
ui->textEditSignOutput->setText("Signing above specified files...");
227229
repaint();
228230

229-
QString cmdBase = QString("signtool.exe sign /fd \"%1\" /td \"%2\" /tr \"%3\" /f \"%4\" /p \"%5\" ")
230-
.arg
231-
(
232-
hashAlgoStringFromId(ui->buttonGroupHashAlgo->checkedId()),
233-
hashAlgoStringFromId(ui->buttonGroupTimestampHashAlgo->checkedId()),
234-
timestampServer,
235-
pfxFilePath,
236-
ui->lineEditPfxFilePassword->text()
237-
);
231+
QString cmdBase =
232+
233+
useSHA1
234+
?
235+
QString("signtool.exe sign /sha1 \"%1\" /tr \"%2\" /td \"%3\" /fd \"%4\" ")
236+
.arg
237+
(
238+
pfxFilePath,
239+
timestampServer,
240+
hashAlgoStringFromId(ui->buttonGroupTimestampHashAlgo->checkedId()),
241+
hashAlgoStringFromId(ui->buttonGroupHashAlgo->checkedId())
242+
)
243+
:
244+
QString("signtool.exe sign /fd \"%1\" /td \"%2\" /tr \"%3\" /f \"%4\" /p \"%5\" ")
245+
.arg
246+
(
247+
hashAlgoStringFromId(ui->buttonGroupHashAlgo->checkedId()),
248+
hashAlgoStringFromId(ui->buttonGroupTimestampHashAlgo->checkedId()),
249+
timestampServer,
250+
pfxFilePath,
251+
ui->lineEditPfxFilePassword->text()
252+
);
238253

239254
QString output;
240255
output.reserve(1024);

src/mainwindow.ui

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
<item>
3737
<widget class="QLabel" name="labelBrowsePfxFile">
3838
<property name="text">
39-
<string>PFX/P12 File</string>
39+
<string>PFX/P12 File or SHA1 Thumbprint</string>
4040
</property>
4141
</widget>
4242
</item>
@@ -51,7 +51,7 @@
5151
<bool>false</bool>
5252
</property>
5353
<property name="placeholderText">
54-
<string>Please select the file to use for signing</string>
54+
<string>Please select the code signing certificate to use for signing</string>
5555
</property>
5656
<property name="clearButtonEnabled">
5757
<bool>true</bool>
@@ -122,7 +122,7 @@
122122
<item>
123123
<widget class="QLabel" name="labelFilesToSign">
124124
<property name="text">
125-
<string>Files to sign (*.exe, *.msi, *.dll, *.cab, *.cat, *.appx)</string>
125+
<string>Files to sign (*.exe, *.msi, *.dll, *.cab, *.cat, *.appx, *.vbs, *.ps1)</string>
126126
</property>
127127
</widget>
128128
</item>
@@ -210,7 +210,7 @@
210210
<item>
211211
<widget class="QLabel" name="labelFilesToVerify">
212212
<property name="text">
213-
<string>Files to verify (*.exe, *.msi, *.dll, *.cab, *.cat, *.appx)</string>
213+
<string>Files to verify (*.exe, *.msi, *.dll, *.cab, *.cat, *.appx, *.vbs, *.ps1)</string>
214214
</property>
215215
</widget>
216216
</item>
@@ -604,18 +604,23 @@
604604
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
605605
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;meta charset=&quot;utf-8&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
606606
p, li { white-space: pre-wrap; }
607+
hr { height: 1px; border-width: 0; }
608+
li.unchecked::marker { content: &quot;\2610&quot;; }
609+
li.checked::marker { content: &quot;\2612&quot;; }
607610
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Segoe UI'; font-size:9pt; font-weight:400; font-style:normal;&quot;&gt;
608611
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-weight:700;&quot;&gt;Signtool GUI&lt;/span&gt; is an easy, minimal and user friendly graphical user interface around the Windows SDK CLI &amp;quot;&lt;span style=&quot; font-family:'Courier New'; font-weight:700;&quot;&gt;signtool.exe&lt;/span&gt;&amp;quot;. It provides a straightforward visualization of it, nothing more.&lt;/p&gt;
609612
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
610613
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;It's very handy for signing your binaries without using a command line interface.&lt;/p&gt;
611614
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
612615
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Select your code signing certificate (a &lt;span style=&quot; font-family:'Courier New';&quot;&gt;.pfx&lt;/span&gt; or &lt;span style=&quot; font-family:'Courier New';&quot;&gt;.p12&lt;/span&gt; file), enter its password, drag &amp;amp; drop the binaries you wish to sign into the list field and hit &amp;quot;Sign all&amp;quot;. Done! No big deal.&lt;/p&gt;
613616
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
617+
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Using a YubiKey/Physical SmartCard for code signing? No problem! Just enter your code signing certificate's SHA1 thumbprint into the file path field.&lt;/p&gt;
618+
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
614619
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;This GUI's source code is &lt;a href=&quot;https://github.com/GlitchedPolygons/Argon2GUI/blob/main/LICENSE&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#007af4;&quot;&gt;GPL-3.0&lt;/span&gt;&lt;/a&gt; licensed and available on &lt;a href=&quot;https://github.com/GlitchedPolygons/SigntoolGUI&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#007af4;&quot;&gt;github.com/GlitchedPolygons/SigntoolGUI&lt;/span&gt;&lt;/a&gt; - but also available for purchase on &lt;a href=&quot;https://glitchedpolygons.com&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#007af4;&quot;&gt;glitchedpolygons.com&lt;/span&gt;&lt;/a&gt; (ships with some cool, additional stuff, PDF files/manual, etc...). &lt;/p&gt;
615620
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
616621
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Please consider buying it from there to support the development of nifty tools like this :)&lt;/p&gt;
617622
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
618-
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Copyright (C) 2022&lt;br /&gt;Raphael Beck | &lt;a href=&quot;https://glitchedpolygons.com&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#007af4;&quot;&gt;Glitched Polygons&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
623+
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Copyright (C) 2022-2024&lt;br /&gt;Raphael Beck | &lt;a href=&quot;https://glitchedpolygons.com&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#007af4;&quot;&gt;Glitched Polygons GmbH&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
619624
</property>
620625
<property name="openExternalLinks">
621626
<bool>true</bool>
@@ -639,12 +644,18 @@ p, li { white-space: pre-wrap; }
639644
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
640645
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;meta charset=&quot;utf-8&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
641646
p, li { white-space: pre-wrap; }
647+
hr { height: 1px; border-width: 0; }
648+
li.unchecked::marker { content: &quot;\2610&quot;; }
649+
li.checked::marker { content: &quot;\2612&quot;; }
642650
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Segoe UI'; font-size:9pt; font-weight:400; font-style:normal;&quot;&gt;
643651
&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-weight:700;&quot;&gt;Signtool GUI - Legal Notice&lt;/span&gt;&lt;/p&gt;
644652
&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;This project makes use of the following components, which are, at the time of writing, open-source and freely available under their respective licenses:&lt;/p&gt;
645-
&lt;ul style=&quot;margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;&quot;&gt;&lt;li style=&quot; margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;a href=&quot;https://www.qt.io&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#007af4;&quot;&gt;Qt&lt;/span&gt;&lt;/a&gt;
646-
&lt;ul style=&quot;margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 2;&quot;&gt;&lt;li style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;License: LGPL-3.0&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;
647-
&lt;ul style=&quot;margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 2;&quot;&gt;&lt;li style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Copyright: The Qt Company&lt;/li&gt;&lt;/ul&gt;
653+
&lt;ul style=&quot;margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;&quot;&gt;
654+
&lt;li style=&quot; margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;a href=&quot;https://www.qt.io&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#007af4;&quot;&gt;Qt&lt;/span&gt;&lt;/a&gt;
655+
&lt;ul style=&quot;margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 2;&quot;&gt;
656+
&lt;li style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;License: LGPL-3.0&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;
657+
&lt;ul style=&quot;margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 2;&quot;&gt;
658+
&lt;li style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Copyright: The Qt Company&lt;/li&gt;&lt;/ul&gt;
648659
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
649660
&lt;hr /&gt;
650661
&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;License texts:&lt;/p&gt;
@@ -835,7 +846,7 @@ p, li { white-space: pre-wrap; }
835846
<x>0</x>
836847
<y>0</y>
837848
<width>420</width>
838-
<height>21</height>
849+
<height>17</height>
839850
</rect>
840851
</property>
841852
</widget>

src/qfileslistdraganddrop.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ static const inline bool isValidFileExtension(const QUrl& url)
2727
|| url.toLocalFile().endsWith(".dll", Qt::CaseInsensitive)
2828
|| url.toLocalFile().endsWith(".cab", Qt::CaseInsensitive)
2929
|| url.toLocalFile().endsWith(".cat", Qt::CaseInsensitive)
30+
|| url.toLocalFile().endsWith(".vbs", Qt::CaseInsensitive)
31+
|| url.toLocalFile().endsWith(".ps1", Qt::CaseInsensitive)
3032
|| url.toLocalFile().endsWith(".appx", Qt::CaseInsensitive))
3133
{
3234
return true;

0 commit comments

Comments
 (0)