OLD | NEW |
1 #!/bin/sh | 1 #!/bin/sh |
2 | 2 |
3 # Copyright 2013 The Chromium Authors. All rights reserved. | 3 # Copyright 2013 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 # This script generates a (end-entity, intermediate, root) certificate, where | 7 # This script generates a (end-entity, intermediate, root) certificate, where |
8 # the root has no explicit policies associated, the intermediate has multiple | 8 # the root has no explicit policies associated, the intermediate has multiple |
9 # policies, and the leaf has a single policy. | 9 # policies, and the leaf has a single policy. |
10 # | 10 # |
11 # When validating, supplying no policy OID should not result in an error. | 11 # When validating, supplying no policy OID should not result in an error. |
12 | 12 |
13 try() { | 13 try() { |
14 "$@" || (e=$?; echo "$@" > /dev/stderr; exit $e) | 14 echo "$@" |
| 15 "$@" || exit 1 |
15 } | 16 } |
16 | 17 |
17 try rm -rf out | 18 try rm -rf out |
18 try mkdir out | 19 try mkdir out |
19 | 20 |
20 # Create the serial number files. | 21 # Create the serial number files. |
21 try /bin/sh -c "echo 01 > out/policy-root-serial" | 22 try /bin/sh -c "echo 01 > out/policy-root-serial" |
22 try /bin/sh -c "echo 01 > out/policy-intermediate-serial" | 23 try /bin/sh -c "echo 01 > out/policy-intermediate-serial" |
23 | 24 |
24 # Create the signers' DB files. | 25 # Create the signers' DB files. |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 try openssl ca \ | 88 try openssl ca \ |
88 -batch \ | 89 -batch \ |
89 -in out/policy-cert.csr \ | 90 -in out/policy-cert.csr \ |
90 -out out/policy-cert.pem \ | 91 -out out/policy-cert.pem \ |
91 -config policy.cnf \ | 92 -config policy.cnf \ |
92 -extensions user_cert | 93 -extensions user_cert |
93 | 94 |
94 try /bin/sh -c "cat out/policy-cert.pem \ | 95 try /bin/sh -c "cat out/policy-cert.pem \ |
95 out/policy-intermediate.pem \ | 96 out/policy-intermediate.pem \ |
96 out/policy-root.pem >../certificates/explicit-policy-chain.pem" | 97 out/policy-root.pem >../certificates/explicit-policy-chain.pem" |
OLD | NEW |