Skip to content

Commit f0cc468

Browse files
committed
Add one-by-one measurement report format.
Rename existing one to Standard All-Measurements Report Definition. Signed-off-by: Jiewen Yao <[email protected]>
1 parent 19efa68 commit f0cc468

File tree

1 file changed

+95
-3
lines changed

1 file changed

+95
-3
lines changed

doc/standard_measurement_report.md

Lines changed: 95 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,12 @@ SPDM Requester and consumed by a Verifier while all agents are operating in prod
1313
particular, a production Verifier may only support a measurement report of this type and can point
1414
to this document to advertise that restriction to other agents.
1515

16-
## Standard Measurement Report Definition
16+
There are 2 types of Standard Measurement Report. A verifier should support All-Measurements Report
17+
and may support One-by-One-Measurements Report.
1718

18-
The standard measurement report is a byte buffer that consists of the L1/L2 transcript along with
19+
## Standard All-Measurements Report Definition
20+
21+
The standard all-measurements report is a byte buffer that consists of the L1/L2 transcript along with
1922
the signature over the transcript if the Responder supports signing. It is comprised of a single
2023
`GET_MEASUREMENTS` request and a single `MEASUREMENTS` response.
2124

@@ -31,15 +34,60 @@ request has the following properties:
3134
* For SPDM 1.3 and later, `NewMeasurementRequested` is not set.
3235
* This requests the current state of the Responder and not its future state.
3336

37+
## Standard One-by-One-Measurements Report Definition
38+
39+
The standard one-by-one-measurements report is a byte buffer that consists of the L1/L2 transcript along with
40+
the signature over the transcript if the Responder supports signing. It is comprised of multiple
41+
`GET_MEASUREMENTS` requests and multiple `MEASUREMENTS` responses.
42+
43+
For SPDM 1.0 and 1.1, the byte buffer is {`GET_MEASUREMENTS`(0), `MEASUREMENTS`(0),
44+
`GET_MEASUREMENTS`(1), `MEASUREMENTS`(1), ..., `GET_MEASUREMENTS`(n), `MEASUREMENTS`(n)}.
45+
For SPDM 1.2 and later, the byte buffer is {`VCA`, `GET_MEASUREMENTS`(0), `MEASUREMENTS`(0),
46+
`GET_MEASUREMENTS`(1), `MEASUREMENTS`(1), ..., `GET_MEASUREMENTS`(n), `MEASUREMENTS`(n)}.
47+
48+
The `GET_MEASUREMENTS`(0) request has the following properties:
49+
* `Param2 = 0x00`
50+
* Total number of measurement blocks is requested.
51+
* Assuming that the Responder returns `n` measurement blocks in `MEASUREMENTS`(0).
52+
* `SignatureRequested` is not set.
53+
* For SPDM 1.2 and later, `RawBitStreamRequested` is not set.
54+
* For SPDM 1.3 and later, `NewMeasurementRequested` is not set.
55+
56+
The `GET_MEASUREMENTS`(1) to `GET_MEASUREMENTS`(n) request has the following properties:
57+
* `Param2`
58+
* The requested measurement index. It should be between 0x1 and 0xFE, inclusive and incremental.
59+
* Only successful `GET_MEASUREMENTS`(x) and `MEASUREMENTS`(x) are recorded in the measurement report.
60+
* `SignatureRequested`
61+
* For `GET_MEASUREMENTS`(1), ..., and `GET_MEASUREMENTS`(n-1), it is not set.
62+
* For `GET_MEASUREMENTS`(n), if the Responder supports signature generation (`MEAS_CAP = 10b`)
63+
then it is set, else it is not set.
64+
* For SPDM 1.2 and later, if the requester detected the signed `MEASUREMENT`(n)
65+
`content change` field is `01b`(changed), the requester should discard this measurement report
66+
and recollect from the beginning.
67+
* For SPDM 1.2 and later, `RawBitStreamRequested` is not set.
68+
* For SPDM 1.3 and later, `NewMeasurementRequested` is not set.
69+
3470
## Rationale
3571

36-
### Single Request and Response
72+
### Single or One-by-One Request and Response
3773

3874
Capturing all measurements in a single response provides an atomic snapshot of the state of the
3975
Responder at a specific point in time. As such, a Verifier need not have to reason about the state
4076
of the Responder through multiple measurement requests and responses with a possibly unknown amount
4177
of time between each message.
4278

79+
The requester should collect All-Measurements Report at first. Only if the device cannot return
80+
all measurements at one time due to some errors (such as transport layer limitation),
81+
then the requester can try to collect One-by-One-Measurements Report.
82+
83+
### Detecting Measurement Report format
84+
85+
The verifier may check the first `GET_MEASUREMENTS` in the Measurement Report.
86+
* If the `Param2` is `0xFF`(All Measurements), then it is All-Measurements Report.
87+
The whole Measurement report should include only one `GET_MEASUREMENTS`/`MEASUREMENTS` pair.
88+
* If the `Param2` is `0x00`(Total Number), then it is One-by-One-Measurements Report.
89+
The whole Measurement report should include only `n`+1 `GET_MEASUREMENTS`/`MEASUREMENTS` pairs.
90+
4391
### Byte Buffer
4492

4593
A raw byte buffer allows the Verifier to verify the signature, if supported by the Responder, over
@@ -56,3 +104,47 @@ are evaluated by the Verifier while the Responder is in production.
56104

57105
Presumably the Verifier evaluates the current state of the Responder and not its future state. As
58106
such `NewMeasurementRequested` is not set.
107+
108+
### Non-Sequentially Increased Measurement Index
109+
110+
If One-by-One-Measurements report is used, the `Param2`(measurement index) in `GET_MEASUREMENTS`(1)
111+
to `GET_MEASUREMENTS`(n) is non-sequentially incremental.
112+
A device may implement non-sequentially increased measurement index.
113+
For example, a device has 3 measurement blocks. The index is 1, 4 and 6.
114+
Then the `Param2` of `GET_MEASUREMENTS`(1) is 1, the `Param2` of `GET_MEASUREMENTS`(2) is 4,
115+
and the `Param2` of `GET_MEASUREMENTS`(3) is 6.
116+
The requester may send a `GET_MEASUREMENTS` with `Param2` 2, but it will get `ERROR` response.
117+
As such, the `GET_MEASUREMENTS` with `Param2` 2 and `ERROR` response are NOT included
118+
in the measurement report.
119+
Once the successfully received number of measurement block is `n`-1, the requester should send
120+
the next `GET_MEASUREMENTS` with `SignatureRequested` set.
121+
122+
### Completeness
123+
124+
All-Measurements report includes all measurements. The compleness is guaranteed.
125+
If One-by-One-Measurements report is used,
126+
the requester should request the total number of measurement block (`n`) first,
127+
then request all `n` measurement blocks one by one incrementally.
128+
129+
### Atomicity
130+
131+
All-Measurements report is a snapshot for the device state. The atomicity is guaranteed.
132+
If One-by-One-Measurements report is used,
133+
the requester should verify the `content change` and recollect One-by-One-Measurements report
134+
in case that the `MeasurementRecord` fields of previous `MEASUREMENTS` responses are changed.
135+
136+
### Freshness
137+
138+
The verifier should input a nonce value and check the nonce value in the measurement report
139+
to ensure the freshness of the measurement report, if digital signature is supported.
140+
141+
### Integrity
142+
143+
The verifier should request a digital signature in the last message `GET_MEASUREMENTS`
144+
for the whole measurement report, if supported by the Responder.
145+
146+
### Device Identity
147+
148+
The verifier should verify the device identity at first (e.g. certificate or raw public key),
149+
then verify the digital signature of the measurement report.
150+

0 commit comments

Comments
 (0)