Skip to content

Latest commit

 

History

History
173 lines (130 loc) · 5.89 KB

12.HeartbeatAck.md

File metadata and controls

173 lines (130 loc) · 5.89 KB

12. Test Case for HEARTBEAT_ACK

Case 12.1

Description: SPDM responder shall return valid HEARTBEAT_ACK, if it receives a HEARTBEAT in DHE session.

SPDM Version: 1.1+

TestSetup:

  1. Requester -> GET_VERSION {SPDMVersion=0x10}
  2. VERSION <- Responder
  3. If 1.1 or above is not in VERSION.VersionNumberEntry, then skip this case.
  4. Requester -> GET_CAPABILITIES {SPDMVersion=NegotiatedVersion, ...}
  5. CAPABILITIES <- Responder
  6. If Flags.HBEAT_CAP == 0 || Flags.KEY_EX_CAP == 0, then skip this case.
  7. Requester -> NEGOTIATE_ALGORITHMS {SPDMVersion=NegotiatedVersion, ...}
  8. ALGORITHMS <- Responder
  9. Requester -> GET_DIGESTS {SPDMVersion=NegotiatedVersion, ...}
  10. DIGESTS <- Responder
  11. ValidSlotID[] = array of bit-index that SlotMask[bit-index]=1 from DIGEST.Param2.SlotMask
  12. Requester -> GET_CERTIFICATE {SPDMVersion=NegotiatedVersion, Param1.SlotID=ValidSlotID[i], ...}
  13. CERTIFICATE <- Responder
  14. Requester -> KEY_EXCHANGE {SPDMVersion=NegotiatedVersion, ...}
  15. KEY_EXCHANGE_RSP <- Responder
  16. If KEY_EXCHANGE_RSP.Param1.HeartbeatPeriod == 0, then skip this case.
  17. Requester -> FINISH {SPDMVersion=NegotiatedVersion, ...} in session-X
  18. FINISH_RSP <- Responder in session-X

TestTeardown: None

Steps:

  1. Requester -> HEARTBEAT {SPDMVersion=NegotiatedVersion, Param1=0, Param2=0} in session-X
  2. SpdmMessage <- Responder in session-X

Assertion 12.1.1: sizeof(SpdmMessage) >= sizeof(HEARTBEAT_ACK)

Assertion 12.1.2: SpdmMessage.RequestResponseCode == HEARTBEAT_ACK

Assertion 12.1.3: SpdmMessage.SPDMVersion == NegotiatedVersion

Case 12.2

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

SPDM Version: 1.1+

TestSetup:

  1. Requester -> GET_VERSION {SPDMVersion=0x10}
  2. VERSION <- Responder
  3. If 1.1 or above is not in VERSION.VersionNumberEntry, then skip this case.
  4. Requester -> GET_CAPABILITIES {SPDMVersion=NegotiatedVersion, ...}
  5. CAPABILITIES <- Responder
  6. If Flags.HBEAT_CAP == 0 || Flags.KEY_EX_CAP == 0, then skip this case.
  7. Requester -> NEGOTIATE_ALGORITHMS {SPDMVersion=NegotiatedVersion, ...}
  8. ALGORITHMS <- Responder
  9. Requester -> GET_DIGESTS {SPDMVersion=NegotiatedVersion, ...}
  10. DIGESTS <- Responder
  11. ValidSlotID[] = array of bit-index that SlotMask[bit-index]=1 from DIGEST.Param2.SlotMask
  12. Requester -> GET_CERTIFICATE {SPDMVersion=NegotiatedVersion, Param1.SlotID=ValidSlotID[i], ...}
  13. CERTIFICATE <- Responder
  14. Requester -> KEY_EXCHANGE {SPDMVersion=NegotiatedVersion, ...}
  15. KEY_EXCHANGE_RSP <- Responder
  16. If KEY_EXCHANGE_RSP.Param1.HeartbeatPeriod == 0, then skip this case.
  17. Requester -> FINISH {SPDMVersion=NegotiatedVersion, ...} in session-X
  18. FINISH_RSP <- Responder in session-X

TestTeardown: None

Steps:

  1. Requester -> HEARTBEAT {SPDMVersion=(NegotiatedVersion+1), ...} in session-X
  2. SpdmMessage <- Responder in session-X

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

Assertion 12.2.2: SpdmMessage.RequestResponseCode == ERROR

Assertion 12.2.3: SpdmMessage.SPDMVersion == NegotiatedVersion

Assertion 12.2.4: SpdmMessage.Param1 == VersionMismatch.

Assertion 12.2.5: SpdmMessage.Param2 == 0.

  1. Requester -> HEARTBEAT {SPDMVersion=(NegotiatedVersion-1), ...} in session-X
  2. SpdmMessage <- Responder in session-X

Assertion 12.2.*.

Case 12.3

Description: SPDM responder shall return ERROR(UnexpectedRequest), if it receives a HEARTBEAT in DHE session handshake.

SPDM Version: 1.1+

TestSetup:

  1. Requester -> GET_VERSION {SPDMVersion=0x10}
  2. VERSION <- Responder
  3. If 1.1 or above is not in VERSION.VersionNumberEntry, then skip this case.
  4. Requester -> GET_CAPABILITIES {SPDMVersion=NegotiatedVersion, ...}
  5. CAPABILITIES <- Responder
  6. If Flags.HBEAT_CAP == 0 || Flags.KEY_EX_CAP == 0, then skip this case.
  7. Requester -> NEGOTIATE_ALGORITHMS {SPDMVersion=NegotiatedVersion, ...}
  8. ALGORITHMS <- Responder
  9. Requester -> GET_DIGESTS {SPDMVersion=NegotiatedVersion, ...}
  10. DIGESTS <- Responder
  11. ValidSlotID[] = array of bit-index that SlotMask[bit-index]=1 from DIGEST.Param2.SlotMask
  12. Requester -> GET_CERTIFICATE {SPDMVersion=NegotiatedVersion, Param1.SlotID=ValidSlotID[i], ...}
  13. CERTIFICATE <- Responder
  14. Requester -> KEY_EXCHANGE {SPDMVersion=NegotiatedVersion, ...}
  15. KEY_EXCHANGE_RSP <- Responder
  16. If KEY_EXCHANGE_RSP.Param1.HeartbeatPeriod == 0, then skip this case.

TestTeardown: None

Steps:

  1. Requester -> HEARTBEAT {SPDMVersion=NegotiatedVersion, Param1=0, Param2=0} in session-X
  2. SpdmMessage <- Responder in session-X

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

Assertion 12.3.2: SpdmMessage.RequestResponseCode == ERROR

Assertion 12.3.3: SpdmMessage.SPDMVersion == NegotiatedVersion

Assertion 12.3.4: SpdmMessage.Param1 == UnexpectedRequest.

Assertion 12.3.5: SpdmMessage.Param2 == 0.

Case 12.4

Description: SPDM responder shall return ERROR(SessionRequired), if it receives a HEARTBEAT in non-session.

SPDM Version: 1.2

TestSetup:

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

TestTeardown: None

Steps:

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

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

Assertion 12.4.2: SpdmMessage.RequestResponseCode == ERROR

Assertion 12.4.3: SpdmMessage.SPDMVersion == NegotiatedVersion

Assertion 12.4.4: SpdmMessage.Param1 == SessionRequired.