Ticket #13252: signit.sh

File signit.sh, 884 bytes (added by mcs, 3 years ago)

Mark and Kathy's codesign test script

Line 
1#!/bin/sh
2
3set -e
4
5CERTNAME="TODO"
6TOP=TorBrowser.app
7BINARIES="$TOP/Contents/MacOS/*.dylib $TOP/Contents/MacOS/Tor/*.dylib $TOP/Contents/MacOS/Tor/tor.real $TOP/Contents/MacOS/XUL"
8PT_BINARIES="$TOP/Contents/MacOS/Tor/PluggableTransports/meek-client $TOP/Contents/MacOS/Tor/PluggableTransports/meek-client-torbrowser $TOP/Contents/MacOS/Tor/PluggableTransports/obfs4proxy"
9BUNDLES="$TOP/Contents/MacOS/plugin-container.app $TOP/Contents/MacOS/updater.app $TOP/Contents/MacOS/Tor/tor.real $TOP/Contents/MacOS/XUL"
10ALL="$BINARIES $PT_BINARIES $BUNDLES $TOP"
11
12# Verify signature (-v)
13if [ "$1" = "-v" ]; then
14        codesign --verify --deep --verbose=2 $TOP
15        exit $?
16fi
17
18# Sign
19find "$TOP" -type d -name _CodeSignature -delete
20
21for b in $ALL; do
22        echo "Signing $b"
23        codesign -vvv -f -s "$CERTNAME" $b
24        RC=$?
25        if [ $RC -ne 0 ]; then
26                echo "failed with exit code $RC" 1>&2
27                exit $RC
28        fi
29done