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

Side by Side Diff: net/data/name_constraints_unittest/generate_name_constraints.py

Issue 2521813002: PKI library: dNSName constraints starting with dot should match subdomains. (Closed)
Patch Set: add test of ".." constraint Created 4 years 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/data/name_constraints_unittest/dnsname-permitted_two_dot.pem ('k') | net/net.gypi » ('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 2015 The Chromium Authors. All rights reserved. 2 # Copyright 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 import base64 6 import base64
7 import copy 7 import copy
8 import os 8 import os
9 import random 9 import random
10 import subprocess 10 import subprocess
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 204
205 dnsname_constraints2 = NameConstraintsGenerator() 205 dnsname_constraints2 = NameConstraintsGenerator()
206 dnsname_constraints2.add_permitted(dns_name("com")) 206 dnsname_constraints2.add_permitted(dns_name("com"))
207 dnsname_constraints2.add_excluded(dns_name("foo.bar.com")) 207 dnsname_constraints2.add_excluded(dns_name("foo.bar.com"))
208 generate(dnsname_constraints2, "dnsname2.pem") 208 generate(dnsname_constraints2, "dnsname2.pem")
209 209
210 dnsname_constraints3 = NameConstraintsGenerator() 210 dnsname_constraints3 = NameConstraintsGenerator()
211 dnsname_constraints3.add_permitted(dns_name(".bar.com")) 211 dnsname_constraints3.add_permitted(dns_name(".bar.com"))
212 generate(dnsname_constraints3, "dnsname-permitted_with_leading_dot.pem") 212 generate(dnsname_constraints3, "dnsname-permitted_with_leading_dot.pem")
213 213
214 dnsname_constraints4 = NameConstraintsGenerator()
215 dnsname_constraints4.add_excluded(dns_name(".bar.com"))
216 generate(dnsname_constraints4, "dnsname-excluded_with_leading_dot.pem")
217
218 dnsname_constraints5 = NameConstraintsGenerator()
219 dnsname_constraints5.add_permitted(dns_name(".."))
220 generate(dnsname_constraints5, "dnsname-permitted_two_dot.pem")
221
214 c = NameConstraintsGenerator() 222 c = NameConstraintsGenerator()
215 c.add_excluded(dns_name("excluded.permitted.example.com")) 223 c.add_excluded(dns_name("excluded.permitted.example.com"))
216 generate(c, "dnsname-excluded.pem") 224 generate(c, "dnsname-excluded.pem")
217 225
218 c = NameConstraintsGenerator() 226 c = NameConstraintsGenerator()
219 c.add_permitted(dns_name("permitted.example.com")) 227 c.add_permitted(dns_name("permitted.example.com"))
220 c.add_excluded(dns_name("")) 228 c.add_excluded(dns_name(""))
221 generate(c, "dnsname-excludeall.pem") 229 generate(c, "dnsname-excludeall.pem")
222 230
223 c = NameConstraintsGenerator() 231 c = NameConstraintsGenerator()
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after
524 dns_name("permitted.example.com"), minimum=1, maximum=2)) 532 dns_name("permitted.example.com"), minimum=1, maximum=2))
525 generate(c, "dnsname-with_min_1_and_max.pem") 533 generate(c, "dnsname-with_min_1_and_max.pem")
526 534
527 c = NameConstraintsGenerator() 535 c = NameConstraintsGenerator()
528 c.add_permitted(with_min_max(dns_name("permitted.example.com"), maximum=2)) 536 c.add_permitted(with_min_max(dns_name("permitted.example.com"), maximum=2))
529 generate(c, "dnsname-with_max.pem") 537 generate(c, "dnsname-with_max.pem")
530 538
531 539
532 if __name__ == '__main__': 540 if __name__ == '__main__':
533 main() 541 main()
OLDNEW
« no previous file with comments | « net/data/name_constraints_unittest/dnsname-permitted_two_dot.pem ('k') | net/net.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698