summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2025-01-09 17:20:45 +0100
committerWerner Koch <wk@gnupg.org>2025-01-09 17:20:45 +0100
commit5ac8446ca8bf3fc3b1f41ffd91eb998034f9c5a8 (patch)
tree339ee782513aeaa78cd4ea7fac17938dff857e1b
parentgpg: Show the default PIN hint also before "name" and "key-attr" (diff)
downloadgnupg2-5ac8446ca8bf3fc3b1f41ffd91eb998034f9c5a8.tar.xz
gnupg2-5ac8446ca8bf3fc3b1f41ffd91eb998034f9c5a8.zip
tools: Some tweaks to gpg-authcode-sign.sh
* tools/gpg-authcode-sign.sh: Skip too short files and rename certain files to ".dll". -- osslsigncode requires file suffixes of exe or dll but not dll-x or dll-ex which we use in our gpg4win build system. This adds workarounds for this and for short dummy files.
-rwxr-xr-xtools/gpg-authcode-sign.sh11
1 files changed, 11 insertions, 0 deletions
diff --git a/tools/gpg-authcode-sign.sh b/tools/gpg-authcode-sign.sh
index 14147c081..35a0f3827 100755
--- a/tools/gpg-authcode-sign.sh
+++ b/tools/gpg-authcode-sign.sh
@@ -215,6 +215,10 @@ if [ -n "$dryrun" ]; then
echo >&2 "$PGM: would sign: '$inname' to '$outname'"
+elif [ $(wc -c < "$inname" ) -lt 256 ]; then
+
+ echo >&2 "$PGM: skipping '$inname' which is too short"
+
elif [ -n "$AUTHENTICODE_SIGNHOST" ]; then
echo >&2 "$PGM: Signing via host $AUTHENTICODE_SIGNHOST"
@@ -233,6 +237,12 @@ elif [ "$AUTHENTICODE_KEY" = card ]; then
echo >&2 "$PGM: Signing using a card: '$inname'"
+ if echo "$inname" | egrep 'dll-e?x$' >/dev/null ; then
+ # osslsignecode does not like *.dll-x and *.dll-ex
+ cp "$inname" "$inname.tmp.dll"
+ inname="$inname.tmp.dll"
+ fi
+
while ! "$OSSLSIGNCODE" sign \
-pkcs11engine "$OSSLPKCS11ENGINE" \
-pkcs11module "$SCUTEMODULE" \
@@ -253,6 +263,7 @@ elif [ "$AUTHENTICODE_KEY" = card ]; then
sleep $waittime
waittime=$(( $waittime * 2 ))
done
+ [ -f "$inname.tmp.dll" ] && rm "$inname.tmp.dll"
rm "$outname.tmp.log"
cp "$outname.tmp" "$outname"
rm "$outname.tmp"