Skip to content

Latest commit

 

History

History
113 lines (78 loc) · 2.91 KB

4.Digests.md

File metadata and controls

113 lines (78 loc) · 2.91 KB

4. Test Case for DIGESTS

Case 4.1

Description: SPDM responder shall return valid DIGESTS, if it receives a GET_DIGESTS.

SPDM Version: 1.0+

TestSetup:

  1. Requester -> GET_VERSION {SPDMVersion=0x10}
  2. VERSION <- Responder
  3. Requester -> GET_CAPABILITIES {SPDMVersion=NegotiatedVersion, ...}
  4. CAPABILITIES <- Responder
  5. If Flags.CERT_CAP == 0, then skip this case.
  6. Requester -> NEGOTIATE_ALGORITHMS {SPDMVersion=NegotiatedVersion, ...}
  7. ALGORITHMS <- Responder

TestTeardown: None

Steps:

  1. Requester -> GET_DIGESTS {SPDMVersion=NegotiatedVersion, Param1=0, Param2=0}
  2. SpdmMessage <- Responder

Assertion 4.1.1: sizeof(SpdmMessage) >= offset(DIGESTS, Digest[0])

Assertion 4.1.2: SpdmMessage.RequestResponseCode == DIGESTS

Assertion 4.1.3: SpdmMessage.SPDMVersion == NegotiatedVersion

Assertion 4.1.4: SpdmMessage.Param2.SlotMask.bit_0 == 1

Assertion 4.1.5: SlotCount = bit number of SpdmMessage.Param2.SlotMask sizeof(SpdmMessage) >= offset(DIGESTS, Digest[0]) + HashSize * SlotCount

Case 4.2

Description: SPDM responder shall return ERROR(VersionMismatch), if it receives a GET_DIGESTS with non negotiated version.

SPDM Version: 1.0+

TestSetup:

  1. Requester -> GET_VERSION {SPDMVersion=0x10}
  2. VERSION <- Responder
  3. Requester -> GET_CAPABILITIES {SPDMVersion=NegotiatedVersion, ...}
  4. CAPABILITIES <- Responder
  5. If Flags.CERT_CAP == 0, then skip this case.
  6. Requester -> NEGOTIATE_ALGORITHMS {SPDMVersion=NegotiatedVersion, ...}
  7. ALGORITHMS <- Responder

TestTeardown: None

Steps:

  1. Requester -> GET_DIGESTS {SPDMVersion=(NegotiatedVersion+1), ...}
  2. SpdmMessage <- Responder

Assertion 4.2.1: sizeof(SpdmMessage) >= sizeof(ERROR)

Assertion 4.2.2: SpdmMessage.RequestResponseCode == ERROR

Assertion 4.2.3: SpdmMessage.SPDMVersion == NegotiatedVersion

Assertion 4.2.4: SpdmMessage.Param1 == VersionMismatch.

Assertion 4.2.5: SpdmMessage.Param2 == 0.

  1. Requester -> GET_DIGESTS {SPDMVersion=(NegotiatedVersion-1), ...}
  2. SpdmMessage <- Responder

Assertion 4.2.*.

Case 4.3

Description: SPDM responder shall return ERROR(UnexpectedRequest), if it receives a GET_DIGESTS before NEGOTIATE_ALGORITHMS.

SPDM Version: 1.0+

TestSetup:

  1. Requester -> GET_VERSION {SPDMVersion=0x10}
  2. VERSION <- Responder
  3. Requester -> GET_CAPABILITIES {SPDMVersion=NegotiatedVersion, ...}
  4. CAPABILITIES <- Responder
  5. If Flags.CERT_CAP == 0, then skip this case.

TestTeardown: None

Steps:

  1. Requester -> GET_DIGESTS {SPDMVersion=NegotiatedVersion, ...}
  2. SpdmMessage <- Responder

Assertion 4.3.1: sizeof(SpdmMessage) >= sizeof(ERROR)

Assertion 4.3.2: SpdmMessage.RequestResponseCode == ERROR

Assertion 4.3.3: SpdmMessage.SPDMVersion == NegotiatedVersion

Assertion 4.3.4: SpdmMessage.Param1 == UnexpectedRequest.

Assertion 4.3.5: SpdmMessage.Param2 == 0.