Add tests for veil-verify.#80
Merged
Merged
Conversation
So far, veil-verify has received very little attention. This PR adds a number of tests; mostly for the critical `attestEnclave` function. This PR fixes #15.
There was a problem hiding this comment.
Pull request overview
Adds unit tests around veil-verify’s enclave attestation flow (notably attestEnclave) to improve confidence in verifier behavior outside an enclave, and standardizes several verifier error values for reliable errors.Is checks.
Changes:
- Add comprehensive table-driven tests for
cmd/veil-verifyattestation request building, TLS binding verification, andattestEnclavefailure modes. - Standardize verifier error returns by introducing exported sentinel errors in
internal/errsand using them in nitro/noop attesters andveil-verify. - Improve noop attester verification by validating document type and nonce.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| internal/errs/errs.go | Adds sentinel verifier errors (PCR mismatch, TLS binding mismatch, nonce/type mismatch, enclave error) for consistent error matching. |
| internal/enclave/noop/attester.go | Adjusts noop attestation encoding to wrap AuxInfo in an enclave.Document and adds nonce/type checks. |
| internal/enclave/noop/attester_test.go | Updates noop attester test to verify nonce matching behavior. |
| internal/enclave/nitro/attester.go | Switches type/nonce mismatch errors to shared sentinel errors. |
| cmd/veil-verify/attestation.go | Returns sentinel errors for enclave HTTP errors, PCR mismatch, and TLS binding mismatch. |
| cmd/veil-verify/attestation_test.go | Adds new tests covering buildReq, attestEnclave success/failure cases, context cancellation, and verifyTLSBinding. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
...as suggested by Copilot.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
So far, veil-verify has received very little attention. This PR adds a number of tests; mostly for the critical
attestEnclavefunction.This PR fixes #15.