Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

workaround for OE_JSON_INFO_PARSE_ERROR #171

Merged
merged 1 commit into from
Sep 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions 3rdparty/openenclave/ert.patch
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,58 @@ index 0f97c1c6f..fd5ad7d6c 100644
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# Do not use, for example, `-std=gnu++14`.
set(CMAKE_CXX_EXTENSIONS OFF)
diff --git a/common/sgx/tcbinfo.c b/common/sgx/tcbinfo.c
index 127f313ad..9b4bcd984 100644
--- a/common/sgx/tcbinfo.c
+++ b/common/sgx/tcbinfo.c
@@ -1715,26 +1715,41 @@ oe_result_t oe_parse_qe_identity_info_json(
itr = _skip_ws(itr, end);
OE_CHECK(_read('{', &itr, end));

+ // EDG: workaround until
+ // https://github.com/openenclave/openenclave/issues/5013 is properly fixed
+ int signature_read = 0;
+ if (OE_JSON_INFO_PARSE_ERROR !=
+ _read_property_name_and_colon("signature", &itr, end))
+ {
+ OE_TRACE_VERBOSE("Reading signature");
+ OE_CHECK(_read_hex_string(
+ &itr, end, parsed_info->signature, sizeof(parsed_info->signature)));
+ OE_CHECK(_read(',', &itr, end));
+ signature_read = 1;
+ }
+
if (OE_JSON_INFO_PARSE_ERROR !=
_read_property_name_and_colon("enclaveIdentity", &itr, end))
{
OE_TRACE_VERBOSE("Reading enclaveIdentity");
OE_CHECK(_read_qe_identity_info_v2(
info_json, &itr, end, platform_tcb_level, parsed_info));
- OE_CHECK(_read(',', &itr, end));
}
else
{
OE_TRACE_VERBOSE("Reading qeIdentity");
OE_CHECK(_read_property_name_and_colon("qeIdentity", &itr, end));
OE_CHECK(_read_qe_identity_info_v1(&itr, end, parsed_info));
- OE_CHECK(_read(',', &itr, end));
}

- OE_TRACE_VERBOSE("Reading signature");
- OE_CHECK(_read_property_name_and_colon("signature", &itr, end));
- OE_CHECK(_read_hex_string(
- &itr, end, parsed_info->signature, sizeof(parsed_info->signature)));
+ if (!signature_read)
+ {
+ OE_CHECK(_read(',', &itr, end));
+ OE_TRACE_VERBOSE("Reading signature");
+ OE_CHECK(_read_property_name_and_colon("signature", &itr, end));
+ OE_CHECK(_read_hex_string(
+ &itr, end, parsed_info->signature, sizeof(parsed_info->signature)));
+ }
OE_CHECK(_read('}', &itr, end));

if (itr == end)
diff --git a/debugger/gdb-extension/load_symbol_cmd.py b/debugger/gdb-extension/load_symbol_cmd.py
index ca0e0f893..ea04aa53b 100644
--- a/debugger/gdb-extension/load_symbol_cmd.py
Expand Down
Loading