OLD | NEW |
1 # Copyright 2016 The Chromium Authors. All rights reserved. | 1 # Copyright 2016 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 '''Generates a test suite from NIST PKITS test descriptions. | 5 '''Generates a test suite from NIST PKITS test descriptions. |
6 | 6 |
7 The output is a set of Type Parameterized Tests which are included by | 7 The output is a set of Type Parameterized Tests which are included by |
8 pkits_unittest.h. See pkits_unittest.h for information on using the tests. | 8 pkits_unittest.h. See pkits_unittest.h for information on using the tests. |
9 GoogleTest has a limit of 50 tests per type parameterized testcase, so the tests | 9 GoogleTest has a limit of 50 tests per type parameterized testcase, so the tests |
10 are split up by section number (this also makes it possible to easily skip | 10 are split up by section number (this also makes it possible to easily skip |
(...skipping 670 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
681 # The path should validate successfully. | 681 # The path should validate successfully. |
682 TestInfo(True, initial_policy_set=[TEST_POLICY_1], | 682 TestInfo(True, initial_policy_set=[TEST_POLICY_1], |
683 user_constrained_policy_set=[TEST_POLICY_1]), | 683 user_constrained_policy_set=[TEST_POLICY_1]), |
684 | 684 |
685 # 2. default settings, but with initial-policy-set = {NIST-test-policy-6}. | 685 # 2. default settings, but with initial-policy-set = {NIST-test-policy-6}. |
686 # The path should not validate successfully. | 686 # The path should not validate successfully. |
687 TestInfo(False, initial_policy_set=[TEST_POLICY_6], | 687 TestInfo(False, initial_policy_set=[TEST_POLICY_6], |
688 user_constrained_policy_set=[]), | 688 user_constrained_policy_set=[]), |
689 ], | 689 ], |
690 | 690 |
| 691 '4.10.7': [ # Invalid Mapping From anyPolicy Test7 |
| 692 # Procedure: Validate Invalid Mapping From anyPolicy Test7 EE using the |
| 693 # default settings or open and verify Signed Test Message 6.2.2.100 using |
| 694 # the default settings. |
| 695 # |
| 696 # Expected Result: The path should not validate successfully since the |
| 697 # intermediate certificate includes a policy mapping extension in which |
| 698 # anyPolicy appears as an issuerDomainPolicy. |
| 699 TestInfo(False, user_constrained_policy_set=[]), |
| 700 ], |
| 701 |
691 '4.10.8': [ # Invalid Mapping To anyPolicy Test8 | 702 '4.10.8': [ # Invalid Mapping To anyPolicy Test8 |
692 # Procedure: Validate Invalid Mapping To anyPolicy Test8 EE using the | 703 # Procedure: Validate Invalid Mapping To anyPolicy Test8 EE using the |
693 # default settings or open and verify Signed Test Message 6.2.2.101 using | 704 # default settings or open and verify Signed Test Message 6.2.2.101 using |
694 # the default settings. | 705 # the default settings. |
695 # | 706 # |
696 # Expected Result: The path should not validate successfully since the | 707 # Expected Result: The path should not validate successfully since the |
697 # intermediate certificate includes a policy mapping extension in which | 708 # intermediate certificate includes a policy mapping extension in which |
698 # anyPolicy appears as an subjectDomainPolicy. | 709 # anyPolicy appears as an subjectDomainPolicy. |
699 # | |
700 # TODO(eroman): What should user_constrained_policy_set be? | |
701 TestInfo(False, user_constrained_policy_set=[]), | 710 TestInfo(False, user_constrained_policy_set=[]), |
702 ], | 711 ], |
703 | 712 |
704 '4.10.9': [ # Valid Policy Mapping Test9 | 713 '4.10.9': [ # Valid Policy Mapping Test9 |
705 # Procedure: Validate Valid Policy Mapping Test9 EE using the default | 714 # Procedure: Validate Valid Policy Mapping Test9 EE using the default |
706 # settings or open and verify Signed Test Message 6.2.2.102 using the | 715 # settings or open and verify Signed Test Message 6.2.2.102 using the |
707 # default settings. | 716 # default settings. |
708 # | 717 # |
709 # Expected Result: The authorities-constrained-policy-set will be | 718 # Expected Result: The authorities-constrained-policy-set will be |
710 # {NIST-test-policy-1} and the explicit-policy-indicator will be set (if | 719 # {NIST-test-policy-1} and the explicit-policy-indicator will be set (if |
(...skipping 500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1211 continue | 1220 continue |
1212 i, parse_test(lines, i, test_case_name, test_number, | 1221 i, parse_test(lines, i, test_case_name, test_number, |
1213 test_name, sanitized_test_names, output) | 1222 test_name, sanitized_test_names, output) |
1214 | 1223 |
1215 if test_case_name: | 1224 if test_case_name: |
1216 finalize_test_case(test_case_name, sanitized_test_names, output) | 1225 finalize_test_case(test_case_name, sanitized_test_names, output) |
1217 | 1226 |
1218 | 1227 |
1219 if __name__ == '__main__': | 1228 if __name__ == '__main__': |
1220 main() | 1229 main() |
OLD | NEW |