2017-03-13 07:37:02 +01:00
|
|
|
#!/bin/sh
|
|
|
|
# Copyright (c) 2014-2015 The Bitcoin Core developers
|
|
|
|
# Distributed under the MIT software license, see the accompanying
|
|
|
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
|
|
|
|
2018-06-18 13:12:07 +02:00
|
|
|
export LC_ALL=C
|
2017-03-13 07:37:02 +01:00
|
|
|
if [ -z "$OSSLSIGNCODE" ]; then
|
|
|
|
OSSLSIGNCODE=osslsigncode
|
|
|
|
fi
|
|
|
|
|
2020-07-29 15:42:12 +02:00
|
|
|
if [ -z "$1" ]; then
|
2017-03-13 07:37:02 +01:00
|
|
|
echo "usage: $0 <osslcodesign args>"
|
|
|
|
echo "example: $0 -key codesign.key"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
OUT=signature-win.tar.gz
|
|
|
|
SRCDIR=unsigned
|
|
|
|
WORKDIR=./.tmp
|
|
|
|
OUTDIR="${WORKDIR}/out"
|
|
|
|
OUTSUBDIR="${OUTDIR}/win"
|
|
|
|
TIMESERVER=http://timestamp.comodoca.com
|
|
|
|
CERTFILE="win-codesign.cert"
|
|
|
|
|
|
|
|
mkdir -p "${OUTSUBDIR}"
|
2019-07-05 03:00:44 +02:00
|
|
|
basename -a $(ls -1 "${SRCDIR}"/*-unsigned.exe) | while read UNSIGNED; do
|
2017-03-13 07:37:02 +01:00
|
|
|
echo Signing "${UNSIGNED}"
|
|
|
|
"${OSSLSIGNCODE}" sign -certs "${CERTFILE}" -t "${TIMESERVER}" -in "${SRCDIR}/${UNSIGNED}" -out "${WORKDIR}/${UNSIGNED}" "$@"
|
|
|
|
"${OSSLSIGNCODE}" extract-signature -pem -in "${WORKDIR}/${UNSIGNED}" -out "${OUTSUBDIR}/${UNSIGNED}.pem" && rm "${WORKDIR}/${UNSIGNED}"
|
|
|
|
done
|
|
|
|
|
|
|
|
rm -f "${OUT}"
|
|
|
|
tar -C "${OUTDIR}" -czf "${OUT}" .
|
|
|
|
rm -rf "${WORKDIR}"
|
|
|
|
echo "Created ${OUT}"
|