Intel® Software Guard Extensions (Intel® SGX)
Use hardware-based isolation and memory encryption to provide more code protection in your solutions.

Examples loading enclave from buffer?

Daniel_ˢᵍˣ
New Contributor I
118 Views

Any examples available using sgx_create_enclave_from_buffer_ex and invoking ecalls and ocalls of the loaded enclave?

Labels (1)
0 Kudos
1 Solution
Sahira_Intel
Moderator
60 Views

Hi,

While there are no samples using that function included in the SGX SDK, I am sending you a patch to convert SampleEnclave which uses sgx_create_enclave to sgx_create_enclave_from_buffer_ex (the file type is not supported so I am sending you a PM of it)

You can apply it to the linux-sgx repo. 

 

Sincerely,

Sahira

 

 

View solution in original post

2 Replies
Sahira_Intel
Moderator
61 Views

Hi,

While there are no samples using that function included in the SGX SDK, I am sending you a patch to convert SampleEnclave which uses sgx_create_enclave to sgx_create_enclave_from_buffer_ex (the file type is not supported so I am sending you a PM of it)

You can apply it to the linux-sgx repo. 

 

Sincerely,

Sahira

 

 

Daniel_ˢᵍˣ
New Contributor I
31 Views

Hello,

The patched sample worked, thank you.

 

A related question:

In terms of security, is there an advantage in using mmap instead of reading the enclave into a buffer (fopen + fread) and using that buffer in sgx_create_enclave_from_buffer_ex?

Reply