| 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 18 matching lines...) Expand all Loading... |
| 29 output.write('\nWRAPPED_REGISTER_TYPED_TEST_CASE_P(%s' % test_case_name) | 29 output.write('\nWRAPPED_REGISTER_TYPED_TEST_CASE_P(%s' % test_case_name) |
| 30 for name in sanitized_test_names: | 30 for name in sanitized_test_names: |
| 31 output.write(',\n %s' % name) | 31 output.write(',\n %s' % name) |
| 32 output.write(');\n') | 32 output.write(');\n') |
| 33 | 33 |
| 34 | 34 |
| 35 def bool_to_str(b): | 35 def bool_to_str(b): |
| 36 return "true" if b else "false" | 36 return "true" if b else "false" |
| 37 | 37 |
| 38 | 38 |
| 39 def make_policies_string(policies): |
| 40 return '"' + ','.join(policies) + '"' |
| 41 |
| 42 |
| 39 def output_test(test_case_name, test_number, raw_test_name, subpart_number, | 43 def output_test(test_case_name, test_number, raw_test_name, subpart_number, |
| 40 info, certs, crls, sanitized_test_names, output): | 44 info, certs, crls, sanitized_test_names, output): |
| 41 '''Writes a test case to |output|, and appends the test name to | 45 '''Writes a test case to |output|, and appends the test name to |
| 42 |sanitized_test_names|.''' | 46 |sanitized_test_names|.''' |
| 43 sanitized_test_name = 'Section%s%s' % (test_number.split('.')[1], | 47 sanitized_test_name = 'Section%s%s' % (test_number.split('.')[1], |
| 44 sanitize_name(raw_test_name)) | 48 sanitize_name(raw_test_name)) |
| 45 | 49 |
| 50 subpart_comment = '' |
| 46 if subpart_number is not None: | 51 if subpart_number is not None: |
| 47 sanitized_test_name += "Subpart%d" % (subpart_number) | 52 sanitized_test_name += "Subpart%d" % (subpart_number) |
| 53 subpart_comment = ' (Subpart %d)' % (subpart_number) |
| 48 | 54 |
| 49 sanitized_test_names.append(sanitized_test_name) | 55 sanitized_test_names.append(sanitized_test_name) |
| 50 | 56 |
| 51 certs_formatted = ', '.join('"%s"' % n for n in certs) | 57 certs_formatted = ', '.join('"%s"' % n for n in certs) |
| 52 crls_formatted = ', '.join('"%s"' % n for n in crls) | 58 crls_formatted = ', '.join('"%s"' % n for n in crls) |
| 53 assert_function = 'ASSERT_TRUE' if info.should_validate else 'ASSERT_FALSE' | |
| 54 | 59 |
| 55 output.write(''' | 60 output.write(''' |
| 56 // %(test_number)s %(raw_test_name)s | 61 // %(test_number)s %(raw_test_name)s%(subpart_comment)s |
| 57 WRAPPED_TYPED_TEST_P(%(test_case_name)s, %(sanitized_test_name)s) { | 62 WRAPPED_TYPED_TEST_P(%(test_case_name)s, %(sanitized_test_name)s) { |
| 58 const char* const certs[] = { | 63 const char* const certs[] = { |
| 59 %(certs_formatted)s | 64 %(certs_formatted)s |
| 60 }; | 65 }; |
| 61 const char* const crls[] = { | 66 const char* const crls[] = { |
| 62 %(crls_formatted)s | 67 %(crls_formatted)s |
| 63 }; | 68 }; |
| 64 ''' % vars()) | 69 ''' % vars()) |
| 65 | 70 |
| 66 default_settings = TestInfo(False) | 71 default_info = TestInfo(None) |
| 67 | 72 |
| 68 settings_str = '' | 73 output.write('''PkitsTestInfo info; |
| 74 info.should_validate = %s; |
| 75 ''' % (bool_to_str(info.should_validate))) |
| 69 | 76 |
| 70 # Output any non-default settings. Only settings that differ from | 77 # Output any non-default inputs/outputs. Only properties that differ from |
| 71 # the default settings are written, so as to keep the generated | 78 # the defaults are written, so as to keep the generated file more readable. |
| 72 # file more readable. | 79 if info.initial_policy_set != default_info.initial_policy_set: |
| 73 if info.initial_policy_set != default_settings.initial_policy_set: | 80 output.write(''' info.SetInitialPolicySet(%s); |
| 74 settings_str += ''' settings.SetInitialPolicySet("%s"); | 81 ''' % make_policies_string(info.initial_policy_set)) |
| 75 ''' % (','.join(info.initial_policy_set)) | |
| 76 | 82 |
| 77 if info.initial_explicit_policy != default_settings.initial_explicit_policy: | 83 if info.initial_explicit_policy != default_info.initial_explicit_policy: |
| 78 settings_str += ''' settings.initial_explicit_policy = %s; | 84 output.write(''' info.SetInitialExplicitPolicy(%s); |
| 79 ''' % bool_to_str(info.initial_explicit_policy) | 85 ''' % bool_to_str(info.initial_explicit_policy)) |
| 80 | 86 |
| 81 if (info.initial_policy_mapping_inhibit != | 87 if (info.initial_policy_mapping_inhibit != |
| 82 default_settings.initial_policy_mapping_inhibit): | 88 default_info.initial_policy_mapping_inhibit): |
| 83 settings_str += ''' settings.initial_policy_mapping_inhibit = %s; | 89 output.write(''' info.SetInitialPolicyMappingInhibit(%s); |
| 84 ''' % bool_to_str(info.initial_policy_mapping_inhibit) | 90 ''' % bool_to_str(info.initial_policy_mapping_inhibit)) |
| 85 | 91 |
| 86 if (info.initial_inhibit_any_policy != | 92 if (info.initial_inhibit_any_policy != |
| 87 default_settings.initial_inhibit_any_policy): | 93 default_info.initial_inhibit_any_policy): |
| 88 settings_str += '''settings.initial_inhibit_any_policy = %s; | 94 output.write(''' info.SetInitialInhibitAnyPolicy(%s); |
| 89 ''' % bool_to_str(info.initial_inhibit_any_policy) | 95 ''' % bool_to_str(info.initial_inhibit_any_policy)) |
| 90 | 96 |
| 91 settings_param_str = '{}' | 97 if (info.user_constrained_policy_set != |
| 98 default_info.user_constrained_policy_set): |
| 99 output.write(''' info.SetUserConstrainedPolicySet(%s); |
| 100 ''' % make_policies_string(info.user_constrained_policy_set)) |
| 92 | 101 |
| 93 if settings_str != '': | 102 output.write(''' |
| 94 output.write(''' | 103 this->RunTest(certs, crls, info); |
| 95 // Custom settings | |
| 96 PkitsTestSettings settings; | |
| 97 ''') | |
| 98 output.write(settings_str) | |
| 99 output.write('\n') | |
| 100 settings_param_str = 'settings' | |
| 101 | |
| 102 output.write(''' %(assert_function)s(this->Verify(certs, crls, %(settings_par
am_str)s)); | |
| 103 } | 104 } |
| 104 ''' % vars()) | 105 ''' % vars()) |
| 105 | 106 |
| 106 | 107 |
| 107 # Matches a section header, ex: "4.1 Signature Verification" | 108 # Matches a section header, ex: "4.1 Signature Verification" |
| 108 SECTION_MATCHER = re.compile('^\s*(\d+\.\d+)\s+(.+)\s*$') | 109 SECTION_MATCHER = re.compile('^\s*(\d+\.\d+)\s+(.+)\s*$') |
| 109 # Matches a test header, ex: "4.1.1 Valid Signatures Test1" | 110 # Matches a test header, ex: "4.1.1 Valid Signatures Test1" |
| 110 TEST_MATCHER = re.compile('^\s*(\d+\.\d+.\d+)\s+(.+)\s*$') | 111 TEST_MATCHER = re.compile('^\s*(\d+\.\d+.\d+)\s+(.+)\s*$') |
| 111 | 112 |
| 112 # Matches the various headers in a test specification. | 113 # Matches the various headers in a test specification. |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 218 | 219 |
| 219 return certs, crls | 220 return certs, crls |
| 220 | 221 |
| 221 | 222 |
| 222 ANY_POLICY = 'anyPolicy' | 223 ANY_POLICY = 'anyPolicy' |
| 223 TEST_POLICY_1 = 'NIST-test-policy-1' | 224 TEST_POLICY_1 = 'NIST-test-policy-1' |
| 224 TEST_POLICY_2 = 'NIST-test-policy-2' | 225 TEST_POLICY_2 = 'NIST-test-policy-2' |
| 225 TEST_POLICY_3 = 'NIST-test-policy-3' | 226 TEST_POLICY_3 = 'NIST-test-policy-3' |
| 226 TEST_POLICY_6 = 'NIST-test-policy-6' | 227 TEST_POLICY_6 = 'NIST-test-policy-6' |
| 227 | 228 |
| 228 # TODO(eroman): This omits a few outputs from PKITS: | 229 # Note: This omits some outputs from PKITS: |
| 229 # | 230 # |
| 230 # * authorities-constrained-policy-set | 231 # * authorities-constrained-policy-set |
| 231 # * user-constrained-policy-set | |
| 232 # * explicit-policy-indicator | 232 # * explicit-policy-indicator |
| 233 # | |
| 234 # Consider adding the constrained policy sets in the future, if our | |
| 235 # verification code supports outputting them. | |
| 236 class TestInfo(object): | 233 class TestInfo(object): |
| 237 """This structure describes a test inputs and outputs""" | 234 """This structure describes a test inputs and outputs""" |
| 238 | 235 |
| 239 def __init__(self, should_validate, | 236 def __init__(self, should_validate, |
| 240 # These defaults come from section 3 of PKITS.pdf | 237 # These defaults come from section 3 of PKITS.pdf |
| 241 initial_policy_set = [ANY_POLICY], | 238 initial_policy_set = [ANY_POLICY], |
| 242 initial_explicit_policy = False, | 239 initial_explicit_policy = False, |
| 243 initial_policy_mapping_inhibit = False, | 240 initial_policy_mapping_inhibit = False, |
| 244 initial_inhibit_any_policy = False): | 241 initial_inhibit_any_policy = False, |
| 242 # In all of the tests that are not related to policy processing, |
| 243 # each certificate in the path asserts the certificate policy |
| 244 # 2.16.840.1.101.3.2.1.48.1 |
| 245 user_constrained_policy_set = [TEST_POLICY_1]): |
| 245 self.should_validate = should_validate | 246 self.should_validate = should_validate |
| 246 self.initial_policy_set = initial_policy_set | 247 self.initial_policy_set = initial_policy_set |
| 247 self.initial_explicit_policy = initial_explicit_policy | 248 self.initial_explicit_policy = initial_explicit_policy |
| 248 self.initial_policy_mapping_inhibit = initial_policy_mapping_inhibit | 249 self.initial_policy_mapping_inhibit = initial_policy_mapping_inhibit |
| 249 self.initial_inhibit_any_policy = initial_inhibit_any_policy | 250 self.initial_inhibit_any_policy = initial_inhibit_any_policy |
| 251 self.user_constrained_policy_set = user_constrained_policy_set |
| 250 | 252 |
| 251 | 253 |
| 252 TEST_OVERRIDES = { | 254 TEST_OVERRIDES = { |
| 253 '4.8.1': [ # All Certificates Same Policy Test1 | 255 '4.8.1': [ # All Certificates Same Policy Test1 |
| 254 # 1. default settings, but with initial-explicit-policy set. The path | 256 # 1. default settings, but with initial-explicit-policy set. The path |
| 255 # should validate successfully | 257 # should validate successfully |
| 256 TestInfo(True, initial_explicit_policy=True), | 258 TestInfo(True, initial_explicit_policy=True, |
| 259 user_constrained_policy_set=[TEST_POLICY_1]), |
| 257 | 260 |
| 258 # 2. default settings, but with initial-explicit-policy set and | 261 # 2. default settings, but with initial-explicit-policy set and |
| 259 # initial-policy-set = {NIST-test-policy-1}. The path should validate | 262 # initial-policy-set = {NIST-test-policy-1}. The path should validate |
| 260 # successfully. | 263 # successfully. |
| 261 TestInfo(True, initial_explicit_policy=True, | 264 TestInfo(True, initial_explicit_policy=True, |
| 262 initial_policy_set=[TEST_POLICY_1]), | 265 initial_policy_set=[TEST_POLICY_1], |
| 266 user_constrained_policy_set=[TEST_POLICY_1]), |
| 263 | 267 |
| 264 # 3. default settings, but with initial-explicit-policy set and | 268 # 3. default settings, but with initial-explicit-policy set and |
| 265 # initial-policy-set = {NIST-test-policy-2}. The path should not validate | 269 # initial-policy-set = {NIST-test-policy-2}. The path should not validate |
| 266 # successfully. | 270 # successfully. |
| 267 TestInfo(False, initial_explicit_policy=True, | 271 TestInfo(False, initial_explicit_policy=True, |
| 268 initial_policy_set=[TEST_POLICY_2]), | 272 initial_policy_set=[TEST_POLICY_2], |
| 273 user_constrained_policy_set=[]), |
| 269 | 274 |
| 270 # 4. default settings, but with initial-explicit-policy set and | 275 # 4. default settings, but with initial-explicit-policy set and |
| 271 # initial-policy-set = {NIST-test-policy-1, NIST-test-policy-2}. The path | 276 # initial-policy-set = {NIST-test-policy-1, NIST-test-policy-2}. The path |
| 272 # should validate successfully. | 277 # should validate successfully. |
| 273 TestInfo(True, initial_explicit_policy=True, | 278 TestInfo(True, initial_explicit_policy=True, |
| 274 initial_policy_set=[TEST_POLICY_1, TEST_POLICY_2]), | 279 initial_policy_set=[TEST_POLICY_1, TEST_POLICY_2], |
| 280 user_constrained_policy_set=[TEST_POLICY_1]), |
| 275 ], | 281 ], |
| 276 | 282 |
| 277 '4.8.2': [ # All Certificates No Policies Test2 | 283 '4.8.2': [ # All Certificates No Policies Test2 |
| 278 # 1. default settings. The path should validate successfully. | 284 # 1. default settings. The path should validate successfully. |
| 279 TestInfo(True), | 285 TestInfo(True, user_constrained_policy_set=[]), |
| 280 | 286 |
| 281 # 2. default settings, but with initial-explicit-policy set. The path | 287 # 2. default settings, but with initial-explicit-policy set. The path |
| 282 # should not validate successfully | 288 # should not validate successfully |
| 283 TestInfo(False, initial_explicit_policy=True), | 289 TestInfo(False, initial_explicit_policy=True, |
| 290 user_constrained_policy_set=[]), |
| 284 ], | 291 ], |
| 285 | 292 |
| 286 '4.8.3': [ # Different Policies Test3 | 293 '4.8.3': [ # Different Policies Test3 |
| 287 # 1. default settings. The path should validate successfully. | 294 # 1. default settings. The path should validate successfully. |
| 288 TestInfo(True), | 295 TestInfo(True, user_constrained_policy_set=[]), |
| 289 | 296 |
| 290 # 2. default settings, but with initial-explicit-policy set. The path | 297 # 2. default settings, but with initial-explicit-policy set. The path |
| 291 # should not validate successfully. | 298 # should not validate successfully. |
| 292 TestInfo(False, initial_explicit_policy=True), | 299 TestInfo(False, initial_explicit_policy=True, user_constrained_policy_set=[]
), |
| 293 | 300 |
| 294 # 3. default settings, but with initial-explicit-policy set and | 301 # 3. default settings, but with initial-explicit-policy set and |
| 295 # initial-policy-set = {NIST-test-policy-1, NIST-test-policy-2}. The path | 302 # initial-policy-set = {NIST-test-policy-1, NIST-test-policy-2}. The path |
| 296 # should not validate successfully. | 303 # should not validate successfully. |
| 297 TestInfo(False, initial_explicit_policy=True, | 304 TestInfo(False, initial_explicit_policy=True, |
| 298 initial_policy_set=[TEST_POLICY_1, TEST_POLICY_2]), | 305 initial_policy_set=[TEST_POLICY_1, TEST_POLICY_2], |
| 306 user_constrained_policy_set=[]), |
| 299 ], | 307 ], |
| 300 | 308 |
| 301 '4.8.4': [ # Different Policies Test4 | 309 '4.8.4': [ # Different Policies Test4 |
| 302 # Procedure: Validate Different Policies Test4 EE using the default | 310 # Procedure: Validate Different Policies Test4 EE using the default |
| 303 # settings or open and verify Signed Test Message 6.2.2.69 using the | 311 # settings or open and verify Signed Test Message 6.2.2.69 using the |
| 304 # default settings. | 312 # default settings. |
| 305 # | 313 # |
| 306 # Expected Result: The authorities-constrained-policy-set and the | 314 # Expected Result: The authorities-constrained-policy-set and the |
| 307 # user-constrained-policy-set will be empty. The explicit-policy-indicator | 315 # user-constrained-policy-set will be empty. The explicit-policy-indicator |
| 308 # will be set if the application can process the policyConstraints | 316 # will be set if the application can process the policyConstraints |
| 309 # extension. If the application can process the policyConstraints extension | 317 # extension. If the application can process the policyConstraints extension |
| 310 # then the path should not validate successfully. If the application can | 318 # then the path should not validate successfully. If the application can |
| 311 # not process the policyConstraints extension, then the path should | 319 # not process the policyConstraints extension, then the path should |
| 312 # validate successfully. | 320 # validate successfully. |
| 313 TestInfo(False), | 321 TestInfo(False, user_constrained_policy_set=[]), |
| 314 ], | 322 ], |
| 315 | 323 |
| 316 '4.8.5': [ # 4.8.5 Different Policies Test5 | 324 '4.8.5': [ # 4.8.5 Different Policies Test5 |
| 317 # Procedure: Validate Different Policies Test5 EE using the default | 325 # Procedure: Validate Different Policies Test5 EE using the default |
| 318 # settings or open and verify Signed Test Message 6.2.2.70 using the | 326 # settings or open and verify Signed Test Message 6.2.2.70 using the |
| 319 # default settings. | 327 # default settings. |
| 320 # | 328 # |
| 321 # Expected Result: The authorities-constrained-policy-set and the | 329 # Expected Result: The authorities-constrained-policy-set and the |
| 322 # user-constrained-policy-set will be empty. The explicit-policy-indicator | 330 # user-constrained-policy-set will be empty. The explicit-policy-indicator |
| 323 # will be set if the application can process the policyConstraints | 331 # will be set if the application can process the policyConstraints |
| 324 # extension. If the application can process the policyConstraints extension | 332 # extension. If the application can process the policyConstraints extension |
| 325 # then the path should not validate successfully. If the application can | 333 # then the path should not validate successfully. If the application can |
| 326 # not process the policyConstraints extension, then the path should | 334 # not process the policyConstraints extension, then the path should |
| 327 # validate successfully | 335 # validate successfully |
| 328 TestInfo(False), | 336 TestInfo(False, user_constrained_policy_set=[]), |
| 329 ], | 337 ], |
| 330 | 338 |
| 331 '4.8.6': [ # Overlapping Policies Test6 | 339 '4.8.6': [ # Overlapping Policies Test6 |
| 332 # 1. default settings. The path should validate successfully. | 340 # 1. default settings. The path should validate successfully. |
| 333 TestInfo(True), | 341 TestInfo(True, user_constrained_policy_set=[TEST_POLICY_1]), |
| 334 | 342 |
| 335 # 2. default settings, but with initial-policy-set = {NIST-test-policy-1}. | 343 # 2. default settings, but with initial-policy-set = {NIST-test-policy-1}. |
| 336 # The path should validate successfully. | 344 # The path should validate successfully. |
| 337 TestInfo(True, initial_policy_set=[TEST_POLICY_1]), | 345 TestInfo(True, initial_policy_set=[TEST_POLICY_1], |
| 346 user_constrained_policy_set=[TEST_POLICY_1]), |
| 338 | 347 |
| 339 # 3. default settings, but with initial-policy-set = {NIST-test-policy-2}. | 348 # 3. default settings, but with initial-policy-set = {NIST-test-policy-2}. |
| 340 # The path should not validate successfully. | 349 # The path should not validate successfully. |
| 341 TestInfo(False, initial_policy_set=[TEST_POLICY_2]), | 350 TestInfo(False, initial_policy_set=[TEST_POLICY_2], |
| 351 user_constrained_policy_set=[]), |
| 342 ], | 352 ], |
| 343 | 353 |
| 344 '4.8.7': [ # Different Policies Test7 | 354 '4.8.7': [ # Different Policies Test7 |
| 345 # Procedure: Validate Different Policies Test7 EE using the default | 355 # Procedure: Validate Different Policies Test7 EE using the default |
| 346 # settings or open and verify Signed Test Message 6.2.2.72 using the | 356 # settings or open and verify Signed Test Message 6.2.2.72 using the |
| 347 # default settings. | 357 # default settings. |
| 348 # | 358 # |
| 349 # Expected Result: The authorities-constrained-policy-set and the | 359 # Expected Result: The authorities-constrained-policy-set and the |
| 350 # user-constrained-policy-set will be empty. If the | 360 # user-constrained-policy-set will be empty. If the |
| 351 # explicit-policy-indicator will be set if the application can process the | 361 # explicit-policy-indicator will be set if the application can process the |
| 352 # policyConstraints extension. If the application can process the | 362 # policyConstraints extension. If the application can process the |
| 353 # policyConstraints extension, then the path should not validate | 363 # policyConstraints extension, then the path should not validate |
| 354 # successfully. If the application can not process the policyConstraints | 364 # successfully. If the application can not process the policyConstraints |
| 355 # extension, then the path should validate successfully. | 365 # extension, then the path should validate successfully. |
| 356 TestInfo(False), | 366 TestInfo(False, user_constrained_policy_set=[]), |
| 357 ], | 367 ], |
| 358 | 368 |
| 359 '4.8.8': [ # Different Policies Test8 | 369 '4.8.8': [ # Different Policies Test8 |
| 360 # Procedure: Validate Different Policies Test8 EE using the default | 370 # Procedure: Validate Different Policies Test8 EE using the default |
| 361 # settings or open and verify Signed Test Message 6.2.2.73 using the | 371 # settings or open and verify Signed Test Message 6.2.2.73 using the |
| 362 # default settings. | 372 # default settings. |
| 363 # | 373 # |
| 364 # Expected Result: The authorities-constrained-policy-set and the | 374 # Expected Result: The authorities-constrained-policy-set and the |
| 365 # user-constrained-policy-set will be empty. The explicit-policy-indicator | 375 # user-constrained-policy-set will be empty. The explicit-policy-indicator |
| 366 # will be set if the application can process the policyConstraints | 376 # will be set if the application can process the policyConstraints |
| 367 # extension. If the application can process the policyConstraints extension | 377 # extension. If the application can process the policyConstraints extension |
| 368 # then the path should not validate successfully. If the application can | 378 # then the path should not validate successfully. If the application can |
| 369 # not process the policyConstraints extension, then the path should | 379 # not process the policyConstraints extension, then the path should |
| 370 # validate successfully. | 380 # validate successfully. |
| 371 TestInfo(False), | 381 TestInfo(False, user_constrained_policy_set=[]), |
| 372 ], | 382 ], |
| 373 | 383 |
| 374 '4.8.9': [ # Different Policies Test9 | 384 '4.8.9': [ # Different Policies Test9 |
| 375 # Procedure: Validate Different Policies Test9 EE using the default | 385 # Procedure: Validate Different Policies Test9 EE using the default |
| 376 # settings or open and verify Signed Test Message 6.2.2.74 using the | 386 # settings or open and verify Signed Test Message 6.2.2.74 using the |
| 377 # default settings. | 387 # default settings. |
| 378 # | 388 # |
| 379 # Expected Result: The authorities-constrained-policy-set and the | 389 # Expected Result: The authorities-constrained-policy-set and the |
| 380 # user-constrained-policy-set will be empty. The explicit-policy-indicator | 390 # user-constrained-policy-set will be empty. The explicit-policy-indicator |
| 381 # will be set if the application can process the policyConstraints | 391 # will be set if the application can process the policyConstraints |
| 382 # extension. If the application can process the policyConstraints | 392 # extension. If the application can process the policyConstraints |
| 383 # extension, then the path should not validate successfully. If the | 393 # extension, then the path should not validate successfully. If the |
| 384 # application can not process the policyConstraints extension, then the | 394 # application can not process the policyConstraints extension, then the |
| 385 # path should validate successfully. | 395 # path should validate successfully. |
| 386 TestInfo(False), | 396 TestInfo(False, user_constrained_policy_set=[]), |
| 387 ], | 397 ], |
| 388 | 398 |
| 389 '4.8.10': [ # All Certificates Same Policies Test10 | 399 '4.8.10': [ # All Certificates Same Policies Test10 |
| 390 # 1. default settings. The path should validate successfully. | 400 # 1. default settings. The path should validate successfully. |
| 391 TestInfo(True), | 401 TestInfo(True, user_constrained_policy_set=[TEST_POLICY_1, TEST_POLICY_2]), |
| 392 | 402 |
| 393 # 2. default settings, but with initial-policy-set = {NIST-test-policy-1}. | 403 # 2. default settings, but with initial-policy-set = {NIST-test-policy-1}. |
| 394 # The path should validate successfully. | 404 # The path should validate successfully. |
| 395 TestInfo(True, initial_policy_set=[TEST_POLICY_1]), | 405 TestInfo(True, initial_policy_set=[TEST_POLICY_1], |
| 406 user_constrained_policy_set=[TEST_POLICY_1]), |
| 396 | 407 |
| 397 # 3. default settings, but with initial-policy-set = {NIST-test-policy-2}. | 408 # 3. default settings, but with initial-policy-set = {NIST-test-policy-2}. |
| 398 # The path should validate successfully. | 409 # The path should validate successfully. |
| 399 TestInfo(True, initial_policy_set=[TEST_POLICY_2]), | 410 TestInfo(True, initial_policy_set=[TEST_POLICY_2], |
| 411 user_constrained_policy_set=[TEST_POLICY_2]), |
| 400 ], | 412 ], |
| 401 | 413 |
| 402 '4.8.11': [ # All Certificates AnyPolicy Test11 | 414 '4.8.11': [ # All Certificates AnyPolicy Test11 |
| 403 # 1. default settings. The path should validate successfully. | 415 # 1. default settings. The path should validate successfully. |
| 404 TestInfo(True), | 416 TestInfo(True, user_constrained_policy_set=[ANY_POLICY]), |
| 405 | 417 |
| 406 # 2. default settings, but with initial-policy-set = {NIST-test-policy-1}. | 418 # 2. default settings, but with initial-policy-set = {NIST-test-policy-1}. |
| 407 # The path should validate successfully. | 419 # The path should validate successfully. |
| 408 TestInfo(True, initial_policy_set=[TEST_POLICY_1]), | 420 TestInfo(True, initial_policy_set=[TEST_POLICY_1], |
| 421 user_constrained_policy_set=[TEST_POLICY_1]), |
| 409 ], | 422 ], |
| 410 | 423 |
| 411 '4.8.12': [ # Different Policies Test12 | 424 '4.8.12': [ # Different Policies Test12 |
| 412 # Procedure: Validate Different Policies Test12 EE using the default | 425 # Procedure: Validate Different Policies Test12 EE using the default |
| 413 # settings or open and verify Signed Test Message 6.2.2.77 using the | 426 # settings or open and verify Signed Test Message 6.2.2.77 using the |
| 414 # default settings. | 427 # default settings. |
| 415 # | 428 # |
| 416 # Expected Result: The authorities-constrained-policy-set and the | 429 # Expected Result: The authorities-constrained-policy-set and the |
| 417 # user-constrained-policy-set will be empty. The explicit-policy-indicator | 430 # user-constrained-policy-set will be empty. The explicit-policy-indicator |
| 418 # will be set if the application can process the policyConstraints | 431 # will be set if the application can process the policyConstraints |
| 419 # extension. If the application can process the policyConstraints | 432 # extension. If the application can process the policyConstraints |
| 420 # extension, then the path should not validate successfully. If the | 433 # extension, then the path should not validate successfully. If the |
| 421 # application can not process the policyConstraints extension, then the | 434 # application can not process the policyConstraints extension, then the |
| 422 # path should validate successfully. | 435 # path should validate successfully. |
| 423 TestInfo(False), | 436 TestInfo(False, user_constrained_policy_set=[]), |
| 424 ], | 437 ], |
| 425 | 438 |
| 426 '4.8.13': [ # All Certificates Same Policies Test13 | 439 '4.8.13': [ # All Certificates Same Policies Test13 |
| 427 # 1. default settings, but with initial-policy-set = {NIST-test-policy-1}. | 440 # 1. default settings, but with initial-policy-set = {NIST-test-policy-1}. |
| 428 # The path should validate successfully. | 441 # The path should validate successfully. |
| 429 TestInfo(True, initial_policy_set=[TEST_POLICY_1]), | 442 TestInfo(True, initial_policy_set=[TEST_POLICY_1], |
| 443 user_constrained_policy_set=[TEST_POLICY_1]), |
| 430 | 444 |
| 431 # 2. default settings, but with initial-policy-set = {NIST-test-policy-2}. | 445 # 2. default settings, but with initial-policy-set = {NIST-test-policy-2}. |
| 432 # The path should validate successfully. | 446 # The path should validate successfully. |
| 433 TestInfo(True, initial_policy_set=[TEST_POLICY_2]), | 447 TestInfo(True, initial_policy_set=[TEST_POLICY_2], |
| 448 user_constrained_policy_set=[TEST_POLICY_2]), |
| 434 | 449 |
| 435 # 3. default settings, but with initial-policy-set = {NIST-test-policy-3}. | 450 # 3. default settings, but with initial-policy-set = {NIST-test-policy-3}. |
| 436 # The path should validate successfully. | 451 # The path should validate successfully. |
| 437 TestInfo(True, initial_policy_set=[TEST_POLICY_3]), | 452 TestInfo(True, initial_policy_set=[TEST_POLICY_3], |
| 453 user_constrained_policy_set=[TEST_POLICY_3]), |
| 438 ], | 454 ], |
| 439 | 455 |
| 440 '4.8.14': [ # AnyPolicy Test14 | 456 '4.8.14': [ # AnyPolicy Test14 |
| 441 # 1. default settings, but with initial-policy-set = {NIST-test-policy-1}. | 457 # 1. default settings, but with initial-policy-set = {NIST-test-policy-1}. |
| 442 # The path should validate successfully. | 458 # The path should validate successfully. |
| 443 TestInfo(True, initial_policy_set=[TEST_POLICY_1]), | 459 TestInfo(True, initial_policy_set=[TEST_POLICY_1], |
| 460 user_constrained_policy_set=[TEST_POLICY_1]), |
| 444 | 461 |
| 445 # 2. default settings, but with initial-policy-set = {NIST-test-policy-2}. | 462 # 2. default settings, but with initial-policy-set = {NIST-test-policy-2}. |
| 446 # The path should not validate successfully. | 463 # The path should not validate successfully. |
| 447 TestInfo(False, initial_policy_set=[TEST_POLICY_2]), | 464 TestInfo(False, initial_policy_set=[TEST_POLICY_2], |
| 465 user_constrained_policy_set=[]), |
| 448 ], | 466 ], |
| 449 | 467 |
| 450 '4.8.15': [ # User Notice Qualifier Test15 | 468 '4.8.15': [ # User Notice Qualifier Test15 |
| 451 # Procedure: Validate User Notice Qualifier Test15 EE using the default | 469 # Procedure: Validate User Notice Qualifier Test15 EE using the default |
| 452 # settings or open and verify Signed Test Message 6.2.2.80 using the | 470 # settings or open and verify Signed Test Message 6.2.2.80 using the |
| 453 # default settings. | 471 # default settings. |
| 454 # | 472 # |
| 455 # Expected Result: The authorities-constrained-policy-set will be | 473 # Expected Result: The authorities-constrained-policy-set will be |
| 456 # {NIST-test-policy-1} and the explicit-policy-indicator will be the same | 474 # {NIST-test-policy-1} and the explicit-policy-indicator will be the same |
| 457 # as the initial-explicit-policy indicator. If the initial-policy-set is | 475 # as the initial-explicit-policy indicator. If the initial-policy-set is |
| 458 # any-policy or otherwise includes NIST-test-policy-1, then the | 476 # any-policy or otherwise includes NIST-test-policy-1, then the |
| 459 # user-constrained-policy-set will be {NIST-test-policy-1}. If not, the | 477 # user-constrained-policy-set will be {NIST-test-policy-1}. If not, the |
| 460 # user-constrained-policy-set will be empty. If the initial-explicit-policy | 478 # user-constrained-policy-set will be empty. If the initial-explicit-policy |
| 461 # indicator is set and the initial-policy-set does not include | 479 # indicator is set and the initial-policy-set does not include |
| 462 # NIST-test-policy-1, then the path should be rejected, otherwise it should | 480 # NIST-test-policy-1, then the path should be rejected, otherwise it should |
| 463 # validate successfully. If the path validates successfully, then the | 481 # validate successfully. If the path validates successfully, then the |
| 464 # application should display the user notice. | 482 # application should display the user notice. |
| 465 TestInfo(True), | 483 TestInfo(True, user_constrained_policy_set=[TEST_POLICY_1]), |
| 466 ], | 484 ], |
| 467 | 485 |
| 468 '4.8.16': [ # User Notice Qualifier Test16 | 486 '4.8.16': [ # User Notice Qualifier Test16 |
| 469 # Procedure: Validate User Notice Qualifier Test16 EE using the default | 487 # Procedure: Validate User Notice Qualifier Test16 EE using the default |
| 470 # settings or open and verify Signed Test Message 6.2.2.81 using the | 488 # settings or open and verify Signed Test Message 6.2.2.81 using the |
| 471 # default settings. | 489 # default settings. |
| 472 # | 490 # |
| 473 # Expected Result: The authorities-constrained-policy-set will be | 491 # Expected Result: The authorities-constrained-policy-set will be |
| 474 # {NIST-test-policy-1} and the explicit-policy-indicator will be the same | 492 # {NIST-test-policy-1} and the explicit-policy-indicator will be the same |
| 475 # as the initial-explicit-policy indicator. If the initial-policy-set is | 493 # as the initial-explicit-policy indicator. If the initial-policy-set is |
| 476 # any-policy or otherwise includes NIST-test-policy-1, then the | 494 # any-policy or otherwise includes NIST-test-policy-1, then the |
| 477 # user-constrained-policy-set will be {NIST-test-policy-1}. If not, the | 495 # user-constrained-policy-set will be {NIST-test-policy-1}. If not, the |
| 478 # user-constrained-policy-set will be empty. If the initial-explicit-policy | 496 # user-constrained-policy-set will be empty. If the initial-explicit-policy |
| 479 # indicator is set and the initial-policy-set does not include | 497 # indicator is set and the initial-policy-set does not include |
| 480 # NIST-test-policy-1, then the path should be rejected, otherwise it should | 498 # NIST-test-policy-1, then the path should be rejected, otherwise it should |
| 481 # validate successfully. If the path validates successfully, then the | 499 # validate successfully. If the path validates successfully, then the |
| 482 # application should display the user notice associated with | 500 # application should display the user notice associated with |
| 483 # NIST-test-policy-1. The user notice associated with NIST-test-policy-2 | 501 # NIST-test-policy-1. The user notice associated with NIST-test-policy-2 |
| 484 # should not be displayed. | 502 # should not be displayed. |
| 485 TestInfo(True), | 503 TestInfo(True, user_constrained_policy_set=[TEST_POLICY_1]), |
| 486 ], | 504 ], |
| 487 | 505 |
| 488 '4.8.17': [ # User Notice Qualifier Test17 | 506 '4.8.17': [ # User Notice Qualifier Test17 |
| 489 # Procedure: Validate User Notice Qualifier Test17 EE using the default | 507 # Procedure: Validate User Notice Qualifier Test17 EE using the default |
| 490 # settings or open and verify Signed Test Message 6.2.2.82 using the | 508 # settings or open and verify Signed Test Message 6.2.2.82 using the |
| 491 # default settings. | 509 # default settings. |
| 492 # | 510 # |
| 493 # Expected Result: The authorities-constrained-policy-set will be | 511 # Expected Result: The authorities-constrained-policy-set will be |
| 494 # {NIST-test-policy-1} and the explicit-policy-indicator will be the same | 512 # {NIST-test-policy-1} and the explicit-policy-indicator will be the same |
| 495 # as the initial-explicit-policy indicator. If the initial-policy-set is | 513 # as the initial-explicit-policy indicator. If the initial-policy-set is |
| 496 # any-policy or otherwise includes NIST-test-policy-1, then the | 514 # any-policy or otherwise includes NIST-test-policy-1, then the |
| 497 # user-constrained-policy-set will be {NIST-test-policy-1}. If not, the | 515 # user-constrained-policy-set will be {NIST-test-policy-1}. If not, the |
| 498 # user-constrained-policy-set will be empty. If the initial-explicit-policy | 516 # user-constrained-policy-set will be empty. If the initial-explicit-policy |
| 499 # indicator is set and the initial-policy-set does not include | 517 # indicator is set and the initial-policy-set does not include |
| 500 # NIST-test-policy-1, then the path should be rejected, otherwise it should | 518 # NIST-test-policy-1, then the path should be rejected, otherwise it should |
| 501 # validate successfully. If the path validates successfully, then the | 519 # validate successfully. If the path validates successfully, then the |
| 502 # application should display the user notice associated with anyPolicy. | 520 # application should display the user notice associated with anyPolicy. |
| 503 TestInfo(True), | 521 TestInfo(True, user_constrained_policy_set=[TEST_POLICY_1]), |
| 504 ], | 522 ], |
| 505 | 523 |
| 506 '4.8.18': [ # User Notice Qualifier Test18 | 524 '4.8.18': [ # User Notice Qualifier Test18 |
| 507 # 1. default settings, but with initial-policy-set = {NIST-test-policy-1}. | 525 # 1. default settings, but with initial-policy-set = {NIST-test-policy-1}. |
| 508 # The path should validate successfully and the qualifier associated with | 526 # The path should validate successfully and the qualifier associated with |
| 509 # NIST-test-policy-1 in the end entity certificate should be displayed. | 527 # NIST-test-policy-1 in the end entity certificate should be displayed. |
| 510 TestInfo(True, initial_policy_set=[TEST_POLICY_1]), | 528 TestInfo(True, initial_policy_set=[TEST_POLICY_1], |
| 529 user_constrained_policy_set=[TEST_POLICY_1]), |
| 511 | 530 |
| 512 # 2. default settings, but with initial-policy-set = {NIST-test-policy-2}. | 531 # 2. default settings, but with initial-policy-set = {NIST-test-policy-2}. |
| 513 # The path should validate successfully and the qualifier associated with | 532 # The path should validate successfully and the qualifier associated with |
| 514 # anyPolicy in the end entity certificate should be displayed. | 533 # anyPolicy in the end entity certificate should be displayed. |
| 515 TestInfo(True, initial_policy_set=[TEST_POLICY_2]), | 534 TestInfo(True, initial_policy_set=[TEST_POLICY_2], |
| 535 user_constrained_policy_set=[TEST_POLICY_2]), |
| 516 ], | 536 ], |
| 517 | 537 |
| 518 '4.8.19': [ # User Notice Qualifier Test19 | 538 '4.8.19': [ # User Notice Qualifier Test19 |
| 519 # Procedure: Validate User Notice Qualifier Test19 EE using the default | 539 # Procedure: Validate User Notice Qualifier Test19 EE using the default |
| 520 # settings or open and verify Signed Test Message 6.2.2.84 using the | 540 # settings or open and verify Signed Test Message 6.2.2.84 using the |
| 521 # default settings. | 541 # default settings. |
| 522 # | 542 # |
| 523 # Expected Result: The authorities-constrained-policy-set will be | 543 # Expected Result: The authorities-constrained-policy-set will be |
| 524 # {NIST-test-policy-1} and the explicit-policy-indicator will be the same | 544 # {NIST-test-policy-1} and the explicit-policy-indicator will be the same |
| 525 # as the initial-explicit-policy indicator. If the initial-policy-set is | 545 # as the initial-explicit-policy indicator. If the initial-policy-set is |
| 526 # any-policy or otherwise includes NIST-test-policy-1, then the | 546 # any-policy or otherwise includes NIST-test-policy-1, then the |
| 527 # user-constrained-policy-set will be {NIST-test-policy-1}. If not, the | 547 # user-constrained-policy-set will be {NIST-test-policy-1}. If not, the |
| 528 # user-constrained-policy-set will be empty. If the initial-explicit-policy | 548 # user-constrained-policy-set will be empty. If the initial-explicit-policy |
| 529 # indicator is set and the initial-policy-set does not include | 549 # indicator is set and the initial-policy-set does not include |
| 530 # NIST-test-policy-1, then the path should be rejected, otherwise it should | 550 # NIST-test-policy-1, then the path should be rejected, otherwise it should |
| 531 # validate successfully. Since the explicitText exceeds the maximum size | 551 # validate successfully. Since the explicitText exceeds the maximum size |
| 532 # of 200 characters, the application may choose to reject the certificate. | 552 # of 200 characters, the application may choose to reject the certificate. |
| 533 # If the application accepts the certificate, display of the user notice is | 553 # If the application accepts the certificate, display of the user notice is |
| 534 # optional. | 554 # optional. |
| 535 TestInfo(True), | 555 TestInfo(True, user_constrained_policy_set=[TEST_POLICY_1]), |
| 536 ], | 556 ], |
| 537 | 557 |
| 538 '4.8.20': [ # CPS Pointer Qualifier Test20 | 558 '4.8.20': [ # CPS Pointer Qualifier Test20 |
| 539 # Procedure: Validate CPS Pointer Qualifier Test20 EE using the default | 559 # Procedure: Validate CPS Pointer Qualifier Test20 EE using the default |
| 540 # settings or open and verify Signed Test Message 6.2.2.85 using the | 560 # settings or open and verify Signed Test Message 6.2.2.85 using the |
| 541 # default settings. (If possible, it is recommended that this test be run | 561 # default settings. (If possible, it is recommended that this test be run |
| 542 # with the initial-explicit-policy indicator set. If this can not be done, | 562 # with the initial-explicit-policy indicator set. If this can not be done, |
| 543 # manually check that the authorities-constrained-policy-set and | 563 # manually check that the authorities-constrained-policy-set and |
| 544 # user-constrained-policy-set are correct.) | 564 # user-constrained-policy-set are correct.) |
| 545 # | 565 # |
| 546 # Expected Result: The authorities-constrained-policy-set will be | 566 # Expected Result: The authorities-constrained-policy-set will be |
| 547 # {NIST-test-policy-1} and the explicit-policy-indicator will be the same | 567 # {NIST-test-policy-1} and the explicit-policy-indicator will be the same |
| 548 # as the initial-explicit-policy indicator. If the initial-policy-set is | 568 # as the initial-explicit-policy indicator. If the initial-policy-set is |
| 549 # any-policy or otherwise includes NIST-test-policy-1, then the | 569 # any-policy or otherwise includes NIST-test-policy-1, then the |
| 550 # user-constrained-policy-set will be {NIST-test-policy-1}. If not, the | 570 # user-constrained-policy-set will be {NIST-test-policy-1}. If not, the |
| 551 # user-constrained-policy-set will be empty. If the initial-explicit-policy | 571 # user-constrained-policy-set will be empty. If the initial-explicit-policy |
| 552 # indicator is set and the initial-policy-set does not include | 572 # indicator is set and the initial-policy-set does not include |
| 553 # NIST-test-policy-1, then the path should be rejected, otherwise it should | 573 # NIST-test-policy-1, then the path should be rejected, otherwise it should |
| 554 # validate successfully. The CPS pointer in the qualifier should be | 574 # validate successfully. The CPS pointer in the qualifier should be |
| 555 # associated with NIST-testpolicy-1 in the | 575 # associated with NIST-testpolicy-1 in the |
| 556 # authorities-constrained-policy-set (and in the user-constrained-policy-set | 576 # authorities-constrained-policy-set (and in the user-constrained-policy-set |
| 557 # if NIST-test-policy-1 is in that set). There are no processing | 577 # if NIST-test-policy-1 is in that set). There are no processing |
| 558 # requirements associated with the CPS pointer qualifier. | 578 # requirements associated with the CPS pointer qualifier. |
| 559 TestInfo(True, initial_explicit_policy=True, | 579 TestInfo(True, initial_explicit_policy=True, |
| 560 initial_policy_set=[TEST_POLICY_1]), | 580 initial_policy_set=[TEST_POLICY_1], |
| 581 user_constrained_policy_set=[TEST_POLICY_1]), |
| 582 ], |
| 583 |
| 584 '4.9.1': [ # Valid RequireExplicitPolicy Test1 |
| 585 # Procedure: Validate Valid requireExplicitPolicy Test1 EE using the |
| 586 # default settings or open and verify Signed Test Message 6.2.2.86 using |
| 587 # the default settings. |
| 588 # |
| 589 # Expected Result: The path should validate successfully since the |
| 590 # explicit-policy-indicator is not set. |
| 591 TestInfo(True, user_constrained_policy_set=[]), |
| 592 ], |
| 593 |
| 594 '4.9.2': [ # Valid RequireExplicitPolicy Test2 |
| 595 # Procedure: Validate Valid requireExplicitPolicy Test2 EE using the |
| 596 # default settings or open and verify Signed Test Message 6.2.2.87 using |
| 597 # the default settings. |
| 598 # |
| 599 # Expected Result: The path should validate successfully since the |
| 600 # explicit-policy-indicator is not set |
| 601 TestInfo(True, user_constrained_policy_set=[]), |
| 602 ], |
| 603 |
| 604 '4.9.6': [ # Valid Self-Issued requireExplicitPolicy Test6 |
| 605 # Procedure: Validate Valid Self-Issued requireExplicitPolicy Test6 EE using |
| 606 # the default settings or open and verify Signed Test Message 6.2.2.91 using |
| 607 # the default settings. |
| 608 # |
| 609 # Expected Result: The path should validate successfully since the |
| 610 # explicit-policy-indicator is not set. |
| 611 TestInfo(True, user_constrained_policy_set=[]), |
| 561 ], | 612 ], |
| 562 | 613 |
| 563 '4.10.1': [ # Valid Policy Mapping Test1 | 614 '4.10.1': [ # Valid Policy Mapping Test1 |
| 564 # 1. default settings, but with initial-policy-set = {NIST-test-policy-1}. | 615 # 1. default settings, but with initial-policy-set = {NIST-test-policy-1}. |
| 565 # The path should validate successfully. | 616 # The path should validate successfully. |
| 566 TestInfo(True, initial_policy_set=[TEST_POLICY_1]), | 617 TestInfo(True, initial_policy_set=[TEST_POLICY_1], |
| 618 user_constrained_policy_set=[TEST_POLICY_1]), |
| 567 | 619 |
| 568 # 2. default settings, but with initial-policy-set = {NIST-test-policy-2}. | 620 # 2. default settings, but with initial-policy-set = {NIST-test-policy-2}. |
| 569 # The path should not validate successfully. | 621 # The path should not validate successfully. |
| 570 TestInfo(False, initial_policy_set=[TEST_POLICY_2]), | 622 TestInfo(False, initial_policy_set=[TEST_POLICY_2], |
| 623 user_constrained_policy_set=[]), |
| 571 | 624 |
| 572 # 3. default settings, but with initial-policy-mapping-inhibit set. The | 625 # 3. default settings, but with initial-policy-mapping-inhibit set. The |
| 573 # path should not validate successfully. | 626 # path should not validate successfully. |
| 574 TestInfo(False, initial_policy_mapping_inhibit=True), | 627 TestInfo(False, initial_policy_mapping_inhibit=True, |
| 628 user_constrained_policy_set=[]), |
| 575 ], | 629 ], |
| 576 | 630 |
| 577 '4.10.2': [ # Invalid Policy Mapping Test2 | 631 '4.10.2': [ # Invalid Policy Mapping Test2 |
| 578 # 1. default settings. The path should not validate successfully. | 632 # 1. default settings. The path should not validate successfully. |
| 579 TestInfo(False), | 633 TestInfo(False, user_constrained_policy_set=[]), |
| 580 | 634 |
| 581 # 2. default settings, but with initial-policy-mapping-inhibit set. The | 635 # 2. default settings, but with initial-policy-mapping-inhibit set. The |
| 582 # path should not validate successfully. | 636 # path should not validate successfully. |
| 583 TestInfo(False, initial_policy_mapping_inhibit=True), | 637 TestInfo(False, initial_policy_mapping_inhibit=True, |
| 638 user_constrained_policy_set=[]), |
| 584 ], | 639 ], |
| 585 | 640 |
| 586 '4.10.3': [ # Valid Policy Mapping Test3 | 641 '4.10.3': [ # Valid Policy Mapping Test3 |
| 587 # 1. default settings, but with initial-policy-set = {NIST-test-policy-1}. | 642 # 1. default settings, but with initial-policy-set = {NIST-test-policy-1}. |
| 588 # The path should not validate successfully. | 643 # The path should not validate successfully. |
| 589 TestInfo(False, initial_policy_set=[TEST_POLICY_1]), | 644 TestInfo(False, initial_policy_set=[TEST_POLICY_1], |
| 645 user_constrained_policy_set=[]), |
| 590 | 646 |
| 591 # 2. default settings, but with initial-policy-set = {NIST-test-policy-2}. | 647 # 2. default settings, but with initial-policy-set = {NIST-test-policy-2}. |
| 592 # The path should validate successfully. | 648 # The path should validate successfully. |
| 593 TestInfo(True, initial_policy_set=[TEST_POLICY_2]), | 649 TestInfo(True, initial_policy_set=[TEST_POLICY_2], |
| 650 user_constrained_policy_set=[TEST_POLICY_2]), |
| 594 ], | 651 ], |
| 595 | 652 |
| 596 '4.10.4': [ # Invalid Policy Mapping Test4 | 653 '4.10.4': [ # Invalid Policy Mapping Test4 |
| 597 # Procedure: Validate Invalid Policy Mapping Test4 EE using the default | 654 # Procedure: Validate Invalid Policy Mapping Test4 EE using the default |
| 598 # settings or open and verify Signed Test Message 6.2.2.97 using the | 655 # settings or open and verify Signed Test Message 6.2.2.97 using the |
| 599 # default settings. | 656 # default settings. |
| 600 # | 657 # |
| 601 # Expected Result: The authorities-constrained-policy-set and the | 658 # Expected Result: The authorities-constrained-policy-set and the |
| 602 # user-constrained-policy-set will be empty and the | 659 # user-constrained-policy-set will be empty and the |
| 603 # explicit-policy-indicator will be set (if the application can process the | 660 # explicit-policy-indicator will be set (if the application can process the |
| 604 # policyConstraints extension). If the application can process the | 661 # policyConstraints extension). If the application can process the |
| 605 # policyConstraints extension, then the path should be rejected, otherwise | 662 # policyConstraints extension, then the path should be rejected, otherwise |
| 606 # it should validate successfully. | 663 # it should validate successfully. |
| 607 TestInfo(False), | 664 TestInfo(False, user_constrained_policy_set=[]), |
| 608 ], | 665 ], |
| 609 | 666 |
| 610 '4.10.5': [ # Valid Policy Mapping Test5 | 667 '4.10.5': [ # Valid Policy Mapping Test5 |
| 611 # 1. default settings, but with initial-policy-set = {NIST-test-policy-1}. | 668 # 1. default settings, but with initial-policy-set = {NIST-test-policy-1}. |
| 612 # The path should validate successfully. | 669 # The path should validate successfully. |
| 613 TestInfo(True, initial_policy_set=[TEST_POLICY_1]), | 670 TestInfo(True, initial_policy_set=[TEST_POLICY_1], |
| 671 user_constrained_policy_set=[TEST_POLICY_1]), |
| 614 | 672 |
| 615 # 2. default settings, but with initial-policy-set = {NIST-test-policy-6}. | 673 # 2. default settings, but with initial-policy-set = {NIST-test-policy-6}. |
| 616 # The path should not validate successfully. | 674 # The path should not validate successfully. |
| 617 TestInfo(False, initial_policy_set=[TEST_POLICY_6]), | 675 TestInfo(False, initial_policy_set=[TEST_POLICY_6], |
| 676 user_constrained_policy_set=[]), |
| 618 ], | 677 ], |
| 619 | 678 |
| 620 '4.10.6': [ # Valid Policy Mapping Test6 | 679 '4.10.6': [ # Valid Policy Mapping Test6 |
| 621 # 1. default settings, but with initial-policy-set = {NIST-test-policy-1}. | 680 # 1. default settings, but with initial-policy-set = {NIST-test-policy-1}. |
| 622 # The path should validate successfully. | 681 # The path should validate successfully. |
| 623 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]), |
| 624 | 684 |
| 625 # 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}. |
| 626 # The path should not validate successfully. | 686 # The path should not validate successfully. |
| 627 TestInfo(False, initial_policy_set=[TEST_POLICY_6]), | 687 TestInfo(False, initial_policy_set=[TEST_POLICY_6], |
| 688 user_constrained_policy_set=[]), |
| 689 ], |
| 690 |
| 691 '4.10.8': [ # Invalid Mapping To anyPolicy Test8 |
| 692 # 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 |
| 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 subjectDomainPolicy. |
| 699 # |
| 700 # TODO(eroman): What should user_constrained_policy_set be? |
| 701 TestInfo(False, user_constrained_policy_set=[]), |
| 628 ], | 702 ], |
| 629 | 703 |
| 630 '4.10.9': [ # Valid Policy Mapping Test9 | 704 '4.10.9': [ # Valid Policy Mapping Test9 |
| 631 # Procedure: Validate Valid Policy Mapping Test9 EE using the default | 705 # Procedure: Validate Valid Policy Mapping Test9 EE using the default |
| 632 # settings or open and verify Signed Test Message 6.2.2.102 using the | 706 # settings or open and verify Signed Test Message 6.2.2.102 using the |
| 633 # default settings. | 707 # default settings. |
| 634 # | 708 # |
| 635 # Expected Result: The authorities-constrained-policy-set will be | 709 # Expected Result: The authorities-constrained-policy-set will be |
| 636 # {NIST-test-policy-1} and the explicit-policy-indicator will be set (if | 710 # {NIST-test-policy-1} and the explicit-policy-indicator will be set (if |
| 637 # the application can process the policyConstraints extension). If the | 711 # the application can process the policyConstraints extension). If the |
| (...skipping 10 matching lines...) Expand all Loading... |
| 648 # Procedure: Validate Invalid Policy Mapping Test10 EE using the default | 722 # Procedure: Validate Invalid Policy Mapping Test10 EE using the default |
| 649 # settings or open and verify Signed Test Message 6.2.2.103 using the | 723 # settings or open and verify Signed Test Message 6.2.2.103 using the |
| 650 # default settings. | 724 # default settings. |
| 651 # | 725 # |
| 652 # Expected Result: The authorities-constrained-policy-set and the | 726 # Expected Result: The authorities-constrained-policy-set and the |
| 653 # user-constrained-policy-set will be empty and the | 727 # user-constrained-policy-set will be empty and the |
| 654 # explicit-policy-indicator will be set (if the application can process the | 728 # explicit-policy-indicator will be set (if the application can process the |
| 655 # policyConstraints extension). If the application can process the | 729 # policyConstraints extension). If the application can process the |
| 656 # policyConstraints extension, then the path should be rejected, otherwise | 730 # policyConstraints extension, then the path should be rejected, otherwise |
| 657 # it should validate successfully. | 731 # it should validate successfully. |
| 658 TestInfo(False), | 732 TestInfo(False, user_constrained_policy_set=[]), |
| 659 ], | 733 ], |
| 660 | 734 |
| 661 '4.10.11': [ # Valid Policy Mapping Test11 | 735 '4.10.11': [ # Valid Policy Mapping Test11 |
| 662 # Procedure: Validate Valid Policy Mapping Test11 EE using the default | 736 # Procedure: Validate Valid Policy Mapping Test11 EE using the default |
| 663 # settings or open and verify Signed Test Message 6.2.2.104 using the | 737 # settings or open and verify Signed Test Message 6.2.2.104 using the |
| 664 # default settings. | 738 # default settings. |
| 665 # | 739 # |
| 666 # Expected Result: The authorities-constrained-policy-set will be | 740 # Expected Result: The authorities-constrained-policy-set will be |
| 667 # {NIST-test-policy-1} and the explicit-policy-indicator will be set (if | 741 # {NIST-test-policy-1} and the explicit-policy-indicator will be set (if |
| 668 # the application can process the policyConstraints extension). If the | 742 # the application can process the policyConstraints extension). If the |
| 669 # initial-policy-set is any-policy or otherwise includes | 743 # initial-policy-set is any-policy or otherwise includes |
| 670 # NIST-test-policy-1, then the user-constrained-policy-set will be | 744 # NIST-test-policy-1, then the user-constrained-policy-set will be |
| 671 # {NIST-test-policy-1}. If not, the user-constrained-policy-set will be | 745 # {NIST-test-policy-1}. If not, the user-constrained-policy-set will be |
| 672 # empty. If the initial-policy-set does not include NIST-test-policy-1 (and | 746 # empty. If the initial-policy-set does not include NIST-test-policy-1 (and |
| 673 # the application can process the policyConstraints extension), then the | 747 # the application can process the policyConstraints extension), then the |
| 674 # path should be rejected, otherwise it should validate successfully. | 748 # path should be rejected, otherwise it should validate successfully. |
| 675 TestInfo(True), | 749 TestInfo(True, user_constrained_policy_set=[TEST_POLICY_1]), |
| 676 ], | 750 ], |
| 677 | 751 |
| 678 '4.10.12': [ # Valid Policy Mapping Test12 | 752 '4.10.12': [ # Valid Policy Mapping Test12 |
| 679 # 1. default settings, but with initial-policy-set = {NIST-test-policy-1}. | 753 # 1. default settings, but with initial-policy-set = {NIST-test-policy-1}. |
| 680 # The path should validate successfully and the application should display | 754 # The path should validate successfully and the application should display |
| 681 # the user notice associated with NIST-test-policy-3 in the end entity | 755 # the user notice associated with NIST-test-policy-3 in the end entity |
| 682 # certificate. | 756 # certificate. |
| 683 TestInfo(True, initial_policy_set=[TEST_POLICY_1]), | 757 TestInfo(True, initial_policy_set=[TEST_POLICY_1], |
| 758 user_constrained_policy_set=[TEST_POLICY_1]), |
| 684 | 759 |
| 685 # 2. default settings, but with initial-policy-set = {NIST-test-policy-2}. | 760 # 2. default settings, but with initial-policy-set = {NIST-test-policy-2}. |
| 686 # The path should validate successfully and the application should display | 761 # The path should validate successfully and the application should display |
| 687 # the user notice associated with anyPolicy in the end entity certificate. | 762 # the user notice associated with anyPolicy in the end entity certificate. |
| 688 TestInfo(True, initial_policy_set=[TEST_POLICY_2]), | 763 TestInfo(True, initial_policy_set=[TEST_POLICY_2], |
| 764 user_constrained_policy_set=[TEST_POLICY_2]), |
| 689 ], | 765 ], |
| 690 | 766 |
| 691 '4.10.13': [ # Valid Policy Mapping Test13 | 767 '4.10.13': [ # Valid Policy Mapping Test13 |
| 692 # Procedure: Validate Valid Policy Mapping Test13 EE using the default | 768 # Procedure: Validate Valid Policy Mapping Test13 EE using the default |
| 693 # settings or open and verify Signed Test Message 6.2.2.106 using the | 769 # settings or open and verify Signed Test Message 6.2.2.106 using the |
| 694 # default settings. | 770 # default settings. |
| 695 # | 771 # |
| 696 # Expected Result: The authorities-constrained-policy-set will be | 772 # Expected Result: The authorities-constrained-policy-set will be |
| 697 # {NIST-test-policy-1} and the explicit-policy-indicator will be set (if | 773 # {NIST-test-policy-1} and the explicit-policy-indicator will be set (if |
| 698 # the application can process the policyConstraints extension). If the | 774 # the application can process the policyConstraints extension). If the |
| 699 # initial-policy-set is any-policy or otherwise includes | 775 # initial-policy-set is any-policy or otherwise includes |
| 700 # NIST-test-policy-1, then the user-constrained-policy-set will be | 776 # NIST-test-policy-1, then the user-constrained-policy-set will be |
| 701 # {NIST-test-policy-1}. If not, the user-constrained-policy-set will be | 777 # {NIST-test-policy-1}. If not, the user-constrained-policy-set will be |
| 702 # empty. If the initial-policy-set does not include NIST-test-policy-1 (and | 778 # empty. If the initial-policy-set does not include NIST-test-policy-1 (and |
| 703 # the application can process the policyConstraints extension), then the | 779 # the application can process the policyConstraints extension), then the |
| 704 # path should be rejected, otherwise it should validate successfully. If | 780 # path should be rejected, otherwise it should validate successfully. If |
| 705 # the path is accepted, the application should display the user notice | 781 # the path is accepted, the application should display the user notice |
| 706 # associated with NIST-testpolicy-1 in the intermediate certificate. | 782 # associated with NIST-testpolicy-1 in the intermediate certificate. |
| 707 TestInfo(True), | 783 TestInfo(True, user_constrained_policy_set=[TEST_POLICY_1]), |
| 708 ], | 784 ], |
| 709 | 785 |
| 710 '4.10.14': [ # Valid Policy Mapping Test14 | 786 '4.10.14': [ # Valid Policy Mapping Test14 |
| 711 # Procedure: Validate Valid Policy Mapping Test14 EE using the default | 787 # Procedure: Validate Valid Policy Mapping Test14 EE using the default |
| 712 # settings or open and verify Signed Test Message 6.2.2.107 using the | 788 # settings or open and verify Signed Test Message 6.2.2.107 using the |
| 713 # default settings. | 789 # default settings. |
| 714 # | 790 # |
| 715 # Expected Result: The authorities-constrained-policy-set will be | 791 # Expected Result: The authorities-constrained-policy-set will be |
| 716 # {NIST-test-policy-1} and the explicit-policy-indicator will be set (if | 792 # {NIST-test-policy-1} and the explicit-policy-indicator will be set (if |
| 717 # the application can process the policyConstraints extension). If the | 793 # the application can process the policyConstraints extension). If the |
| 718 # initial-policy-set is any-policy or otherwise includes | 794 # initial-policy-set is any-policy or otherwise includes |
| 719 # NIST-test-policy-1, then the user-constrained-policy-set will be | 795 # NIST-test-policy-1, then the user-constrained-policy-set will be |
| 720 # {NIST-test-policy-1}. If not, the user-constrained-policy-set will be | 796 # {NIST-test-policy-1}. If not, the user-constrained-policy-set will be |
| 721 # empty. If the initial-policy-set does not include NIST-test-policy-1 (and | 797 # empty. If the initial-policy-set does not include NIST-test-policy-1 (and |
| 722 # the application can process the policyConstraints extension), then the | 798 # the application can process the policyConstraints extension), then the |
| 723 # path should be rejected, otherwise it should validate successfully. If | 799 # path should be rejected, otherwise it should validate successfully. If |
| 724 # the path is accepted, the application should display the user notice | 800 # the path is accepted, the application should display the user notice |
| 725 # associated with anyPolicy in the intermediate certificate | 801 # associated with anyPolicy in the intermediate certificate |
| 726 TestInfo(True), | 802 TestInfo(True, user_constrained_policy_set=[TEST_POLICY_1]), |
| 727 ], | 803 ], |
| 728 | 804 |
| 729 '4.11.1': [ # Invalid inhibitPolicyMapping Test1 | 805 '4.11.1': [ # Invalid inhibitPolicyMapping Test1 |
| 730 # Procedure: Validate Invalid inhibitPolicyMapping Test1 EE using the | 806 # Procedure: Validate Invalid inhibitPolicyMapping Test1 EE using the |
| 731 # default settings or open and verify Signed Test Message 6.2.2.108 using | 807 # default settings or open and verify Signed Test Message 6.2.2.108 using |
| 732 # the default settings. | 808 # the default settings. |
| 733 # | 809 # |
| 734 # Expected Result: The authorities-constrained-policy-set and the | 810 # Expected Result: The authorities-constrained-policy-set and the |
| 735 # user-constrained-policy-set will be empty. The explicit-policy-indicator | 811 # user-constrained-policy-set will be empty. The explicit-policy-indicator |
| 736 # will be set. The path should not validate successfully. | 812 # will be set. The path should not validate successfully. |
| 737 TestInfo(False), | 813 TestInfo(False, user_constrained_policy_set=[]), |
| 738 ], | 814 ], |
| 739 | 815 |
| 740 '4.11.2': [ # Valid inhibitPolicyMapping Test2 | 816 '4.11.2': [ # Valid inhibitPolicyMapping Test2 |
| 741 # Procedure: Validate Valid inhibitPolicyMapping Test2 EE using the default | 817 # Procedure: Validate Valid inhibitPolicyMapping Test2 EE using the default |
| 742 # settings or open and verify Signed Test Message 6.2.2.109 using the | 818 # settings or open and verify Signed Test Message 6.2.2.109 using the |
| 743 # default settings. | 819 # default settings. |
| 744 # | 820 # |
| 745 # Expected Result: The authorities-constrained-policy-set will be | 821 # Expected Result: The authorities-constrained-policy-set will be |
| 746 # {NIST-test-policy-1} and the explicit-policy-indicator will be set. If | 822 # {NIST-test-policy-1} and the explicit-policy-indicator will be set. If |
| 747 # the initial-policy-set is any-policy or otherwise includes | 823 # the initial-policy-set is any-policy or otherwise includes |
| 748 # NIST-test-policy-1, then the path should validate successfully. | 824 # NIST-test-policy-1, then the path should validate successfully. |
| 749 TestInfo(True), | 825 TestInfo(True, user_constrained_policy_set=[TEST_POLICY_1]), |
| 750 ], | 826 ], |
| 751 | 827 |
| 752 '4.11.3': [ # Invalid inhibitPolicyMapping Test3 | 828 '4.11.3': [ # Invalid inhibitPolicyMapping Test3 |
| 753 # Procedure: Validate Invalid inhibitPolicyMapping Test3 EE using the | 829 # Procedure: Validate Invalid inhibitPolicyMapping Test3 EE using the |
| 754 # default settings or open and verify Signed Test Message 6.2.2.110 using | 830 # default settings or open and verify Signed Test Message 6.2.2.110 using |
| 755 # the default settings. | 831 # the default settings. |
| 756 # | 832 # |
| 757 # Expected Result: The authorities-constrained-policy-set and the | 833 # Expected Result: The authorities-constrained-policy-set and the |
| 758 # user-constrained-policy-set will be empty and the | 834 # user-constrained-policy-set will be empty and the |
| 759 # explicit-policy-indicator will be set. The path should not validate | 835 # explicit-policy-indicator will be set. The path should not validate |
| 760 # successfully. | 836 # successfully. |
| 761 TestInfo(False), | 837 TestInfo(False, user_constrained_policy_set=[]), |
| 762 ], | 838 ], |
| 763 | 839 |
| 764 '4.11.4': [ # Valid inhibitPolicyMapping Test4 | 840 '4.11.4': [ # Valid inhibitPolicyMapping Test4 |
| 765 # Procedure: Validate Valid inhibitPolicyMapping Test4 EE using the default | 841 # Procedure: Validate Valid inhibitPolicyMapping Test4 EE using the default |
| 766 # settings or open and verify Signed Test Message 6.2.2.111 using the | 842 # settings or open and verify Signed Test Message 6.2.2.111 using the |
| 767 # default settings. | 843 # default settings. |
| 768 # | 844 # |
| 769 # Expected Result: The authorities-constrained-policy-set will be | 845 # Expected Result: The authorities-constrained-policy-set will be |
| 770 # {NIST-test-policy-2} and the explicit-policy-indicator will be set. If | 846 # {NIST-test-policy-2} and the explicit-policy-indicator will be set. If |
| 771 # the initial-policy-set is any-policy or otherwise includes | 847 # the initial-policy-set is any-policy or otherwise includes |
| 772 # NIST-test-policy-2, then the path should validate successfully. | 848 # NIST-test-policy-2, then the path should validate successfully. |
| 773 TestInfo(True), | 849 TestInfo(True, user_constrained_policy_set=[TEST_POLICY_2]), |
| 774 ], | 850 ], |
| 775 | 851 |
| 776 '4.11.5': [ # Invalid inhibitPolicyMapping Test5 | 852 '4.11.5': [ # Invalid inhibitPolicyMapping Test5 |
| 777 # Procedure: Validate Invalid inhibitPolicyMapping Test5 EE using the | 853 # Procedure: Validate Invalid inhibitPolicyMapping Test5 EE using the |
| 778 # default settings or open and verify Signed Test Message 6.2.2.112 using | 854 # default settings or open and verify Signed Test Message 6.2.2.112 using |
| 779 # the default settings. | 855 # the default settings. |
| 780 # | 856 # |
| 781 # Expected Result: The authorities-constrained-policy-set and the | 857 # Expected Result: The authorities-constrained-policy-set and the |
| 782 # user-constrained-policy-set will be empty and the | 858 # user-constrained-policy-set will be empty and the |
| 783 # explicit-policy-indicator will be set. The path should not validate | 859 # explicit-policy-indicator will be set. The path should not validate |
| 784 # successfully. | 860 # successfully. |
| 785 TestInfo(False), | 861 TestInfo(False, user_constrained_policy_set=[]), |
| 786 ], | 862 ], |
| 787 | 863 |
| 788 '4.11.6': [ # Invalid inhibitPolicyMapping Test6 | 864 '4.11.6': [ # Invalid inhibitPolicyMapping Test6 |
| 789 # Procedure: Validate Invalid inhibitPolicyMapping Test6 EE using the | 865 # Procedure: Validate Invalid inhibitPolicyMapping Test6 EE using the |
| 790 # default settings or open and verify Signed Test Message 6.2.2.113 using | 866 # default settings or open and verify Signed Test Message 6.2.2.113 using |
| 791 # the default settings. | 867 # the default settings. |
| 792 # | 868 # |
| 793 # Expected Result: The authorities-constrained-policy-set and the | 869 # Expected Result: The authorities-constrained-policy-set and the |
| 794 # user-constrained-policy-set will be empty and the | 870 # user-constrained-policy-set will be empty and the |
| 795 # explicit-policy-indicator will be set. The path should not validate | 871 # explicit-policy-indicator will be set. The path should not validate |
| 796 # successfully. | 872 # successfully. |
| 797 TestInfo(False), | 873 TestInfo(False, user_constrained_policy_set=[]), |
| 798 ], | 874 ], |
| 799 | 875 |
| 800 '4.11.7': [ # Valid Self-Issued inhibitPolicyMapping Test7 | 876 '4.11.7': [ # Valid Self-Issued inhibitPolicyMapping Test7 |
| 801 # Procedure: Validate Valid Self-Issued inhibitPolicyMapping Test7 EE using | 877 # Procedure: Validate Valid Self-Issued inhibitPolicyMapping Test7 EE using |
| 802 # the default settings or open and verify Signed Test Message 6.2.2.114 | 878 # the default settings or open and verify Signed Test Message 6.2.2.114 |
| 803 # using the default settings. | 879 # using the default settings. |
| 804 # | 880 # |
| 805 # Expected Result: The authorities-constrained-policy-set will be | 881 # Expected Result: The authorities-constrained-policy-set will be |
| 806 # {NIST-test-policy-1} and the explicit-policy-indicator will be set. If | 882 # {NIST-test-policy-1} and the explicit-policy-indicator will be set. If |
| 807 # the initial-policy-set is any-policy or otherwise includes | 883 # the initial-policy-set is any-policy or otherwise includes |
| 808 # NIST-test-policy-1, then the path should validate successfully. | 884 # NIST-test-policy-1, then the path should validate successfully. |
| 809 TestInfo(True), | 885 TestInfo(True, user_constrained_policy_set=[TEST_POLICY_1]), |
| 810 ], | 886 ], |
| 811 | 887 |
| 812 '4.11.8': [ # Invalid Self-Issued inhibitPolicyMapping Test8 | 888 '4.11.8': [ # Invalid Self-Issued inhibitPolicyMapping Test8 |
| 813 # Procedure: Validate Invalid Self-Issued inhibitPolicyMapping Test8 EE | 889 # Procedure: Validate Invalid Self-Issued inhibitPolicyMapping Test8 EE |
| 814 # using the default settings or open and verify Signed Test Message | 890 # using the default settings or open and verify Signed Test Message |
| 815 # 6.2.2.115 using the default settings. | 891 # 6.2.2.115 using the default settings. |
| 816 # | 892 # |
| 817 # Expected Result: The authorities-constrained-policy-set and | 893 # Expected Result: The authorities-constrained-policy-set and |
| 818 # user-constrained-policy-set will be empty and the | 894 # user-constrained-policy-set will be empty and the |
| 819 # explicit-policy-indicator will be set. The path should not validate | 895 # explicit-policy-indicator will be set. The path should not validate |
| 820 # successfully. | 896 # successfully. |
| 821 TestInfo(False), | 897 TestInfo(False, user_constrained_policy_set=[]), |
| 822 ], | 898 ], |
| 823 | 899 |
| 824 '4.11.9': [ # Invalid Self-Issued inhibitPolicyMapping Test9 | 900 '4.11.9': [ # Invalid Self-Issued inhibitPolicyMapping Test9 |
| 825 # Procedure: Validate Invalid Self-Issued inhibitPolicyMapping Test9 EE | 901 # Procedure: Validate Invalid Self-Issued inhibitPolicyMapping Test9 EE |
| 826 # using the default settings or open and verify Signed Test Message | 902 # using the default settings or open and verify Signed Test Message |
| 827 # 6.2.2.116 using the default settings. | 903 # 6.2.2.116 using the default settings. |
| 828 # | 904 # |
| 829 # Expected Result: The authorities-constrained-policy-set and | 905 # Expected Result: The authorities-constrained-policy-set and |
| 830 # user-constrained-policy-set will be empty and the | 906 # user-constrained-policy-set will be empty and the |
| 831 # explicit-policy-indicator will be set. The path should not validate | 907 # explicit-policy-indicator will be set. The path should not validate |
| 832 # successfully. | 908 # successfully. |
| 833 TestInfo(False), | 909 TestInfo(False, user_constrained_policy_set=[]), |
| 834 ], | 910 ], |
| 835 | 911 |
| 836 '4.11.10': [ # Invalid Self-Issued inhibitPolicyMapping Test10 | 912 '4.11.10': [ # Invalid Self-Issued inhibitPolicyMapping Test10 |
| 837 # Procedure: Validate Invalid Self-Issued inhibitPolicyMapping Test10 EE | 913 # Procedure: Validate Invalid Self-Issued inhibitPolicyMapping Test10 EE |
| 838 # using the default settings or open and verify Signed Test Message | 914 # using the default settings or open and verify Signed Test Message |
| 839 # 6.2.2.117 using the default settings. | 915 # 6.2.2.117 using the default settings. |
| 840 # | 916 # |
| 841 # Expected Result: The authorities-constrained-policy-set and | 917 # Expected Result: The authorities-constrained-policy-set and |
| 842 # user-constrained-policy-set will be empty and the | 918 # user-constrained-policy-set will be empty and the |
| 843 # explicit-policy-indicator will be set. The path should not validate | 919 # explicit-policy-indicator will be set. The path should not validate |
| 844 # successfully. | 920 # successfully. |
| 845 TestInfo(False), | 921 TestInfo(False, user_constrained_policy_set=[]), |
| 846 ], | 922 ], |
| 847 | 923 |
| 848 '4.11.11': [ # Invalid Self-Issued inhibitPolicyMapping Test11 | 924 '4.11.11': [ # Invalid Self-Issued inhibitPolicyMapping Test11 |
| 849 # Procedure: Validate Invalid Self-Issued inhibitPolicyMapping Test11 EE | 925 # Procedure: Validate Invalid Self-Issued inhibitPolicyMapping Test11 EE |
| 850 # using the default settings or open and verify Signed Test Message | 926 # using the default settings or open and verify Signed Test Message |
| 851 # 6.2.2.118 using the default settings. | 927 # 6.2.2.118 using the default settings. |
| 852 # | 928 # |
| 853 # Expected Result: The authorities-constrained-policy-set and | 929 # Expected Result: The authorities-constrained-policy-set and |
| 854 # user-constrained-policy-set will be empty and the | 930 # user-constrained-policy-set will be empty and the |
| 855 # explicit-policy-indicator will be set. The path should not validate | 931 # explicit-policy-indicator will be set. The path should not validate |
| 856 # successfully. | 932 # successfully. |
| 857 TestInfo(False), | 933 TestInfo(False, user_constrained_policy_set=[]), |
| 858 ], | 934 ], |
| 859 | 935 |
| 860 '4.12.1': [ # Invalid inhibitAnyPolicy Test1 | 936 '4.12.1': [ # Invalid inhibitAnyPolicy Test1 |
| 861 # Procedure: Validate Invalid inhibitAnyPolicy Test1 EE using the default | 937 # Procedure: Validate Invalid inhibitAnyPolicy Test1 EE using the default |
| 862 # settings or open and verify Signed Test Message 6.2.2.119 using the | 938 # settings or open and verify Signed Test Message 6.2.2.119 using the |
| 863 # default settings. | 939 # default settings. |
| 864 # | 940 # |
| 865 # Expected Result: The authorities-constrained-policy-set and | 941 # Expected Result: The authorities-constrained-policy-set and |
| 866 # user-constrained-policy-set will be empty and the | 942 # user-constrained-policy-set will be empty and the |
| 867 # explicit-policy-indicator will be set (if the application can process the | 943 # explicit-policy-indicator will be set (if the application can process the |
| 868 # policyConstraints extension). If the application can process the | 944 # policyConstraints extension). If the application can process the |
| 869 # policyConstraints extension, then the path should not validate | 945 # policyConstraints extension, then the path should not validate |
| 870 # successfully. | 946 # successfully. |
| 871 TestInfo(False), | 947 TestInfo(False, user_constrained_policy_set=[]), |
| 872 ], | 948 ], |
| 873 | 949 |
| 874 '4.12.2': [ # Valid inhibitAnyPolicy Test2 | 950 '4.12.2': [ # Valid inhibitAnyPolicy Test2 |
| 875 # Procedure: Validate Valid inhibitAnyPolicy Test2 EE using the default | 951 # Procedure: Validate Valid inhibitAnyPolicy Test2 EE using the default |
| 876 # settings or open and verify Signed Test Message 6.2.2.120 using the | 952 # settings or open and verify Signed Test Message 6.2.2.120 using the |
| 877 # default settings. | 953 # default settings. |
| 878 # | 954 # |
| 879 # Expected Result: The authorities-constrained-policy-set will be | 955 # Expected Result: The authorities-constrained-policy-set will be |
| 880 # {NIST-test-policy-1} and the explicit-policy-indicator will be set (if | 956 # {NIST-test-policy-1} and the explicit-policy-indicator will be set (if |
| 881 # the application can process the policyConstraints extension). If the | 957 # the application can process the policyConstraints extension). If the |
| 882 # initial-policy-set is any-policy or otherwise includes | 958 # initial-policy-set is any-policy or otherwise includes |
| 883 # NIST-test-policy-1, then the user-constrained-policy-set will be | 959 # NIST-test-policy-1, then the user-constrained-policy-set will be |
| 884 # {NIST-test-policy-1} and the path should validate successfully. If not, | 960 # {NIST-test-policy-1} and the path should validate successfully. If not, |
| 885 # then the user-constrained-policy-set will be empty. If the | 961 # then the user-constrained-policy-set will be empty. If the |
| 886 # user-constrained-policy-set is empty and the application can process the | 962 # user-constrained-policy-set is empty and the application can process the |
| 887 # policyConstraints extension, then the path should not validate | 963 # policyConstraints extension, then the path should not validate |
| 888 # successfully. | 964 # successfully. |
| 889 | 965 TestInfo(True, user_constrained_policy_set=[TEST_POLICY_1]), |
| 890 TestInfo(True), | |
| 891 ], | 966 ], |
| 892 | 967 |
| 893 '4.12.3': [ # inhibitAnyPolicy Test3 | 968 '4.12.3': [ # inhibitAnyPolicy Test3 |
| 894 # 1. default settings. The path should validate successfully. | 969 # 1. default settings. The path should validate successfully. |
| 895 TestInfo(True), | 970 TestInfo(True, user_constrained_policy_set=[TEST_POLICY_1]), |
| 896 | 971 |
| 897 # 2. default settings, but with initial-inhibit-any-policy set. The path | 972 # 2. default settings, but with initial-inhibit-any-policy set. The path |
| 898 # should not validate successfully. | 973 # should not validate successfully. |
| 899 TestInfo(False, initial_inhibit_any_policy=True), | 974 TestInfo(False, initial_inhibit_any_policy=True, |
| 975 user_constrained_policy_set=[]), |
| 900 ], | 976 ], |
| 901 | 977 |
| 902 '4.12.4': [ # Invalid inhibitAnyPolicy Test4 | 978 '4.12.4': [ # Invalid inhibitAnyPolicy Test4 |
| 903 # Procedure: Validate Invalid inhibitAnyPolicy Test4 EE using the default | 979 # Procedure: Validate Invalid inhibitAnyPolicy Test4 EE using the default |
| 904 # settings or open and verify Signed Test Message 6.2.2.122 using the | 980 # settings or open and verify Signed Test Message 6.2.2.122 using the |
| 905 # default settings. | 981 # default settings. |
| 906 # | 982 # |
| 907 # Expected Result: The authorities-constrained-policy-set and | 983 # Expected Result: The authorities-constrained-policy-set and |
| 908 # user-constrained-policy-set will be empty and the | 984 # user-constrained-policy-set will be empty and the |
| 909 # explicit-policy-indicator will be set (if the application can process the | 985 # explicit-policy-indicator will be set (if the application can process the |
| 910 # policyConstraints extension). If the application can process the | 986 # policyConstraints extension). If the application can process the |
| 911 # policyConstraints extension, then the path should not validate | 987 # policyConstraints extension, then the path should not validate |
| 912 # successfully. | 988 # successfully. |
| 913 TestInfo(False), | 989 TestInfo(False, user_constrained_policy_set=[]), |
| 914 ], | 990 ], |
| 915 | 991 |
| 916 '4.12.5': [ # Invalid inhibitAnyPolicy Test5 | 992 '4.12.5': [ # Invalid inhibitAnyPolicy Test5 |
| 917 # Procedure: Validate Invalid inhibitAnyPolicy Test5 EE using the default | 993 # Procedure: Validate Invalid inhibitAnyPolicy Test5 EE using the default |
| 918 # settings or open and verify Signed Test Message 6.2.2.123 using the | 994 # settings or open and verify Signed Test Message 6.2.2.123 using the |
| 919 # default settings. | 995 # default settings. |
| 920 # | 996 # |
| 921 # Expected Result: The authorities-constrained-policy-set and | 997 # Expected Result: The authorities-constrained-policy-set and |
| 922 # user-constrained-policy-set will be empty and the | 998 # user-constrained-policy-set will be empty and the |
| 923 # explicit-policy-indicator will be set (if the application can process the | 999 # explicit-policy-indicator will be set (if the application can process the |
| 924 # policyConstraints extension). If the application can process the | 1000 # policyConstraints extension). If the application can process the |
| 925 # policyConstraints extension, then the path should not validate | 1001 # policyConstraints extension, then the path should not validate |
| 926 # successfully. | 1002 # successfully. |
| 927 TestInfo(False), | 1003 TestInfo(False, user_constrained_policy_set=[]), |
| 928 ], | 1004 ], |
| 929 | 1005 |
| 930 '4.12.6': [ # Invalid inhibitAnyPolicy Test6 | 1006 '4.12.6': [ # Invalid inhibitAnyPolicy Test6 |
| 931 # Procedure: Validate Invalid inhibitAnyPolicy Test6 EE using the default | 1007 # Procedure: Validate Invalid inhibitAnyPolicy Test6 EE using the default |
| 932 # settings or open and verify Signed Test Message 6.2.2.124 using the | 1008 # settings or open and verify Signed Test Message 6.2.2.124 using the |
| 933 # default settings. | 1009 # default settings. |
| 934 # | 1010 # |
| 935 # Expected Result: The authorities-constrained-policy-set and | 1011 # Expected Result: The authorities-constrained-policy-set and |
| 936 # user-constrained-policy-set will be empty and the | 1012 # user-constrained-policy-set will be empty and the |
| 937 # explicit-policy-indicator will be set (if the application can process the | 1013 # explicit-policy-indicator will be set (if the application can process the |
| 938 # policyConstraints extension). If the application can process the | 1014 # policyConstraints extension). If the application can process the |
| 939 # policyConstraints extension, then the path should not validate | 1015 # policyConstraints extension, then the path should not validate |
| 940 # successfully. | 1016 # successfully. |
| 941 TestInfo(False), | 1017 TestInfo(False, user_constrained_policy_set=[]), |
| 942 ], | 1018 ], |
| 943 | 1019 |
| 944 '4.12.7': [ # Valid Self-Issued inhibitAnyPolicy Test7 | 1020 '4.12.7': [ # Valid Self-Issued inhibitAnyPolicy Test7 |
| 945 # Procedure: Validate Valid Self-Issued inhibitAnyPolicy Test7 EE using the | 1021 # Procedure: Validate Valid Self-Issued inhibitAnyPolicy Test7 EE using the |
| 946 # default settings or open and verify Signed Test Message 6.2.2.125 using | 1022 # default settings or open and verify Signed Test Message 6.2.2.125 using |
| 947 # the default settings. | 1023 # the default settings. |
| 948 # | 1024 # |
| 949 # Expected Result: The authorities-constrained-policy-set will be | 1025 # Expected Result: The authorities-constrained-policy-set will be |
| 950 # {NIST-test-policy-1} and the explicit-policy-indicator will be set (if | 1026 # {NIST-test-policy-1} and the explicit-policy-indicator will be set (if |
| 951 # the application can process the policyConstraints extension). If the | 1027 # the application can process the policyConstraints extension). If the |
| 952 # initial-policy-set is any-policy or otherwise includes | 1028 # initial-policy-set is any-policy or otherwise includes |
| 953 # NIST-test-policy-1, then the user-constrained-policy-set will be | 1029 # NIST-test-policy-1, then the user-constrained-policy-set will be |
| 954 # {NIST-test-policy-1} and the path should validate successfully. If not, | 1030 # {NIST-test-policy-1} and the path should validate successfully. If not, |
| 955 # then the user-constrained-policy-set will be empty. If the | 1031 # then the user-constrained-policy-set will be empty. If the |
| 956 # user-constrained-policy-set is empty and the application can process the | 1032 # user-constrained-policy-set is empty and the application can process the |
| 957 # policyConstraints extension, then the path should not validate | 1033 # policyConstraints extension, then the path should not validate |
| 958 # successfully. | 1034 # successfully. |
| 959 TestInfo(True), | 1035 TestInfo(True, user_constrained_policy_set=[TEST_POLICY_1]), |
| 960 ], | 1036 ], |
| 961 | 1037 |
| 962 '4.12.8': [ # Invalid Self-Issued inhibitAnyPolicy Test8 | 1038 '4.12.8': [ # Invalid Self-Issued inhibitAnyPolicy Test8 |
| 963 # Procedure: Validate Invalid Self-Issued inhibitAnyPolicy Test8 EE using | 1039 # Procedure: Validate Invalid Self-Issued inhibitAnyPolicy Test8 EE using |
| 964 # the default settings or open and verify Signed Test Message 6.2.2.126 | 1040 # the default settings or open and verify Signed Test Message 6.2.2.126 |
| 965 # using the default settings. | 1041 # using the default settings. |
| 966 # | 1042 # |
| 967 # Expected Result: The authorities-constrained-policy-set and | 1043 # Expected Result: The authorities-constrained-policy-set and |
| 968 # user-constrained-policy-set will be empty and the | 1044 # user-constrained-policy-set will be empty and the |
| 969 # explicit-policy-indicator will be set (if the application can process the | 1045 # explicit-policy-indicator will be set (if the application can process the |
| 970 # policyConstraints extension). If the application can process the | 1046 # policyConstraints extension). If the application can process the |
| 971 # policyConstraints extension, then the path should not validate | 1047 # policyConstraints extension, then the path should not validate |
| 972 # successfully. | 1048 # successfully. |
| 973 TestInfo(False), | 1049 TestInfo(False, user_constrained_policy_set=[]), |
| 974 ], | 1050 ], |
| 975 | 1051 |
| 976 '4.12.9': [ # Valid Self-Issued inhibitAnyPolicy Test9 | 1052 '4.12.9': [ # Valid Self-Issued inhibitAnyPolicy Test9 |
| 977 # Procedure: Validate Valid Self-Issued inhibitAnyPolicy Test9 EE using the | 1053 # Procedure: Validate Valid Self-Issued inhibitAnyPolicy Test9 EE using the |
| 978 # default settings or open and verify Signed Test Message 6.2.2.127 using | 1054 # default settings or open and verify Signed Test Message 6.2.2.127 using |
| 979 # the default settings. | 1055 # the default settings. |
| 980 # | 1056 # |
| 981 # Expected Result: The authorities-constrained-policy-set will be | 1057 # Expected Result: The authorities-constrained-policy-set will be |
| 982 # {NIST-test-policy-1} and the explicit-policy-indicator will be set (if | 1058 # {NIST-test-policy-1} and the explicit-policy-indicator will be set (if |
| 983 # the application can process the policyConstraints extension). If the | 1059 # the application can process the policyConstraints extension). If the |
| 984 # initial-policy-set is any-policy or otherwise includes | 1060 # initial-policy-set is any-policy or otherwise includes |
| 985 # NIST-test-policy-1, then the user-constrained-policy-set will be | 1061 # NIST-test-policy-1, then the user-constrained-policy-set will be |
| 986 # {NIST-test-policy-1} and the path should validate successfully. If not, | 1062 # {NIST-test-policy-1} and the path should validate successfully. If not, |
| 987 # then the user-constrained-policy-set will be empty. If the | 1063 # then the user-constrained-policy-set will be empty. If the |
| 988 # user-constrained-policy-set is empty and the application can process the | 1064 # user-constrained-policy-set is empty and the application can process the |
| 989 # policyConstraints extension, then the path should not validate | 1065 # policyConstraints extension, then the path should not validate |
| 990 # successfully. | 1066 # successfully. |
| 991 TestInfo(True), | 1067 TestInfo(True, user_constrained_policy_set=[TEST_POLICY_1]), |
| 992 ], | 1068 ], |
| 993 | 1069 |
| 994 '4.12.10': [ # Invalid Self-Issued inhibitAnyPolicy Test10 | 1070 '4.12.10': [ # Invalid Self-Issued inhibitAnyPolicy Test10 |
| 995 # Procedure: Validate Invalid Self-Issued inhibitAnyPolicy Test10 EE using | 1071 # Procedure: Validate Invalid Self-Issued inhibitAnyPolicy Test10 EE using |
| 996 # the default settings or open and verify Signed Test Message 6.2.2.128 | 1072 # the default settings or open and verify Signed Test Message 6.2.2.128 |
| 997 # using the default settings. | 1073 # using the default settings. |
| 998 # | 1074 # |
| 999 # Expected Result: The authorities-constrained-policy-set and | 1075 # Expected Result: The authorities-constrained-policy-set and |
| 1000 # user-constrained-policy-set will be empty and the | 1076 # user-constrained-policy-set will be empty and the |
| 1001 # explicit-policy-indicator will be set (if the application can process the | 1077 # explicit-policy-indicator will be set (if the application can process the |
| 1002 # policyConstraints extension). If the application can process the | 1078 # policyConstraints extension). If the application can process the |
| 1003 # policyConstraints extension, then the path should not validate | 1079 # policyConstraints extension, then the path should not validate |
| 1004 # successfully. | 1080 # successfully. |
| 1005 TestInfo(False), | 1081 TestInfo(False, user_constrained_policy_set=[]), |
| 1006 ], | 1082 ], |
| 1007 } | 1083 } |
| 1008 | 1084 |
| 1009 | 1085 |
| 1010 def parse_test(lines, i, test_case_name, test_number, test_name, | 1086 def parse_test(lines, i, test_case_name, test_number, test_name, |
| 1011 sanitized_test_names, output): | 1087 sanitized_test_names, output): |
| 1012 # Start by doing a coarse level of parsing that separates out the lines for | 1088 # Start by doing a coarse level of parsing that separates out the lines for |
| 1013 # the main sections. | 1089 # the main sections. |
| 1014 i, test_sections = parse_main_test_sections(lines, i) | 1090 i, test_sections = parse_main_test_sections(lines, i) |
| 1015 | 1091 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 1041 # Check whether expected result is validation success or failure. | 1117 # Check whether expected result is validation success or failure. |
| 1042 result_match = TEST_RESULT_MATCHER.match( | 1118 result_match = TEST_RESULT_MATCHER.match( |
| 1043 test_sections.expected_result_lines[0]) | 1119 test_sections.expected_result_lines[0]) |
| 1044 if not result_match: | 1120 if not result_match: |
| 1045 sys.stderr.write('Unknown expectation for %s:\n%s\n' % ( | 1121 sys.stderr.write('Unknown expectation for %s:\n%s\n' % ( |
| 1046 test_number, " ".join(test_sections.expected_result_lines))) | 1122 test_number, " ".join(test_sections.expected_result_lines))) |
| 1047 sys.exit(1) | 1123 sys.exit(1) |
| 1048 # Initializes with default settings. | 1124 # Initializes with default settings. |
| 1049 info = TestInfo(result_match.group(1) == 'should validate') | 1125 info = TestInfo(result_match.group(1) == 'should validate') |
| 1050 | 1126 |
| 1127 # Special case the 4.9 test failures (require explicit policy) to set |
| 1128 # user_constrained_policy_set to empty. This is only done for the 4.9 |
| 1129 # tests, because the other policy tests are special cased as overrides and |
| 1130 # hence set this manually on a per-test basis. |
| 1131 # |
| 1132 # user_constrained_policy_set enumerates the subset of the initial policy |
| 1133 # set (anyPolicy in the default case) that were valid for the path. For |
| 1134 # non-policy tests the expectation for user_constrained_policy_set is |
| 1135 # [TEST_POLICY_1] since each policy asserts that. However for these tests, |
| 1136 # the expectation is an empty user_constrained_policy_set since there was |
| 1137 # no valid policy for the path (in fact, that is why the path validation is |
| 1138 # expected to fail). |
| 1139 if test_number.startswith('4.9.') and not info.should_validate: |
| 1140 info.user_constrained_policy_set = [] |
| 1141 |
| 1051 output_test(test_case_name, test_number, test_name, None, info, certs, | 1142 output_test(test_case_name, test_number, test_name, None, info, certs, |
| 1052 crls, sanitized_test_names, output) | 1143 crls, sanitized_test_names, output) |
| 1053 else: | 1144 else: |
| 1054 # The overrides may have a series of inputs (settings) and outputs | 1145 # The overrides may have a series of inputs (settings) and outputs |
| 1055 # (success/failure) for this test. Output each as a separate test case. | 1146 # (success/failure) for this test. Output each as a separate test case. |
| 1056 for subpart_i in range(len(overrides)): | 1147 for subpart_i in range(len(overrides)): |
| 1057 info = overrides[subpart_i] | 1148 info = overrides[subpart_i] |
| 1058 # If the test has only 1 subpart, don't number it. | 1149 # If the test has only 1 subpart, don't number it. |
| 1059 subpart_number = subpart_i + 1 if len(overrides) > 1 else None | 1150 subpart_number = subpart_i + 1 if len(overrides) > 1 else None |
| 1060 output_test(test_case_name, test_number, test_name, subpart_number, info, | 1151 output_test(test_case_name, test_number, test_name, subpart_number, info, |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1120 continue | 1211 continue |
| 1121 i, parse_test(lines, i, test_case_name, test_number, | 1212 i, parse_test(lines, i, test_case_name, test_number, |
| 1122 test_name, sanitized_test_names, output) | 1213 test_name, sanitized_test_names, output) |
| 1123 | 1214 |
| 1124 if test_case_name: | 1215 if test_case_name: |
| 1125 finalize_test_case(test_case_name, sanitized_test_names, output) | 1216 finalize_test_case(test_case_name, sanitized_test_names, output) |
| 1126 | 1217 |
| 1127 | 1218 |
| 1128 if __name__ == '__main__': | 1219 if __name__ == '__main__': |
| 1129 main() | 1220 main() |
| OLD | NEW |