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

Dump attested TLS credentials upon starting up #108

Draft
wants to merge 1 commit into
base: oe_port
Choose a base branch
from

Conversation

jxyang
Copy link
Contributor

@jxyang jxyang commented Apr 30, 2020

No description provided.

@letmaik
Copy link
Contributor

letmaik commented Apr 30, 2020

For each failure mode, could you add a SGXLKL_VERBOSE line?

@letmaik
Copy link
Contributor

letmaik commented Apr 30, 2020

I wonder if this should be an optional feature enabled in the app config since it adds a strict dependency to DCAP and hence network.

@davidchisnall
Copy link
Contributor

[ Duplicating our private discussion here ]

We need to address the layering here before it can be merged. We should not be introducing new code into src/enclave that has nontrivial dependencies on libc. Probably the best structure for this is to:

  • Provide functionality in src/enclave for getting the raw attestation information, without mbedTLS dependencies. This can talk to OE APIs directly.
  • Modify LKL to allow exposing that somewhere in sysfs (or possibly as a device node) by calling the APIs added in src/enclave.
  • Add the userspace component that reads the raw data from the kernel-owned file, uses mbedTLS to generate the certificates, and puts them in a well-known location.

Copy link
Collaborator

@Pengpeng-Microsoft Pengpeng-Microsoft left a comment

Choose a reason for hiding this comment

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

[ Duplicating our private discussion here ]

We need to address the layering here before it can be merged. We should not be introducing new code into src/enclave that has nontrivial dependencies on libc. Probably the best structure for this is to:

  • Provide functionality in src/enclave for getting the raw attestation information, without mbedTLS dependencies. This can talk to OE APIs directly.
  • Modify LKL to allow exposing that somewhere in sysfs (or possibly as a device node) by calling the APIs added in src/enclave.
    @davidchisnall , which flow triggers sysfs here?
  • Add the userspace component that reads the raw data from the kernel-owned file, uses mbedTLS to generate the certificates, and puts them in a well-known location.
    Is it still triggered by startmain in enclave_init.c as in the current change?

if (private_key_size_out)
*private_key_size_out = 0;

if (!cert_out || !cert_size_out || !private_key_out ||
Copy link
Collaborator

Choose a reason for hiding this comment

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

Not clear about the logics here.

From lines 163-173, all the values pointed by these out parameter pointers are assigned NULL or 0 before the 'if' logic checks pointers and sends the flow to 'done'. Who will be manage the memory pointed by these pointers before nullifying them?

}


static int _write_file(const char* path, const void* data, size_t size)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Both this (_write_file) and _load_file are pretty general utility functions. Do we have a more common place for them than gencreds.c?

@jxyang jxyang marked this pull request as draft August 4, 2020 00:47
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

Successfully merging this pull request may close these issues.

4 participants