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

Side by Side Diff: net/data/cert_issuer_source_aia_unittest/generate-certs.py

Issue 2036033002: Add CertIssuerSourceAia: authorityInfoAccess fetching for CertPathBuilder. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@cert-parsing-path-building
Patch Set: remove orphaned kw_args change, remove g_cur_path_id change from this cl Created 4 years, 6 months 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 unified diff | Download patch
« no previous file with comments | « net/cert/internal/parsed_certificate.cc ('k') | net/data/cert_issuer_source_aia_unittest/i.pem » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 #!/usr/bin/env python
2 # Copyright 2016 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file.
5
6 import os
7 import sys
8 sys.path += [os.path.join('..', 'verify_certificate_chain_unittest')]
9
10 import common
11
12
13 # Self-signed root certificate. Not saved to a .pem since the test doesn't need
14 # it.
15 root = common.create_self_signed_root_certificate('Root')
16
17
18 # Intermediary certificates. All have the same subject and key.
19 i_base = common.create_intermediary_certificate('I', root)
20 common.write_string_to_file(i_base.get_cert_pem(), 'i.pem')
21
22 i2 = common.create_intermediary_certificate('I', root)
23 i2.set_key_path(i_base.get_key_path())
24 common.write_string_to_file(i2.get_cert_pem(), 'i2.pem')
25
26 i3 = common.create_intermediary_certificate('I', root)
27 i3.set_key_path(i_base.get_key_path())
28 common.write_string_to_file(i3.get_cert_pem(), 'i3.pem')
29
30
31 # More Intermediary certificates, which are just to generate the proper config
32 # files so the target certs will have the desired Authority Information Access
33 # values. These ones aren't saved to files.
34 i_no_aia = common.create_intermediary_certificate('I', root)
35 i_no_aia.set_key_path(i_base.get_key_path())
36 section = i_no_aia.config.get_section('signing_ca_ext')
37 section.set_property('authorityInfoAccess', None)
38
39 i_two_aia = common.create_intermediary_certificate('I', root)
40 i_two_aia.set_key_path(i_base.get_key_path())
41 section = i_two_aia.config.get_section('issuer_info')
42 section.set_property('caIssuers;URI.1', 'http://url-for-aia2/I2.foo')
43
44 i_three_aia = common.create_intermediary_certificate('I', root)
45 i_three_aia.set_key_path(i_base.get_key_path())
46 section = i_three_aia.config.get_section('issuer_info')
47 section.set_property('caIssuers;URI.1', 'http://url-for-aia2/I2.foo')
48 section.set_property('caIssuers;URI.2', 'http://url-for-aia3/I3.foo')
49
50 i_six_aia = common.create_intermediary_certificate('I', root)
51 i_six_aia.set_key_path(i_base.get_key_path())
52 section = i_six_aia.config.get_section('issuer_info')
53 section.set_property('caIssuers;URI.1', 'http://url-for-aia2/I2.foo')
54 section.set_property('caIssuers;URI.2', 'http://url-for-aia3/I3.foo')
55 section.set_property('caIssuers;URI.3', 'http://url-for-aia4/I4.foo')
56 section.set_property('caIssuers;URI.4', 'http://url-for-aia5/I5.foo')
57 section.set_property('caIssuers;URI.5', 'http://url-for-aia6/I6.foo')
58
59 i_file_aia = common.create_intermediary_certificate('I', root)
60 i_file_aia.set_key_path(i_base.get_key_path())
61 section = i_file_aia.config.get_section('issuer_info')
62 section.set_property('caIssuers;URI.0', 'file:///dev/null')
63
64 i_invalid_url_aia = common.create_intermediary_certificate('I', root)
65 i_invalid_url_aia.set_key_path(i_base.get_key_path())
66 section = i_invalid_url_aia.config.get_section('issuer_info')
67 section.set_property('caIssuers;URI.0', 'foobar')
68
69 i_file_and_http_aia = common.create_intermediary_certificate('I', root)
70 i_file_and_http_aia.set_key_path(i_base.get_key_path())
71 section = i_file_and_http_aia.config.get_section('issuer_info')
72 section.set_property('caIssuers;URI.0', 'file:///dev/null')
73 section.set_property('caIssuers;URI.1', 'http://url-for-aia2/I2.foo')
74
75 i_invalid_and_http_aia = common.create_intermediary_certificate('I', root)
76 i_invalid_and_http_aia.set_key_path(i_base.get_key_path())
77 section = i_invalid_and_http_aia.config.get_section('issuer_info')
78 section.set_property('caIssuers;URI.0', 'foobar')
79 section.set_property('caIssuers;URI.1', 'http://url-for-aia2/I2.foo')
80
81
82 # target certs
83
84 target = common.create_end_entity_certificate('target', i_base)
85 common.write_string_to_file(target.get_cert_pem(), 'target_one_aia.pem')
86
87 target = common.create_end_entity_certificate('target', i_no_aia)
88 common.write_string_to_file(target.get_cert_pem(), 'target_no_aia.pem')
89
90 target = common.create_end_entity_certificate('target', i_two_aia)
91 common.write_string_to_file(target.get_cert_pem(), 'target_two_aia.pem')
92
93 target = common.create_end_entity_certificate('target', i_three_aia)
94 common.write_string_to_file(target.get_cert_pem(), 'target_three_aia.pem')
95
96 target = common.create_end_entity_certificate('target', i_six_aia)
97 common.write_string_to_file(target.get_cert_pem(), 'target_six_aia.pem')
98
99 target = common.create_end_entity_certificate('target', i_file_aia)
100 common.write_string_to_file(target.get_cert_pem(), 'target_file_aia.pem')
101
102 target = common.create_end_entity_certificate('target', i_invalid_url_aia)
103 common.write_string_to_file(target.get_cert_pem(), 'target_invalid_url_aia.pem')
104
105 target = common.create_end_entity_certificate('target', i_file_and_http_aia)
106 common.write_string_to_file(target.get_cert_pem(),
107 'target_file_and_http_aia.pem')
108
109 target = common.create_end_entity_certificate('target', i_invalid_and_http_aia)
110 common.write_string_to_file(target.get_cert_pem(),
111 'target_invalid_and_http_aia.pem')
112
OLDNEW
« no previous file with comments | « net/cert/internal/parsed_certificate.cc ('k') | net/data/cert_issuer_source_aia_unittest/i.pem » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698