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

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

Issue 2735733003: Disable commonName matching for certificates (Closed)
Patch Set: Created 3 years, 9 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/x509_certificate_unittest.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
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright 2016 The Chromium Authors. All rights reserved. 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 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 import os 6 import os
7 import sys 7 import sys
8 sys.path += [os.path.join('..', 'verify_certificate_chain_unittest')] 8 sys.path += [os.path.join('..', 'verify_certificate_chain_unittest')]
9 9
10 import common 10 import common
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 i_invalid_and_http_aia = common.create_intermediate_certificate('I', root) 78 i_invalid_and_http_aia = common.create_intermediate_certificate('I', root)
79 i_invalid_and_http_aia.set_key(i_base.get_key()) 79 i_invalid_and_http_aia.set_key(i_base.get_key())
80 section = i_invalid_and_http_aia.config.get_section('issuer_info') 80 section = i_invalid_and_http_aia.config.get_section('issuer_info')
81 section.set_property('caIssuers;URI.0', 'foobar') 81 section.set_property('caIssuers;URI.0', 'foobar')
82 section.set_property('caIssuers;URI.1', 'http://url-for-aia2/I2.foo') 82 section.set_property('caIssuers;URI.1', 'http://url-for-aia2/I2.foo')
83 83
84 84
85 # target certs 85 # target certs
86 86
87 target = common.create_end_entity_certificate('target', i_base) 87 target = common.create_end_entity_certificate('target', i_base)
88 target.get_extensions().set_property('subjectAltName', 'DNS:target')
88 common.write_string_to_file(target.get_cert_pem(), 'target_one_aia.pem') 89 common.write_string_to_file(target.get_cert_pem(), 'target_one_aia.pem')
89 90
90 target = common.create_end_entity_certificate('target', i_no_aia) 91 target = common.create_end_entity_certificate('target', i_no_aia)
92 target.get_extensions().set_property('subjectAltName', 'DNS:target')
91 common.write_string_to_file(target.get_cert_pem(), 'target_no_aia.pem') 93 common.write_string_to_file(target.get_cert_pem(), 'target_no_aia.pem')
92 94
93 target = common.create_end_entity_certificate('target', i_two_aia) 95 target = common.create_end_entity_certificate('target', i_two_aia)
96 target.get_extensions().set_property('subjectAltName', 'DNS:target')
94 common.write_string_to_file(target.get_cert_pem(), 'target_two_aia.pem') 97 common.write_string_to_file(target.get_cert_pem(), 'target_two_aia.pem')
95 98
96 target = common.create_end_entity_certificate('target', i_three_aia) 99 target = common.create_end_entity_certificate('target', i_three_aia)
100 target.get_extensions().set_property('subjectAltName', 'DNS:target')
97 common.write_string_to_file(target.get_cert_pem(), 'target_three_aia.pem') 101 common.write_string_to_file(target.get_cert_pem(), 'target_three_aia.pem')
98 102
99 target = common.create_end_entity_certificate('target', i_six_aia) 103 target = common.create_end_entity_certificate('target', i_six_aia)
104 target.get_extensions().set_property('subjectAltName', 'DNS:target')
100 common.write_string_to_file(target.get_cert_pem(), 'target_six_aia.pem') 105 common.write_string_to_file(target.get_cert_pem(), 'target_six_aia.pem')
101 106
102 target = common.create_end_entity_certificate('target', i_file_aia) 107 target = common.create_end_entity_certificate('target', i_file_aia)
108 target.get_extensions().set_property('subjectAltName', 'DNS:target')
103 common.write_string_to_file(target.get_cert_pem(), 'target_file_aia.pem') 109 common.write_string_to_file(target.get_cert_pem(), 'target_file_aia.pem')
104 110
105 target = common.create_end_entity_certificate('target', i_invalid_url_aia) 111 target = common.create_end_entity_certificate('target', i_invalid_url_aia)
112 target.get_extensions().set_property('subjectAltName', 'DNS:target')
106 common.write_string_to_file(target.get_cert_pem(), 'target_invalid_url_aia.pem') 113 common.write_string_to_file(target.get_cert_pem(), 'target_invalid_url_aia.pem')
107 114
108 target = common.create_end_entity_certificate('target', i_file_and_http_aia) 115 target = common.create_end_entity_certificate('target', i_file_and_http_aia)
116 target.get_extensions().set_property('subjectAltName', 'DNS:target')
109 common.write_string_to_file(target.get_cert_pem(), 117 common.write_string_to_file(target.get_cert_pem(),
110 'target_file_and_http_aia.pem') 118 'target_file_and_http_aia.pem')
111 119
112 target = common.create_end_entity_certificate('target', i_invalid_and_http_aia) 120 target = common.create_end_entity_certificate('target', i_invalid_and_http_aia)
121 target.get_extensions().set_property('subjectAltName', 'DNS:target')
113 common.write_string_to_file(target.get_cert_pem(), 122 common.write_string_to_file(target.get_cert_pem(),
114 'target_invalid_and_http_aia.pem') 123 'target_invalid_and_http_aia.pem')
OLDNEW
« no previous file with comments | « net/cert/x509_certificate_unittest.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