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

Time provisioning inside PDO enclaves #500

Open
bvavala opened this issue Oct 11, 2024 · 1 comment
Open

Time provisioning inside PDO enclaves #500

bvavala opened this issue Oct 11, 2024 · 1 comment

Comments

@bvavala
Copy link
Member

bvavala commented Oct 11, 2024

A PDO enclave, in general, does not deal with time, but certificate expiration verification within sgx/openssl does.
Here is an overview of:

  • how time is handled within sgx/openssl and the untrusted environment;
  • what happens when the dependency on untrusted time is removed;
  • and how to remove it safely.

First, X509_verify_cert (an ssl function used, for instance, to check IAS verification reports) checks for expired certificates. Even within an enclave, where presumably trusted time is not available, the function works properly.

This is due to the (untrusted) time provided by sgxssl, through the edge call in its EDL. Such EDL is imported in essentially all enclaves used in PDO, namely in the eservice, pservice and test enclaves.

Second, the edge API can be removed unsafely. Without the edge API, the enclave will likely compile, and likely crash when time is needed. This is due to the implementation of this assert which will check for the availability of the ocall before calling it. Note that the ocall will still be available in the untrusted sgx/openssl library, but there would be not call initiated from the enclave.

Third, instead, the edge API can be safely removed by making sure that ssl does not request the time from the system (and hence the edge API). In the case of certificate expiration verification, this can be achieved through the use of the X509_V_FLAG_USE_CHECK_TIME flag and setting the time against which to check the expiration, from within the enclave.

This brings to the question: how to best provision time inside an enclave for such verifications (and remove the ocalls)?
(comments are welcome)

@g2flyer
Copy link
Contributor

g2flyer commented Oct 23, 2024

Also related to above is time-handling for JWT which requires a ignore-time patch in SGXDataCenterAttestationPrimitives which is used also in our PR #501

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

2 participants