-
Notifications
You must be signed in to change notification settings - Fork 7
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 specific errors for sealing failures #164
Conversation
Current dependencies on/for this PR:
This comment was auto-generated by Graphite. |
This initial change only updates the current error handling in sealing to use a seal specific error. |
b1a93cd
to
86abeaf
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me - I can see ways that it could be more specific, but having these broader categories of errors could be much easier to work with.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think these errors are pointing in the wrong direction, unfortunately. The real issue that needs solving is "give the caller a more descriptive/fine-grained error code when the SDK would return something obtuse like INVALID_PARAMETER
."
Like, INVALID_PARAMETER could mean "buffer not in enclave" or "buffer length too short" or "plaintext + mac length > u32::MAX" or any number of things, I'm saying you shouldn't have to read the SGX FFI PDF to figure that out, it should be immediately evident, even if that means duplicating the input validation that the SDK is doing in our rust code.
Codecov Report
@@ Coverage Diff @@
## main #164 +/- ##
==========================================
- Coverage 84.31% 83.79% -0.52%
==========================================
Files 44 44
Lines 2397 2444 +47
==========================================
+ Hits 2021 2048 +27
- Misses 376 396 +20
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, some minor rewording of the Display
format strings. For the logging case, it's generally prefered to keep them as a single sentence with no line breaks, due to how nested errors are displayed. e.g. an error hierarchy like:
FooError::Frobnicate(FrobnicateError::BlahBityBlah(BlahError::WastefulAlloc)
will end up getting printed as:
"Foo error while frobnicating: Frobincating requires blahbityblah: Blah is larger than necessary."
275354d
to
296ff6f
Compare
Add errors that provide more information on why a failure to seal data occurs.
Co-authored-by: James Cape <[email protected]>
296ff6f
to
b3f3571
Compare
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 |
Add errors that provide more information on why a failure to seal data
occurs.