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

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: update gypi Created 4 years, 1 month 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
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
214 c = NameConstraintsGenerator() 218 c = NameConstraintsGenerator()
215 c.add_excluded(dns_name("excluded.permitted.example.com")) 219 c.add_excluded(dns_name("excluded.permitted.example.com"))
216 generate(c, "dnsname-excluded.pem") 220 generate(c, "dnsname-excluded.pem")
217 221
218 c = NameConstraintsGenerator() 222 c = NameConstraintsGenerator()
219 c.add_permitted(dns_name("permitted.example.com")) 223 c.add_permitted(dns_name("permitted.example.com"))
220 c.add_excluded(dns_name("")) 224 c.add_excluded(dns_name(""))
221 generate(c, "dnsname-excludeall.pem") 225 generate(c, "dnsname-excludeall.pem")
222 226
223 c = NameConstraintsGenerator() 227 c = NameConstraintsGenerator()
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after
524 dns_name("permitted.example.com"), minimum=1, maximum=2)) 528 dns_name("permitted.example.com"), minimum=1, maximum=2))
525 generate(c, "dnsname-with_min_1_and_max.pem") 529 generate(c, "dnsname-with_min_1_and_max.pem")
526 530
527 c = NameConstraintsGenerator() 531 c = NameConstraintsGenerator()
528 c.add_permitted(with_min_max(dns_name("permitted.example.com"), maximum=2)) 532 c.add_permitted(with_min_max(dns_name("permitted.example.com"), maximum=2))
529 generate(c, "dnsname-with_max.pem") 533 generate(c, "dnsname-with_max.pem")
530 534
531 535
532 if __name__ == '__main__': 536 if __name__ == '__main__':
533 main() 537 main()
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698