-
Notifications
You must be signed in to change notification settings - Fork 11.3k
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
feat: add utility to verify attestation #20017
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
3 Skipped Deployments
|
0a7034c
to
8f86df1
Compare
8f86df1
to
90a91c6
Compare
f056421
to
de1eacd
Compare
0f9b9a8
to
0a911f0
Compare
7734654
to
63320e2
Compare
272320e
to
953eb3a
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 great, left small naming suggestions
impl CoseSign1 { | ||
/// Parse CBOR bytes into struct. Adapted from <https://github.com/awslabs/aws-nitro-enclaves-cose/blob/main/src/sign.rs> | ||
pub fn parse_and_validate(bytes: &[u8]) -> Result<Self, NitroAttestationVerifyError> { | ||
let tagged_value: ciborium::value::Value = ciborium::de::from_reader(bytes) |
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.
general question - is ciborium decoding linear in the input? (if it's quadratic or worse we might want more checks)
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.
yes its linear- the parsing basically iterate the entire document_map per variable name to parse each value. we charge per bytes of the total attestation bytes.
however for the pcrs, it is quadratic wrt to the number of pcrs here. but there should only be 6 valid indices so its bounded.
cbb1b1f
to
d2525a1
Compare
each cert is verified roughly with the time (3814 - 922 - 6) / 4 = 721 µs |
d2525a1
to
c50ee3b
Compare
c50ee3b
to
fe48069
Compare
fe48069
to
0808288
Compare
0808288
to
391f1a4
Compare
391f1a4
to
ae78b72
Compare
ae78b72
to
4079db6
Compare
Description
Describe the changes or additions included in this PR.
Test plan
How did you test the new or updated feature?
Release notes
Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required.
For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates.