Skip to content

Commit 570f38a

Browse files
Update multikey flow
Signed-off-by: Steven Bellock <[email protected]>
1 parent 2312ef6 commit 570f38a

File tree

1 file changed

+49
-5
lines changed

1 file changed

+49
-5
lines changed

doc/multikey.md

Lines changed: 49 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ while a different key can be restricted to only sign the M1/M2 transcript. As su
88
endpoint supports multikey, the local endpoint must ensure that it uses the appropriate key and
99
certificate slot when signing or verifying messages.
1010

11-
## Endpoint Support for Multikey
11+
## libspdm Endpoint Support for Multikey
1212

1313
SPDM allows an endpoint to support multikey in one of three ways.
1414
1. No support at all (`MULTI_KEY_CAP == 0`).
@@ -19,15 +19,59 @@ Use `libspdm_set_data`, `LIBSPDM_DATA_OTHER_PARAMS_SUPPORT`, and the
1919
`SPDM_ALGORITHMS_MULTI_KEY_CONN` boolean to specify how libspdm should handle the case when the peer
2020
endpoint's multikey support is conditional (`MULTI_KEY_CAP == 2`).
2121

22-
### Multikey Flow for libspdm Requester
22+
## Multikey Flow For Requester
2323

2424
1. Call `libspdm_init_connection` and check that the call is successful.
25-
2. Call `libspdm_get_data` with `LIBSPDM_DATA_MULTI_KEY_CONN_RSP` to determine whether the
25+
2. Proceed through the "Responder Sign / Requester Verify Flow".
26+
3. If Requester's `MULTI_KEY_CAP` is non-zero, then proceed through the
27+
"Requester Sign / Responder Verify Flow".
28+
29+
If Requester's `MULTI_KEY_CAP` is non-zero then both `ENCAP_CAP` and `CERT_CAP` must be set.
30+
31+
### Responder Sign / Requester Verify Flow
32+
33+
1. Call `libspdm_get_data` with `LIBSPDM_DATA_MULTI_KEY_CONN_RSP` to determine whether the
2634
connection utilizes multikey (`true`) or not (`false`). If the value is `true` then continue with
2735
this flow, else the connection behaves in a single key manner.
28-
3. Call `libspdm_get_digest` and check that the call is successful.
29-
4. For each populated certificate chain slot call `libspdm_get_certificate` and check that each call
36+
2. Call `libspdm_get_digest` and check that the call is successful.
37+
3. For each populated certificate chain slot call `libspdm_get_certificate` and check that each call
3038
is successful.
3139
4. Use `libspdm_get_data` with `LIBSPDM_DATA_PEER_KEY_USAGE_BIT_MASK` to query the `KeyUsageMask`
3240
for each populated certificate slot. Use the `SPDM_KEY_USAGE_BIT_MASK_*` macros to determine the
3341
legal messages for that certificate slot and key.
42+
43+
### Requester Sign / Responder Verify Flow
44+
45+
1. If Requester's `MULTI_KEY_CAP == 1` then skip to Step 2. If `MULTI_KEY_CAP == 2` then call
46+
`libspdm_get_data` with `LIBSPDM_DATA_MULTI_KEY_CONN_REQ` to determine whether the connection
47+
utilizes multikey (`true`) or not (`false`). If it is `true` then continue to Step 2.
48+
2. Call `libspdm_set_data` with `LIBSPDM_DATA_LOCAL_KEY_PAIR_ID` and
49+
`LIBSPDM_DATA_LOCAL_KEY_USAGE_BIT_MASK` to map `KeyPairID`s with certificate slots for the
50+
negotiated asymmetric cryptography algorithm (`ReqBaseAsymAlg` or `ReqPqcAsymAlg`) and to
51+
specify the messages a key can be associated with.
52+
- If `MULTI_KEY_CAP == 1` and the Requester supports only one asymmetric cryptography
53+
algorithm for signing then this step can be performed before the connection is
54+
established.
55+
3. Calls to `libspdm_requester_data_sign` then specify the `KeyPairID`.
56+
57+
## Multikey Flow for Responder
58+
59+
### Responder Sign / Requester Verify Flow
60+
61+
1. If Responder's `MULTI_KEY_CAP == 1` then skip to Step 2. If `MULTI_KEY_CAP == 2` then, after
62+
`VCA` has completed and the connection status has transitioned to
63+
`LIBSPDM_CONNECTION_STATE_NEGOTIATED`, call `libspdm_get_data` with
64+
`LIBSPDM_DATA_MULTI_KEY_CONN_RSP` to determine whether the connection utilizes multikey (`true`)
65+
or not (`false`). If it is `true` then continue to Step 2.
66+
2. Call `libspdm_set_data` with `LIBSPDM_DATA_LOCAL_KEY_PAIR_ID` and
67+
`LIBSPDM_DATA_LOCAL_KEY_USAGE_BIT_MASK` to map `KeyPairID`s with certificate slots for the
68+
negotiated asymmetric cryptography algorithm (`BaseAsymSel` or `PqcAsymSel`) and to specify
69+
the messages a key can be associated with.
70+
- If `MULTI_KEY_CAP == 1` and the Responder supports only one asymmetric cryptography
71+
algorithm for signing then this step can be performed before the connection is
72+
established.
73+
3. Calls to `libspdm_responder_data_sign` then specify the `KeyPairID`.
74+
75+
### Requester Sign / Responder Verify Flow
76+
77+
TBD.

0 commit comments

Comments
 (0)