-
Notifications
You must be signed in to change notification settings - Fork 612
/
signtool.sh
executable file
·50 lines (46 loc) · 1.12 KB
/
signtool.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/bin/sh
# This helper is intended to be used in the Azure Pipelines that build
# Pacman packages containing code-signed executables.
#
# It expects the private key in PKCS12 format in ~/.sig/codesign.p12 and
# the corresponding password in ~/.sig/codesign.pass.
type osslsigncode >/dev/null 2>&1 || {
if test -x /clangarm64/bin/osslsigncode.exe
then
PATH=/clangarm64/bin:$PATH
elif test -x /mingw64/bin/osslsigncode.exe
then
PATH=/mingw64/bin:$PATH
elif test -x /mingw32/bin/osslsigncode.exe
then
PATH=/mingw32/bin:$PATH
else
echo "Could not find osslsigncode.exe in the PATH:" >&2
echo "$PATH" >&2
echo "/ is $(cygpath -aw /)" >&2
exit 1
fi
}
s () {
osslsigncode.exe sign \
-verbose \
-pkcs12 "$HOME/.sig/codesign.p12" \
-readpass "$HOME/.sig/codesign.pass" \
-ts http://timestamp.comodoca.com?td=sha256 \
-n "Git for Windows" \
-h sha256 "$1" "$1.signed.exe" &&
mv -f "$1.signed.exe" "$1"
}
for f in "$@"
do
s "$f" || {
echo "Giving timestamp host some time..." >&2
sleep 5 && s "$f" || {
sleep 10 && s "$f" || {
sleep 20 && s "$f" || {
sleep 40 && s "$f"
}
}
}
} || exit
done