-
Notifications
You must be signed in to change notification settings - Fork 568
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
Updates to Timestamp signing and verification #2499
Conversation
Still working on e2e testing and some more unit tests, but just wanted to get this up early for feedback |
Codecov Report
@@ Coverage Diff @@
## main #2499 +/- ##
==========================================
+ Coverage 29.62% 29.94% +0.31%
==========================================
Files 139 139
Lines 8558 8557 -1
==========================================
+ Hits 2535 2562 +27
+ Misses 5666 5640 -26
+ Partials 357 355 -2
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
Now it should be good to go, would like to add some more tests in verify-blob for completeness, but might do that in a follow up. |
@@ -552,6 +525,10 @@ func TestVerifyBlob(t *testing.T) { | |||
expiredLeafPem, true)}, | |||
shouldErr: true, | |||
}, | |||
// TODO: Add tests for TSA: |
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.
This basically removes tests that we had in place. I am not sure we want to change functionality and remove tests. How does it work if I only sign/verify a blob without using tlog ?
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 plan to add some more tests in, but the presence of the bundle is just a way to get the signature and/or other timestamp. If you don't use the tlog, then you must provide the cert/sig the same way you currently do, via --certificate/--signature flags.
This PR should only be adding in tests, and refactoring tests based on the proposed changes.
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.
With these changes, it actually requires less tests since this is only an additional flag that affects verification, rather than modifying codepaths that read in the cert/signature.
2ee4d62
to
a0888e1
Compare
Verified with a local TSA instance:
An unrelated issue is if I skip tlog-upload, then I can't output a certificate ( |
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, I added some nit comments. Ideally, I'd like to see some tests to validate the usage of the rfc3161timestamp with blobs.
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.
Some nits but overall great changes
a0888e1
to
5dd2425
Compare
// TODO: Consider uploading RFC3161 TS to Rekor | ||
|
||
if rfc3161Timestamp == nil { | ||
return nil, fmt.Errorf("rfc3161 timestamp is nil") |
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.
Should we do these checks before signing etc.?
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.
This is a just-in-case check, since TimestampToRFC3161Timestamp
might return nil if respBytes
is empty for some reason.
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.
Yeah. Maybe both wouldn't be a bad idea, up to you
// TODO: Consider uploading RFC3161 TS to Rekor | ||
|
||
if rfc3161Timestamp == nil { | ||
return nil, fmt.Errorf("rfc3161 timestamp is nil") |
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.
Yeah. Maybe both wouldn't be a bad idea, up to you
* Switch to using the raw signature rather than base64 signature for OCI and blob signing * For blob signing, write only the timestamp to disk, not the LocalSignedPayload (since that's already written with the bundle) * For blob verification, expect only a timestamp in the file. If you don't pass a bundle, you'll need to also pass the signature by flag * Some nits from the previous PR Signed-off-by: Hayden Blauzvern <[email protected]>
Signed-off-by: Hayden Blauzvern <[email protected]>
Signed-off-by: Hayden Blauzvern <[email protected]>
Signed-off-by: Hayden Blauzvern <[email protected]>
Signed-off-by: Hayden Blauzvern <[email protected]>
Signed-off-by: Hayden Blauzvern <[email protected]>
Signed-off-by: Hayden Blauzvern <[email protected]>
Signed-off-by: Hayden Blauzvern <[email protected]>
f529c74
to
ae14708
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.
lgtm
Signed-off-by: Hayden Blauzvern [email protected]
Summary
Release Note
Documentation