Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Side by Side Diff: chrome/installer/mac/sign_installer_tools.sh

Issue 1470503002: Sign Mac diff patcher tools: goobspatch, xzdec, liblzma_decompress.dylib (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/chrome_installer.gypi ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 #!/bin/bash -p
2
3 # Copyright 2015 The Chromium Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file.
6
7 # Using codesign, sign the installer tools. After signing, the signatures are
8 # verified.
9
10 set -eu
11
12 # Environment sanitization. Set a known-safe PATH. Clear environment variables
13 # that might impact the interpreter's operation. The |bash -p| invocation
14 # on the #! line takes the bite out of BASH_ENV, ENV, and SHELLOPTS (among
15 # other features), but clearing them here ensures that they won't impact any
16 # shell scripts used as utility programs. SHELLOPTS is read-only and can't be
17 # unset, only unexported.
18 export PATH="/usr/bin:/bin:/usr/sbin:/sbin"
19 unset BASH_ENV CDPATH ENV GLOBIGNORE IFS POSIXLY_CORRECT
20 export -n SHELLOPTS
21
22 ME="$(basename "${0}")"
23 readonly ME
24
25 if [[ ${#} -ne 3 ]]; then
26 echo "usage: ${ME} packaging_dir codesign_keychain codesign_id" >& 2
27 exit 1
28 fi
29
30 packaging_dir="${1}"
31 codesign_keychain="${2}"
32 codesign_id="${3}"
33
34 enforcement_flags="restrict,library-validation,kill"
Greg K 2015/11/23 15:28:39 I'm all about setting library-validation on the in
Mark Mentovai 2015/11/23 15:42:28 Greg Kerr wrote:
35
36 executables=(goobspatch xzdec)
37 libraries=(liblzma_decompress.dylib)
38 declare -a everything
39
40 for executable in "${executables[@]}"; do
41 sign_path="${packaging_dir}/${executable}"
42 everything+=("${sign_path}")
43
44 codesign --sign "${codesign_id}" --keychain "${codesign_keychain}" \
45 "${sign_path}" --options "${enforcement_flags}"
46 done
47
48 for library in "${libraries[@]}"; do
49 sign_path="${packaging_dir}/${library}"
50 everything+=("${sign_path}")
51
52 codesign --sign "${codesign_id}" --keychain "${codesign_keychain}" \
53 "${sign_path}"
54 done
55
56 for sign_path in "${everything[@]}"; do
57 codesign --verify --deep -vvvvvv "${sign_path}"
58 done
OLDNEW
« no previous file with comments | « chrome/chrome_installer.gypi ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698