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

Consider if MrEnclave should be returned from ReportBody::mr_enclave() #286

Closed
Tracked by #7
nick-mobilecoin opened this issue Feb 28, 2023 · 1 comment
Closed
Tracked by #7
Assignees

Comments

@nick-mobilecoin
Copy link
Collaborator

Currently ReportBody::mr_enclave(), and ReportBody::mr_signer(), return Measurement.
This causes clients to ensure that they contain the proper types

        let Measurement::MrEnclave(mr_enclave) = report_body.mr_enclave() else {
            panic!("`mr_enclave()` should return a Measurement::MrEnclave");
        };

This isn't very ergonomic. It looks like during initial development of the core types Measurement was a generic wrapper around sgx_measurement_t and it was later updated to be an enum to prevent clients from mixing up MRENCLAVE and MRSIGNER values.

Suggest changing mr_enclave() and mr_signer() to return the specific types. It may be worth removing Measurement as well as it's probably not very useful as a container for either value.

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

No branches or pull requests

1 participant