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 a SignedTimestampNote #397

Merged
merged 3 commits into from
Jul 29, 2021
Merged

Conversation

asraa
Copy link
Contributor

@asraa asraa commented Jul 28, 2021

Signed-off-by: Asra Ali asraa@google.com

Adds a new SignedTimestampNote object. A TimestampNote (a "timestamp query") can be signed by Rekor to produce a SignedTimestampNote (a "timestamp response).

I separated this PR out from two other major changes:

  • Adding a storage time for a TimestampNote
  • Adding the client/server code for generating a timestamp note

Because I'm stuck with OpenApi issues on the latter. Will commit the storage one separately.

I also realized the timestamp_note.go got accidentally committed in an earlier PR! So this updates this and adds tests.

TimestampNotes contain the following info:

type TimestampNote struct {
	// Ecosystem is the ecosystem/version string
	Ecosystem string
	// MessageImprint is the hash of the message to timestamp, of the form sha256:<sha>
	MessageImprint string
	// Nonce is a short random  bytes to prove response freshness
	Nonce []byte
	// Time is the timestamp to imprint on the message
	Time time.Time
	// Radius is the time in microseconds used to indicate certainty
	Radius int64
	// CertChainRef is a reference URL to the valid timestamping cert chain used to sign the response
	CertChainRef *url.URL
	// OtherContent is any additional data to be included in the signed payload; each element is assumed to be one line
	OtherContent []string
}

A Signed one looks like:

Timestamp Note v0
sha256:e4ba5cbd251c98e6cd1c23f126a3b81d8d8328abc95387229850952b3ef9f904
ew==
2021-07-26T00:00:00Z
123
http://localhost:3000/api/v1/timestamp/certchain

\u2014 name pOhM+S/mYjEYtQsOF4lL8o/dR+nbjoz5Cvg/n486KIismpVq0s4wxBaakmryI7zThjWAqRUyECPL3WSEcVDEBQ==

asraa added 2 commits July 28, 2021 11:41
Signed-off-by: Asra Ali <asraa@google.com>
Signed-off-by: Asra Ali <asraa@google.com>
hash = split[1]
}

s := struct {
Copy link
Member

Choose a reason for hiding this comment

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

this is fine, would it make sense to expose/export this struct somewhere else though?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, might not be the best file name but done, and shared code with the same validation in the client

Signed-off-by: Asra Ali <asraa@google.com>
Copy link
Member

@bobcallaway bobcallaway left a comment

Choose a reason for hiding this comment

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

lgtm

@dlorenc dlorenc merged commit db0e418 into sigstore:main Jul 29, 2021
@cpanato cpanato added this to the v0.4.0 milestone Aug 4, 2021
@asraa asraa deleted the add-new-timestamp-note-format branch August 20, 2021 18:37
@cpanato cpanato modified the milestones: v0.4.0, v1.0.0 Aug 25, 2021
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.

4 participants