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

Is there a way to invoke code in an enclave programmatically? #42

Open
ssavvides opened this issue Jun 21, 2016 · 5 comments
Open

Is there a way to invoke code in an enclave programmatically? #42

ssavvides opened this issue Jun 21, 2016 · 5 comments

Comments

@ssavvides
Copy link
Contributor

ssavvides commented Jun 21, 2016

Is there a way to invoke code in an enclave programmatically, say through a c function, and get the result back?

@johnmwshih
Copy link
Contributor

There is already a in-enclave libc (musl libc) you can directly use. If the function contains syscalls which is not supported inside the enclave, you may leverage trampoline mechanism to do so.

@tsgates
Copy link
Member

tsgates commented Jun 22, 2016

We don't have that kind of offloading/API model yet.

Taesoo

On 06/21/16 at 01:31pm, Savvas Savvides wrote:

Is there a way to invoke code in an enclave programmatically, say through a c function and get the result back?


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
#42

@dongsuh
Copy link
Contributor

dongsuh commented Jun 22, 2016

Tor example contains an RPC-like interface. But it's different from Windows
SGX SDK interface in that it actually is an RPC to an existing enclave.

Dongsu Han
Assistant Professor, Department of Electrical Engineering
Korea Advanced Institute of Science and Technology
291 Daehak-ro, Yuseong-gu, Daejeon 305-701, Korea
Office: Room 814, IT Convergence Building (N1)
Tel: +82-42-350-7431 Email: [email protected]

On Wed, Jun 22, 2016 at 5:31 AM, Savvas Savvides [email protected]
wrote:

Is there a way to invoke code in an enclave programmatically, say through
a c function and get the result back?


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#42, or mute the thread
https://github.com/notifications/unsubscribe/AByS_2gqnDvQ5EjhxTRxCWTCc1FUqtHQks5qOEoQgaJpZM4I7JDV
.

@ssavvides
Copy link
Contributor Author

Could you point me to that example please?

@ssavvides ssavvides reopened this Jun 22, 2016
@inasmkim
Copy link
Contributor

In opensgx/Tor directory, there is a Tor program that communicates with an
enclave.
For example, in Tor/tor-0.2.5.10/src/tools/tor-gencert.c, it request an
enclave to create a RSA key pairs for Tor nodes.
It communicates with the enclave code located in
opensgx/user/test/tor/sgx-tor.c file.
In this case, we use pipe for the communication between an enclave and
application.
After establishing pipe with pipe_init() and pipe_open() (in sgx-tor.c),
data is communicated with read() and write() libc functions with the pipe
port.
You can refer the source code in these files.
For the general libc function, as Mingwei mentioned, we leverage functions
that are used in Tor to the trampoline.
(See user/sgx-trampoline.c and the source code of function in musl-libc
(libsgx/musl-libc).
Checking the implementation of malloc() in musl-libc is a good example to
follow how we implement the trampoline interface.

Thanks,
Seongmin

2016-06-22 22:51 GMT+09:00 Savvas Savvides [email protected]:

Reopened #42 #42.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#42 (comment), or mute
the thread
https://github.com/notifications/unsubscribe/AIPbTjmZR4MNgPMrTUMqomvPN206ddgjks5qOT3lgaJpZM4I7JDV
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants