Skip to content

Commit 1463f95

Browse files
committed
expose TCB level index as claim
Signed-off-by: Thomas Tendyck <[email protected]>
1 parent b99ad12 commit 1463f95

File tree

1 file changed

+69
-2
lines changed

1 file changed

+69
-2
lines changed

3rdparty/openenclave/ert.patch

+69-2
Original file line numberDiff line numberDiff line change
@@ -168,10 +168,19 @@ index 0f97c1c6f..fd5ad7d6c 100644
168168
# Do not use, for example, `-std=gnu++14`.
169169
set(CMAKE_CXX_EXTENSIONS OFF)
170170
diff --git a/common/sgx/tcbinfo.c b/common/sgx/tcbinfo.c
171-
index 127f313ad..9b4bcd984 100644
171+
index 127f313ad..da070fc2e 100644
172172
--- a/common/sgx/tcbinfo.c
173173
+++ b/common/sgx/tcbinfo.c
174-
@@ -1715,26 +1715,41 @@ oe_result_t oe_parse_qe_identity_info_json(
174+
@@ -781,6 +781,8 @@ static oe_result_t _read_tcb_info_tcb_level_v2_or_v3(
175+
if (*itr < end && **itr == ']')
176+
break;
177+
OE_CHECK(_read(',', itr, end));
178+
+
179+
+ ++platform_tcb_level->index; // EDG: remember the index within the array
180+
}
181+
182+
OE_CHECK(_read(']', itr, end));
183+
@@ -1715,26 +1717,41 @@ oe_result_t oe_parse_qe_identity_info_json(
175184
itr = _skip_ws(itr, end);
176185
OE_CHECK(_read('{', &itr, end));
177186

@@ -219,6 +228,39 @@ index 127f313ad..9b4bcd984 100644
219228
OE_CHECK(_read('}', &itr, end));
220229

221230
if (itr == end)
231+
diff --git a/common/sgx/tcbinfo.h b/common/sgx/tcbinfo.h
232+
index ae1508d45..38e6b62b7 100644
233+
--- a/common/sgx/tcbinfo.h
234+
+++ b/common/sgx/tcbinfo.h
235+
@@ -89,6 +89,9 @@ typedef struct _oe_tcb_info_tcb_level
236+
237+
//! Total size of all the advisoryIDs.
238+
size_t advisory_ids_size;
239+
+
240+
+ // EDG: index of this TCB level in the array within the TCB info JSON
241+
+ uint32_t index;
242+
} oe_tcb_info_tcb_level_t;
243+
244+
#define OE_SGX_FMSPC_SIZE 6
245+
diff --git a/common/sgx/verifier.c b/common/sgx/verifier.c
246+
index ae4e42357..af7389642 100644
247+
--- a/common/sgx/verifier.c
248+
+++ b/common/sgx/verifier.c
249+
@@ -476,6 +476,14 @@ static oe_result_t _fill_with_known_claims(
250+
sgx_endorsements->items[OE_SGX_ENDORSEMENT_FIELD_TCB_INFO]
251+
.size));
252+
253+
+ // EDG: TCB info index
254+
+ OE_CHECK(oe_sgx_add_claim(
255+
+ &claims[claims_index++],
256+
+ OE_CLAIM_SGX_TCB_INFO_INDEX,
257+
+ sizeof(OE_CLAIM_SGX_TCB_INFO_INDEX),
258+
+ &local_platform_tcb_level.index,
259+
+ sizeof(local_platform_tcb_level.index)));
260+
+
261+
// TCB issuer chain
262+
OE_CHECK(oe_sgx_add_claim(
263+
&claims[claims_index++],
222264
diff --git a/debugger/gdb-extension/load_symbol_cmd.py b/debugger/gdb-extension/load_symbol_cmd.py
223265
index ca0e0f893..ea04aa53b 100644
224266
--- a/debugger/gdb-extension/load_symbol_cmd.py
@@ -1215,6 +1257,31 @@ index 2471fe6f1..f7296ef7d 100644
12151257
+
12161258
return result;
12171259
}
1260+
diff --git a/include/openenclave/attestation/sgx/evidence.h b/include/openenclave/attestation/sgx/evidence.h
1261+
index 4a19d4187..f0246300a 100644
1262+
--- a/include/openenclave/attestation/sgx/evidence.h
1263+
+++ b/include/openenclave/attestation/sgx/evidence.h
1264+
@@ -145,16 +145,18 @@ OE_EXTERNC_BEGIN
1265+
*/
1266+
// SQX quote verification collaterals.
1267+
#define OE_CLAIM_SGX_TCB_INFO "sgx_tcb_info"
1268+
+#define OE_CLAIM_SGX_TCB_INFO_INDEX "sgx_tcb_info_index"
1269+
#define OE_CLAIM_SGX_TCB_ISSUER_CHAIN "sgx_tcb_issuer_chain"
1270+
#define OE_CLAIM_SGX_PCK_CRL "sgx_pck_crl"
1271+
#define OE_CLAIM_SGX_ROOT_CA_CRL "sgx_root_ca_crl"
1272+
#define OE_CLAIM_SGX_CRL_ISSUER_CHAIN "sgx_crl_issuer_chain"
1273+
#define OE_CLAIM_SGX_QE_ID_INFO "sgx_qe_id_info"
1274+
#define OE_CLAIM_SGX_QE_ID_ISSUER_CHAIN "sgx_qe_id_issuer_chain"
1275+
-#define OE_SGX_OPTIONAL_CLAIMS_SGX_COLLATERALS_COUNT 7
1276+
+#define OE_SGX_OPTIONAL_CLAIMS_SGX_COLLATERALS_COUNT 8
1277+
// SGX PCESVN.
1278+
#define OE_CLAIM_SGX_PCE_SVN "sgx_pce_svn"
1279+
-#define OE_SGX_OPTIONAL_CLAIMS_COUNT 8
1280+
+#define OE_SGX_OPTIONAL_CLAIMS_COUNT \
1281+
+ (OE_SGX_OPTIONAL_CLAIMS_SGX_COLLATERALS_COUNT + 1)
1282+
1283+
// Additional SGX specific claim: for the report data embedded in the SGX quote.
1284+
12181285
diff --git a/include/openenclave/bits/fs.h b/include/openenclave/bits/fs.h
12191286
index f7220c44f..d3623bfa1 100644
12201287
--- a/include/openenclave/bits/fs.h

0 commit comments

Comments
 (0)