Skip to content

Commit de0183f

Browse files
committed
Add check for incorrectly formatted fallback PID on PAI
1 parent b6cf6a3 commit de0183f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/python_testing/TC_DA_1_2.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ def parse_single_vidpid_from_common_name(commonName: str, tag_str: str) -> str:
5757

5858
s = sp[1][:4]
5959
if not s.isupper() or len(s) != 4:
60+
asserts.fail(f"Improperly encoded PID or VID when using fallback encoding {tag_str}:{s}")
6061
return None
6162

6263
return s
@@ -132,6 +133,8 @@ def steps_TC_DA_1_2(self):
132133
TestStep("6.7", "Verify CD security_information", "security_information = 0"),
133134
TestStep("6.8", "Verify CD version_number", "version_number is an integer in range 0..65535"),
134135
TestStep("6.9", "Verify CD certification_type", "certification_type has a value between 1..2"),
136+
TestStep("7.0", "Extract the Vendor ID (VID) and Product ID (PID) from the DAC. Extract the VID from the PAI. Extract the PID from the PAI, if present",
137+
"VID and PID are present and properly encoded in the DAC. VID is present and properly encoded in the PAI. If the PID is present in the PAI, it is properly encoded"),
135138
TestStep("7.1", "", "If the dac_origin_vendor_id is present in the CD, confirm the dac_origin_product_id is also present. If the dac_origin_vendor_id is not present in the CD, confirm the dac_origin_product_id is also not present."),
136139
TestStep("7.2", "If the Certification Declaration has both the dac_origin_vendor_id and the dac_origin_product_id fields, verify dac_origin fields",
137140
("* The Vendor ID (VID) in the DAC subject and PAI subject are the same as the dac_origin_vendor_id field in the Certification Declaration.\n"
@@ -309,9 +312,10 @@ async def test_TC_DA_1_2(self):
309312
else:
310313
asserts.assert_in(certification_type, [1, 2], "Certification type is out of range")
311314

312-
self.step("7.1")
315+
self.step("7.0")
313316
dac_vid, dac_pid, pai_vid, pai_pid = parse_ids_from_certs(parsed_dac, parsed_pai)
314317

318+
self.step("7.1")
315319
has_origin_vid = 9 in cd.keys()
316320
has_origin_pid = 10 in cd.keys()
317321
if has_origin_pid != has_origin_vid:

0 commit comments

Comments
 (0)