Closed sowmyassp closed 2 years ago
- Send AddTrustedRootCertificate Command with malformed root certificate - Failure(CONSTRAINT_ERROR)
@sowmyassp The spec section being cited above is for the case of a valid new root certificate that: 1) Has the same public key as some existing root certificate. 2) Is not byte for byte identical to that existing root certificate.
So if a malformed root certificate is being sent that spec section does not apply.
But also, the steps shown in the log are:
[1655883147.902968][12348:12356] CHIP:IN: Sending encrypted msg 0xaaaad978bc68 with MessageCounter:186295179 to 0x0000000000000001 (1) at monotonic time: 000000000087735D msec
[1655883160.848323][12384:12389] CHIP:IN: Sending encrypted msg 0xaaaae5859538 with MessageCounter:205635958 to 0x0000000000000001 (1) at monotonic time: 000000000087A5EF msec
So we arm a fail-safe for 60 seconds, then 13 seconds pass, then we arm for 60 seconds, which just extends the existing non-expired fail-safe. Then we try to add a second root certificate, and the relevant spec bit is:
If a prior AddTrustedRootCertificate command was successfully invoked within the fail-safe timer period, which would cause the new invocation to add a second root certificate within a given fail-safe timer period, then this command SHALL fail with a CONSTRAINT_ERROR status code sent back to the initiator.
which is what happens here.
I read through the test plan, and it looks like this is trying to do step 40 from the test plan? But the steps being carried out above look nothing like the parts of the test plan that come before step 40....
Though following the test plan exactly would run into trouble too. Filed https://github.com/CHIP-Specifications/chip-test-plans/issues/1560
Problem:
When Arm fail command is sent with malformed Root Certificate in a new fail safe timer period we expect to see INVALID_Command but we are seeing CONSTRAINT_ERROR
Spec Referrence-11.18.7.13
Commit used : c60233daaa8ea68b4f1198d640e6f89966363f31
Sequence of Steps: 1.Commission DUT to TH - Success
Test platform : Chip-tool - RPI-4, 8GB RAM DUT - RPI - RPI-4, 8GB RAM
Test-plan reference : https://github.com/CHIP-Specifications/chip-test-plans/blob/master/src/devicemanagement.adoc#tc-opcreds-3-1-attribute-nocs-trustedrootcertificates-list-validation-dut-server
PFA Logs: TC-OPCREDS_3.1_cntrl.txt