| OLD | NEW |
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 # Copyright (c) 2015 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2015 The Chromium 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 """Certificate chain where the target has an incorrect signature. Everything | 6 """Certificate chain where the target certificate has an incorrect signature.""" |
| 7 else should check out, however the digital signature contained in the target | |
| 8 certificate is wrong.""" | |
| 9 | 7 |
| 10 import sys | 8 import sys |
| 11 sys.path += ['..'] | 9 sys.path += ['..'] |
| 12 | 10 |
| 13 import common | 11 import common |
| 14 | 12 |
| 15 # Self-signed root certificate (used as trust anchor). | 13 # Self-signed root certificate. |
| 16 root = common.create_self_signed_root_certificate('Root') | 14 root = common.create_self_signed_root_certificate('Root') |
| 17 | 15 |
| 18 # Intermediate certificate to include in the certificate chain. | 16 # Intermediate certificate to include in the certificate chain. |
| 19 intermediate = common.create_intermediate_certificate('Intermediate', root) | 17 intermediate = common.create_intermediate_certificate('Intermediate', root) |
| 20 | 18 |
| 21 # Actual intermediate that was used to sign the target certificate. It has the | 19 # Actual intermediate that was used to sign the target certificate. It has the |
| 22 # same subject as expected, but a different RSA key from the certificate | 20 # same subject as expected, but a different RSA key from the certificate |
| 23 # included in the actual chain. | 21 # included in the actual chain. |
| 24 wrong_intermediate = common.create_intermediate_certificate('Intermediate', | 22 wrong_intermediate = common.create_intermediate_certificate('Intermediate', |
| 25 root) | 23 root) |
| 26 | 24 |
| 27 # Target certificate, signed using |wrong_intermediate| NOT |intermediate|. | 25 # Target certificate, signed using |wrong_intermediate| NOT |intermediate|. |
| 28 target = common.create_end_entity_certificate('Target', wrong_intermediate) | 26 target = common.create_end_entity_certificate('Target', wrong_intermediate) |
| 29 | 27 |
| 30 chain = [target, intermediate, root] | 28 chain = [target, intermediate, root] |
| 31 common.write_chain(__doc__, chain, 'chain.pem') | 29 common.write_chain(__doc__, chain, 'chain.pem') |
| OLD | NEW |