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

Help understanding of EGO #167

Open
emrahsariboz opened this issue Sep 11, 2022 · 3 comments
Open

Help understanding of EGO #167

emrahsariboz opened this issue Sep 11, 2022 · 3 comments

Comments

@emrahsariboz
Copy link

emrahsariboz commented Sep 11, 2022

Thanks for the great product. I would appreciate it if anyone could verify if my understanding of EGo's DCAP-based attestation works correct or wrong.

I understand that EGo uses DCAP-based attestation rather than EPID. And EGo depends on Open Enclave regarding the details of Quoting Enclave.

However, one thing that does not add up is the fact that remote attestation sample generates a report before the quote is generated and signed by Provisioning Certification Enclave (PCE).

  1. My understanding of DCAP was the quote will be generated and signed by the PCE, which will then become a report. Could you please help me understand this?

  2. Also, where in the code EGo calls the OE APIs regarding QE operations? I don't see any submodule or anything that will use OE. Can you point me to the file/repo?

  3. Again, in the remote attestation sample, how does the client retrieves the TCB information when verifying the cached attestation collateral from PCCS using Azure Quote Provider? In other words, how does client knows which attestation collateral to retrieve? Server never sends this information to help client verify.

@thomasten
Copy link
Member

Hi,

  1. Yes, that is what happens in GetRemoteReport internally.
  2. An emulated syscall (doesn't leave the enclave) is done here

    ego/enclave/ert.go

    Lines 46 to 62 in 355facf

    func GetRemoteReport(reportData []byte) ([]byte, error) {
    if len(reportData) > maxReportData {
    return nil, errReportDataTooLarge
    }
    var report *C.uint8_t
    var reportSize C.size_t
    res, _, errno := syscall.Syscall6(
    sysGetRemoteReport,
    uintptr(unsafe.Pointer(&reportData[0])),
    uintptr(len(reportData)),
    0,
    0,
    uintptr(unsafe.Pointer(&report)),
    uintptr(unsafe.Pointer(&reportSize)),
    )

    and dispatched here to OE
    https://github.com/edgelesssys/edgelessrt/blob/4894b31b918e3b129aa1cbf96b366bea398c2085/src/ertlibc/syscall.cpp#L102-L110
  3. AFAIK the client can get this info from the report. You may study the OE verification implementation to see this.

@emrahsariboz
Copy link
Author

Thank you! This is very helpful. Couple more question:

  1. I see the the code on OE. How is the signing operation (signing the report with Provisioning Certificate Key) is done in EGo? Where does it sign in GetRemoteReport? Does it retrieve PCK from PCCS using Azure DCAP client?

  2. Rookie question. Why does DCAP also called ECDSA? Is it because PCK key is ECDSA?

@thomasten
Copy link
Member

  1. That all happens in OE's oe_get_report_v2. EGo just wraps OE's attestation API.
  2. See chapter 2.1 of https://download.01.org/intel-sgx/latest/dcap-latest/linux/docs/Intel_SGX_ECDSA_QuoteLibReference_DCAP_API.pdf

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