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 validation of data and aad values #165

Merged
merged 2 commits into from
Oct 17, 2022

Conversation

nick-mobilecoin
Copy link
Collaborator

Previously the data and aad values to the
mc-sgx-tservicer::SealedBuilder were only checked by the SGX SDK.
This resulted in a generic InvalidParamter error that had no context.
Now the data and aad values are ensured to be valid when they are
provided to the SealedBuilder.

CHANGELOG.md Outdated Show resolved Hide resolved
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. I like how you're validating it implicitly when the SealedBuilder is initialized, this feels more reasonable than having a validate_inputs() method.

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 fine in terms of implementing the checks but as James said on #164, we should have specific error discriminants for these errors rather than everything being InvalidParameter (although the different error strings are an improvement)

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.

This PR is fine (assuming changes per comments on #164), but I'm thinking that we can dump EnclaveMemory in favor of a bare function that does the same job for both Sized and Unsized types using core::mem::size_of_val()

tservice/src/seal.rs Outdated Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
tservice/Cargo.toml Show resolved Hide resolved
trts/src/lib.rs Show resolved Hide resolved
@nick-mobilecoin nick-mobilecoin force-pushed the feature/sealing_parameter_validation branch 2 times, most recently from 15b47a1 to 9cc6746 Compare October 14, 2022 22:10
Previously the `data` and `aad` values to the
`mc-sgx-tservicer::SealedBuilder` were only checked by the SGX SDK.
This resulted in a generic `InvalidParamter` error that had no context.
Now the `data` and `aad` values are ensured to be valid when they are
provided to the `SealedBuilder`.
@nick-mobilecoin
Copy link
Collaborator Author

nick-mobilecoin commented Oct 17, 2022

Graphite Merge Job

Current status: ✅ Merged

This pull request was successfully merged as part of a stack.

This comment was auto-generated by Graphite.

Job Reference: MYnB2IroAk46QVSy8SQp

Base automatically changed from feature/sealing_error to main October 17, 2022 21:11
@nick-mobilecoin nick-mobilecoin merged commit 2c88cd5 into main Oct 17, 2022
@nick-mobilecoin nick-mobilecoin deleted the feature/sealing_parameter_validation branch October 17, 2022 21:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/L PRs with more than 500 lines of changes
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants