1
0
mirror of git://git.gnupg.org/gnupg.git synced 2025-01-19 14:27:02 +01:00

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.
This commit is contained in:
Werner Koch 2025-01-09 17:20:45 +01:00
parent cbc7fa0c8e
commit 5ac8446ca8
No known key found for this signature in database
GPG Key ID: E3FDFF218E45B72B

View File

@ -215,6 +215,10 @@ if [ -n "$dryrun" ]; then
echo >&2 "$PGM: would sign: '$inname' to '$outname'" 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 elif [ -n "$AUTHENTICODE_SIGNHOST" ]; then
echo >&2 "$PGM: Signing via host $AUTHENTICODE_SIGNHOST" 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'" 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 \ while ! "$OSSLSIGNCODE" sign \
-pkcs11engine "$OSSLPKCS11ENGINE" \ -pkcs11engine "$OSSLPKCS11ENGINE" \
-pkcs11module "$SCUTEMODULE" \ -pkcs11module "$SCUTEMODULE" \
@ -253,6 +263,7 @@ elif [ "$AUTHENTICODE_KEY" = card ]; then
sleep $waittime sleep $waittime
waittime=$(( $waittime * 2 )) waittime=$(( $waittime * 2 ))
done done
[ -f "$inname.tmp.dll" ] && rm "$inname.tmp.dll"
rm "$outname.tmp.log" rm "$outname.tmp.log"
cp "$outname.tmp" "$outname" cp "$outname.tmp" "$outname"
rm "$outname.tmp" rm "$outname.tmp"