aboutsummaryrefslogtreecommitdiff
path: root/contrib/windeploy/detached-sig-create.sh
diff options
context:
space:
mode:
authorCory Fields <cory-nospam-@coryfields.com>2017-01-10 15:21:25 -0500
committerCory Fields <cory-nospam-@coryfields.com>2017-01-10 18:58:09 -0500
commit00683615df22c24b219b35f518feef792258b862 (patch)
tree4c10c832afc60233bbfce26c26c0b6bbea5bd2e5 /contrib/windeploy/detached-sig-create.sh
parent5bc3b6cede8dabdf3f4f27ddb03723cbb7cde51a (diff)
downloadbitcoin-00683615df22c24b219b35f518feef792258b862.tar.xz
release: add win detached sig creator and our cert chain
To ensure that this is the correct chain, it is pulled from a previous release binary. Procedure: $ osslsigncode extract-signature -pem -in bitcoin-0.13.2-win32-setup.exe \ -out bitcoin-0.13.2-win32-setup.exe.pem $ openssl pkcs7 -print_certs -in bitcoin-0.13.2-win32-setup.exe.pem \ -out win-codesign.cert Hand-edit to remove comments, as well as the timestamp cert.
Diffstat (limited to 'contrib/windeploy/detached-sig-create.sh')
-rwxr-xr-xcontrib/windeploy/detached-sig-create.sh34
1 files changed, 34 insertions, 0 deletions
diff --git a/contrib/windeploy/detached-sig-create.sh b/contrib/windeploy/detached-sig-create.sh
new file mode 100755
index 0000000000..bf4978d143
--- /dev/null
+++ b/contrib/windeploy/detached-sig-create.sh
@@ -0,0 +1,34 @@
+#!/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.
+
+if [ -z "$OSSLSIGNCODE" ]; then
+ OSSLSIGNCODE=osslsigncode
+fi
+
+if [ ! -n "$1" ]; then
+ 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}"
+basename -a `ls -1 "${SRCDIR}"/*-unsigned.exe` | while read UNSIGNED; do
+ 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}"