- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
can somebody suggest an elegant way of marshalling various data from enclaves to the untrusted App?
Let's say we have a struct
struct table_entry {
int id;
uint8_t name[];
uint8_t data[];
int age;
};
and we need to fill the contents inside the enclave. Then, we can define the struct in the EDL file and pass it as a parameter to the enclave in an [in,out] ecall after allocating the struct with the right size in the untrusted App. However, the enclave cannot simply overwrite the name and data buffers as these are allocated in untrusted memory.
trusted {
public void ecall_edit_entry([in, out] struct table_entry* entry);
}
This does not work, if I try to access edited values after the ecall inside the untrusted App, the pointers are invalid.
When we forget the struct and just pass all parts of the struct as own parameters in the ecall, then we need to pass a pointer to each of the four attributes, which is in my opinion not very elegant for numeric types.
Is there a simpler/ more elegant way to pass various data (such as numeric, strings, arrays,..) from and to enclaves?
EDIT: If I use arrays as in the code snipped above, I get the message 'Flexible array is not supported' when trying to compile the project, which makes sense. Still, I would like to have a fix/workaround for this issue.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Mxl01,
Refer to section "Structures, Enums, and Unions" in the chapter "Enclave Definition Language Syntax" in the SGX Developer Reference Guide for your OS. When passing structs to enclaves in ecalls, you don't need to pass a pointer to the struct, pass the struct directly. You can also pass variables directly, you don't have to pass pointers.
Sincerely,
Jesus G.
Intel Customer Support
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Mxl01,
Refer to section "Structures, Enums, and Unions" in the chapter "Enclave Definition Language Syntax" in the SGX Developer Reference Guide for your OS. When passing structs to enclaves in ecalls, you don't need to pass a pointer to the struct, pass the struct directly. You can also pass variables directly, you don't have to pass pointers.
Sincerely,
Jesus G.
Intel Customer Support
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Mxl01,
Do you still need help with this issue?
Sincerely,
Jesus G.
Intel Customer Support
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Mxl01,
We have not heard from you in several days so we will no longer monitor this thread. We hope you were able to resolve your issue. Please start a new thread if you need further help.
Sincerely,
Jesus G.
Intel Customer Support
![](/skins/images/B7BA37F9CE4B52FF7CAE1FB0388839C8/responsive_peak/images/icon_anonymous_message.png)
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page