DMTF / SPDM-Responder-Validator

BSD 3-Clause "New" or "Revised" License
10 stars 14 forks source link

Skipped test groups digests and certificate for spdm version 1.0/1.1 #102

Closed Dhruva21 closed 1 year ago

Dhruva21 commented 1 year ago

I ran spdm_validator_sample exe against our Drive(spdm version 1.0 and 1.1 supported). I observed the test group digests and test group certificate are skipped and rest of test groups are running perfect.

Here is the skipped test groups result test log. image

When I looked into the code, I observed: Host sends capability command with 1.2 version, but device doesn’t support it. So this test is failed, but it already has overwritten the requester’s version. After that, requester tries to establish new connection by get version however there is only 1.2 version in context.

Made changes in

  1. spdm_test_case_certificate_setup_version_any
  2. spdm_test_case_digests_setup_version_any image

After this change I was successfully able to run all the test groups.

jyao1 commented 1 year ago

I dont think the fix is right one. xxx_setup_version_any() means any version, we should not mandate 1.0.

Host sends capability command with 1.2 version, but device doesn’t support it.

To me this is wrong. I dont know why the host select capability with 1.2 version. Do you have a message dump for the SPDM message?

jyao1 commented 1 year ago

I found the root-cause.

Although we have case_teardown_func() to restore the environment, there might be case that case_setup_func() returns failure then the case_teardown_func() is skipped.. Then the spdm_version count is NOT restored.

I think common_test_run_test_suite() should be fixed to handle that case.

Dhruva21 commented 1 year ago

@jyao1 , this issue has been resolved with your changes in #104 .