Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 #!/bin/bash -p | 1 #!/bin/bash -p |
| 2 | 2 |
| 3 # Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 4 # Use of this source code is governed by a BSD-style license that can be |
| 5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
| 6 | 6 |
| 7 # Using codesign, sign the installer tools. After signing, the signatures are | 7 # Using codesign, sign the installer tools. After signing, the signatures are |
| 8 # verified. | 8 # verified. |
| 9 | 9 |
| 10 set -eu | 10 set -eu |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 24 | 24 |
| 25 if [[ ${#} -ne 3 ]]; then | 25 if [[ ${#} -ne 3 ]]; then |
| 26 echo "usage: ${ME} packaging_dir codesign_keychain codesign_id" >& 2 | 26 echo "usage: ${ME} packaging_dir codesign_keychain codesign_id" >& 2 |
| 27 exit 1 | 27 exit 1 |
| 28 fi | 28 fi |
| 29 | 29 |
| 30 packaging_dir="${1}" | 30 packaging_dir="${1}" |
| 31 codesign_keychain="${2}" | 31 codesign_keychain="${2}" |
| 32 codesign_id="${3}" | 32 codesign_id="${3}" |
| 33 | 33 |
| 34 enforcement_flags="restrict,library-validation,kill" | 34 script_dir="$(dirname "${0}")" |
| 35 source "${script_dir}/variables.sh" | |
| 35 | 36 |
| 36 executables=(goobspatch xzdec) | 37 executables=(goobspatch xzdec) |
| 37 libraries=(liblzma_decompress.dylib) | 38 libraries=(liblzma_decompress.dylib) |
| 38 declare -a everything | 39 declare -a everything |
| 39 | 40 |
| 40 for executable in "${executables[@]}"; do | 41 for executable in "${executables[@]}"; do |
| 41 sign_path="${packaging_dir}/${executable}" | 42 sign_path="${packaging_dir}/${executable}" |
| 42 everything+=("${sign_path}") | 43 everything+=("${sign_path}") |
| 43 | 44 |
| 44 codesign --sign "${codesign_id}" --keychain "${codesign_keychain}" \ | 45 codesign --sign "${codesign_id}" --keychain "${codesign_keychain}" \ |
| 45 "${sign_path}" --options "${enforcement_flags}" | 46 "${sign_path}" --options "${enforcement_flags_tools}" |
|
Mark Mentovai
2017/04/25 02:02:24
No custom requirement action here? Now that the re
Mark Mentovai
2017/04/25 02:02:25
enforcement_flags_installer_tools? “tools” is a li
Greg K
2017/04/25 18:45:21
Done.
| |
| 46 done | 47 done |
| 47 | 48 |
| 48 for library in "${libraries[@]}"; do | 49 for library in "${libraries[@]}"; do |
| 49 sign_path="${packaging_dir}/${library}" | 50 sign_path="${packaging_dir}/${library}" |
| 50 everything+=("${sign_path}") | 51 everything+=("${sign_path}") |
| 51 | 52 |
| 52 codesign --sign "${codesign_id}" --keychain "${codesign_keychain}" \ | 53 codesign --sign "${codesign_id}" --keychain "${codesign_keychain}" \ |
| 53 "${sign_path}" | 54 "${sign_path}" |
| 54 done | 55 done |
| 55 | 56 |
| 56 for sign_path in "${everything[@]}"; do | 57 for sign_path in "${everything[@]}"; do |
| 57 codesign --verify --deep -vvvvvv "${sign_path}" | 58 codesign --verify --deep -vvvvvv "${sign_path}" |
| 58 done | 59 done |
| OLD | NEW |