OLD | NEW |
1 #!/bin/sh | 1 #!/bin/sh |
2 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 2 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 # This script is temporary front-end to entd. It validates the policy's | 6 # This script is temporary front-end to entd. It validates the policy's |
7 # signature before starting the daemon. If the signing certificate or | 7 # signature before starting the daemon. If the signing certificate or |
8 # signature to not validate, then this script will log an error to syslog | 8 # signature to not validate, then this script will log an error to syslog |
9 # and exit without starting entd. | 9 # and exit without starting entd. |
10 # | 10 # |
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
262 return 1 | 262 return 1 |
263 fi | 263 fi |
264 | 264 |
265 local root_ca_option="" | 265 local root_ca_option="" |
266 if [ -f "$extension/$ROOT_CA_FILE" ]; then | 266 if [ -f "$extension/$ROOT_CA_FILE" ]; then |
267 root_ca_option="--root-ca-file=$extension/$ROOT_CA_FILE" | 267 root_ca_option="--root-ca-file=$extension/$ROOT_CA_FILE" |
268 fi | 268 fi |
269 | 269 |
270 local extid="$(basename $(dirname "$extension"))" | 270 local extid="$(basename $(dirname "$extension"))" |
271 | 271 |
| 272 local cryptohome_flag="" |
| 273 if [ -r "/home/chronos/.cryptohome-init-pkcs11" ]; then |
| 274 cryptohome_flag="--cryptohome-init-pkcs11" |
| 275 fi |
272 exec "$FLAGS_entd" --utility="$FLAGS_utility" "$root_ca_option" \ | 276 exec "$FLAGS_entd" --utility="$FLAGS_utility" "$root_ca_option" \ |
273 --policy="$extension/policy.js" --manifest="$extension/manifest.json" \ | 277 --policy="$extension/policy.js" --manifest="$extension/manifest.json" \ |
274 --username="$FLAGS_username" --callback-origin=chrome-extension://"$extid" | 278 --username="$FLAGS_username" --callback-origin=chrome-extension://"$extid" \ |
| 279 $cryptohome_flag |
275 } | 280 } |
276 | 281 |
277 cmd_disapprove() { | 282 cmd_disapprove() { |
278 if [ -f "$FLAGS_user_var/$APPROVED_CA" ]; then | 283 if [ -f "$FLAGS_user_var/$APPROVED_CA" ]; then |
279 log "Removing enterprise certificate authority" | 284 log "Removing enterprise certificate authority" |
280 rm -f "$FLAGS_user_var/$APPROVED_CA" | 285 rm -f "$FLAGS_user_var/$APPROVED_CA" |
281 else | 286 else |
282 log "No enterprise certificate authority has been approved." | 287 log "No enterprise certificate authority has been approved." |
283 fi | 288 fi |
284 } | 289 } |
(...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
688 } | 693 } |
689 EOF | 694 EOF |
690 | 695 |
691 "$FLAGS_entd" --policy="$scriptfile" --manifest="$extension/manifest.json" \ | 696 "$FLAGS_entd" --policy="$scriptfile" --manifest="$extension/manifest.json" \ |
692 --username=user@example.com --allow-dirty-exit 2>/dev/null | 697 --username=user@example.com --allow-dirty-exit 2>/dev/null |
693 | 698 |
694 rm "$scriptfile" | 699 rm "$scriptfile" |
695 } | 700 } |
696 | 701 |
697 main "$@" | 702 main "$@" |
OLD | NEW |