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

Add untrusted side of stderr from enclave #15

Merged
merged 5 commits into from
Jan 13, 2023
Merged

Conversation

nick-mobilecoin
Copy link
Collaborator

Add an ocall implementation ocall_stderr() which is where stderr from an enclave will be directed to. By default any content passed to the ocall_stderr() will be directed to the untrusted (host) stderr. Consumers of the crate can direct this output by providing a WriteAll implementation to stderr_write_all().

@nick-mobilecoin nick-mobilecoin self-assigned this Dec 13, 2022
@github-actions github-actions bot added rust Pull requests that update rust code size/XL Extra-Large PRs labels Dec 13, 2022
io/src/lib.rs Outdated Show resolved Hide resolved
@nick-mobilecoin
Copy link
Collaborator Author

@jcape When/if you get a chance might do a quick look over and see if this is "a piece" you were thinking for providing the panic with stack traces out of the enclave

Copy link
Contributor

@awygle awygle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me. I agree with the comment about prioritizing the enclave build tools at this time, this looks like a lot of copy-paste.

io/untrusted/src/lib.rs Outdated Show resolved Hide resolved
nick-mobilecoin and others added 2 commits January 10, 2023 10:33
Add an ocall implementation `ocall_stderr()` which is where stderr from
an enclave will be directed to. By default any content passed to the
`ocall_stderr()` will be directed to the untrusted (host) stderr.
Consumers of the crate can direct this output by providing a `WritAll`
implementation to `stderr_write_all()`.
Copy link
Contributor

@NotGyro NotGyro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me.

Copy link
Contributor

@jcape jcape left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you'll probably need to change pcl_key.bin's attributes directly as well, unfortunately

@nick-mobilecoin
Copy link
Collaborator Author

I think you'll probably need to change pcl_key.bin's attributes directly as well, unfortunately

Still looking, but my hunch is github is caching the previous "no-binary" version

sgx-std git:(nick/stderr) git check-attr -a test_enclave/src/pcl_key.bin
test_enclave/src/pcl_key.bin: binary: set
test_enclave/src/pcl_key.bin: diff: unset
test_enclave/src/pcl_key.bin: merge: unset
test_enclave/src/pcl_key.bin: text: unset

@jcape
Copy link
Contributor

jcape commented Jan 13, 2023

Maybe needs a push?

@nick-mobilecoin
Copy link
Collaborator Author

nick-mobilecoin commented Jan 13, 2023

Tried doing the leap frog but it still fails, most things I run across say that github is using git's internal mechanism which gives me

sgx-std git:(nick/stderr) ✗ git diff origin/main
...
diff --git a/test_enclave/src/pcl_key.bin b/test_enclave/src/pcl_key.bin
new file mode 100644
index 0000000..508ec12
Binary files /dev/null and b/test_enclave/src/pcl_key.bin differ

So git doesn't seem to care that the attributes file was added after in the same set of commits

Copy link
Contributor

@jcape jcape left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, OK, I guess we'll see if it works when we diff it later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
github_actions Pull requests that update github actions rust Pull requests that update rust code size/XL Extra-Large PRs
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants