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 checkpoint key ID to trust root #284

Merged
merged 2 commits into from
Apr 8, 2024

Conversation

haydentherapper
Copy link
Collaborator

@haydentherapper haydentherapper commented Apr 4, 2024

This adds a string to represent the checkpoint key ID for a log, which will differ for ed25519 logs. To simplify client implementation, we will provide this string so that clients don't have to compute the checkpoint key ID themselves using the public key. If it's not set, then a client should assume the log ID is equal to the checkpoint key ID, which is true for ecdsa and rsa logs.

Also cleaned up the text for the checkpoint.

Ref: sigstore/rekor#2062

Summary

Release Note

Documentation

Comment on lines 143 to 152
// The checkpoint key ID, following the specification described here
// for ECDSA and Ed25519 signatures:
// https://github.com/C2SP/C2SP/blob/main/signed-note.md#signatures
// For RSA signatures, the key ID will match the ECDSA format of the hashed
// DER-encoded SPKI public key. Publicly witnessed logs MUST NOT use
// RSA-signed checkpoints, since witnesses do not support RSA signatures.
// This is provided for convenience. Clients can also calculate the checkpoint
// key ID given the log's public key.
message CheckpointKeyId {
// The key ID in a checkpoint, as a prefix to the signature. SHOULD be
// 4 bytes long, as a truncated hash.
bytes key_id = 1 [(google.api.field_behavior) = REQUIRED];
}
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 a minor thing, but this will mark at least the third overlapping type for this in the protobuf-specs 😅

  • common.LogId
  • common.PublicKeyIdentifier
  • (new) common.CheckpointKeyId

I have no objection to a new type in principle, but would either of the pre-existing ones work? PublicKeyIdentifier in particular might be ideal, since it isn't prescriptive in name like LogId and has an arbitrary string hint.

Copy link
Collaborator Author

@haydentherapper haydentherapper Apr 4, 2024

Choose a reason for hiding this comment

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

PublicKeyIdentifier seems workable. What's your preference on string vs bytes? I assume we'd need to base64 or hex encode the content as a string. That was one motivation for bytes, so we didn't have to deal with encoding.

Copy link
Member

Choose a reason for hiding this comment

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

My basic preference is for bytes (a la LogId), but it looks like PublicKeyIdentifier unfortunately already uses string 😅

Given that, my weak pref is for a hex-encoded byte string within that hint, since I believe that's what other hints/users of PublicKeyIdentifier are using. But I don't feel very strongly about that, and I could be convinced that the need to even make a decision here justifies adding a separate CheckpointKeyId type anyways 🙂

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'd prefer bytes too. We could reuse LogId, but we'd need to move the comment on key_id up to the TransparencyLogInstance message. The motivation for a separate type would be to keep the spec comments alongside the message, but I think it can still be clean if moved out to a higher level. WDYT?

Copy link
Member

Choose a reason for hiding this comment

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

We could reuse LogId, but we'd need to move the comment on key_id up to the TransparencyLogInstance message. The motivation for a separate type would be to keep the spec comments alongside the message, but I think it can still be clean if moved out to a higher level. WDYT?

That seems reasonable to me!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I actually like this structure, because we can now use LogId to house both key_id and a future generic_log_id or something like that if we move away from logs represented by their keys.

This adds a string to represent the checkpoint key ID for a log, which
will differ for ed25519 logs. To simplify client implementation, we will
provide this string so that clients don't have to compute the checkpoint
key ID themselves using the public key. If it's not set, then a client
should assume the log ID is equal to the checkpoint key ID, which is
true for ecdsa and rsa logs.

Ref: sigstore/rekor#2062

Signed-off-by: Hayden Blauzvern <[email protected]>
woodruffw
woodruffw previously approved these changes Apr 4, 2024
Copy link
Member

@woodruffw woodruffw left a 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]>
@haydentherapper haydentherapper merged commit 8c3f6a9 into sigstore:main Apr 8, 2024
24 checks passed
@haydentherapper haydentherapper deleted the checkpoint-key-id branch April 8, 2024 15:41
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.

3 participants