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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/chrome_installer.gypi ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/installer/mac/sign_installer_tools.sh
diff --git a/chrome/installer/mac/sign_installer_tools.sh b/chrome/installer/mac/sign_installer_tools.sh
new file mode 100755
index 0000000000000000000000000000000000000000..4b0834d466465ec62d39af88452d03c4504859b6
--- /dev/null
+++ b/chrome/installer/mac/sign_installer_tools.sh
@@ -0,0 +1,58 @@
+#!/bin/bash -p
+
+# Copyright 2015 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+# Using codesign, sign the installer tools. After signing, the signatures are
+# verified.
+
+set -eu
+
+# Environment sanitization. Set a known-safe PATH. Clear environment variables
+# that might impact the interpreter's operation. The |bash -p| invocation
+# on the #! line takes the bite out of BASH_ENV, ENV, and SHELLOPTS (among
+# other features), but clearing them here ensures that they won't impact any
+# shell scripts used as utility programs. SHELLOPTS is read-only and can't be
+# unset, only unexported.
+export PATH="/usr/bin:/bin:/usr/sbin:/sbin"
+unset BASH_ENV CDPATH ENV GLOBIGNORE IFS POSIXLY_CORRECT
+export -n SHELLOPTS
+
+ME="$(basename "${0}")"
+readonly ME
+
+if [[ ${#} -ne 3 ]]; then
+ echo "usage: ${ME} packaging_dir codesign_keychain codesign_id" >& 2
+ exit 1
+fi
+
+packaging_dir="${1}"
+codesign_keychain="${2}"
+codesign_id="${3}"
+
+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:
+
+executables=(goobspatch xzdec)
+libraries=(liblzma_decompress.dylib)
+declare -a everything
+
+for executable in "${executables[@]}"; do
+ sign_path="${packaging_dir}/${executable}"
+ everything+=("${sign_path}")
+
+ codesign --sign "${codesign_id}" --keychain "${codesign_keychain}" \
+ "${sign_path}" --options "${enforcement_flags}"
+done
+
+for library in "${libraries[@]}"; do
+ sign_path="${packaging_dir}/${library}"
+ everything+=("${sign_path}")
+
+ codesign --sign "${codesign_id}" --keychain "${codesign_keychain}" \
+ "${sign_path}"
+done
+
+for sign_path in "${everything[@]}"; do
+ codesign --verify --deep -vvvvvv "${sign_path}"
+done
« 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