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 support for Notary claims #73

Merged
merged 31 commits into from
Jan 19, 2023
Merged

Add support for Notary claims #73

merged 31 commits into from
Jan 19, 2023

Conversation

darracott
Copy link
Contributor

@darracott darracott commented Jan 13, 2023

This PR allows claims generated by notation to be submitted to SCITT.

Note:

  • t_cose does not currently support custom header parameters in crit. This PR brings back a lot of code to work around that limitation so that we can verify Notary claims' signatures without using t_cose.
    • Once t_cose allows custom parameters in crit then we should remove the workaround code which is marked by comments stating the code is "Temporarily needed for notary_verify().".
    • This code is also split into a different commit from the rest of the changes.

app/src/cose.h Outdated Show resolved Hide resolved
app/src/verifier.h Outdated Show resolved Hide resolved
app/src/verifier.h Outdated Show resolved Hide resolved
app/src/verifier.h Show resolved Hide resolved
app/src/cose.h Outdated Show resolved Hide resolved
app/src/cose.h Outdated Show resolved Hide resolved
app/src/cose.h Outdated Show resolved Hide resolved
app/src/cose.h Outdated Show resolved Hide resolved
app/src/cose.h Outdated Show resolved Hide resolved
app/src/cose.h Outdated Show resolved Hide resolved
@letmaik letmaik changed the title WIP: Add support for Notary claims Add support for Notary claims Jan 19, 2023
@letmaik letmaik marked this pull request as ready for review January 19, 2023 14:37
@letmaik letmaik requested a review from plietar January 19, 2023 14:38
app/src/cose.h Outdated Show resolved Hide resolved
Signed-off-by: Maik Riechert <maik.riechert@microsoft.com>
@letmaik letmaik enabled auto-merge (squash) January 19, 2023 18:21
@letmaik letmaik disabled auto-merge January 19, 2023 20:51
@letmaik letmaik merged commit 0d34f9e into main Jan 19, 2023
@letmaik letmaik deleted the jp1/notary branch January 19, 2023 20:51
app/src/verifier.h Show resolved Hide resolved
app/src/cose.h Show resolved Hide resolved

// alg, crit, cty, io.cncf.notary.signingScheme are required.

check_is_accepted_algorithm(phdr, configuration);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO this belongs to the generic verifier code path. All profiles are going to have an algorithm, and we should always enforce this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm open to be convinced about this, at the moment I think it's clearer for each profile to contain all of the validation it requires (including an initial call to do generic validation). Though I don't think it makes much difference either way.

app/src/verifier.h Show resolved Hide resolved
app/src/verifier.h Show resolved Hide resolved
app/src/cose.h Show resolved Hide resolved
app/src/cose.h Show resolved Hide resolved
app/src/cose.h Show resolved Hide resolved
app/src/cose.h Show resolved Hide resolved
app/src/cose.h Show resolved Hide resolved
darracott added a commit that referenced this pull request Jan 30, 2023
Implementing hangover review comments from
#73 addressing
#84

Featuring:
- x5chain (de)serialization 
- QCBOR tweaks
- Cleaning up redundant code  
- Notary spec allows x5chain in the protected header (but currently
notation always puts it in the unprotected headers). We now check for
the x5chain in the protected header of notary claims before the
unprotected header.

---------

Co-authored-by: Paul Liétar <lietarpaul@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants