Skip to content
This repository was archived by the owner on Feb 26, 2024. It is now read-only.

Store gem signatures in a hashedrekord#63

Merged
rochlefebvre merged 3 commits into
mainfrom
use-hashedrekord
Feb 15, 2022
Merged

Store gem signatures in a hashedrekord#63
rochlefebvre merged 3 commits into
mainfrom
use-hashedrekord

Conversation

@rochlefebvre
Copy link
Copy Markdown

When uploading a signature into Rekor, we don't need to send the entire artifact contents if we use a hashed rekord instead of a rekord. This speeds up the signing operation for larger gem files. It also removes any limit on the size of the signed gem (currently either 32MB or 128MB).

Besides having a new type, the resulting log entry body is the same. Rekor does not keep a copy of the artifact itself.

See this thread on sigstore Slack if you can.

require "rubygems/sigstore/rekor/log_entry"
require "rubygems/sigstore/rekor/signature"

class Gem::Sigstore::Rekor::HashedRekord < Gem::Sigstore::Rekor::LogEntry
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

As far as our signature verification logic is concerned, hasked rekords and rekords look the same. I moved all of the signature code into a module. Neither Rekord nor HashedRekord have additional code at the moment.

Copy link
Copy Markdown

@jchestershopify jchestershopify left a comment

Choose a reason for hiding this comment

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

LGTM. It's nice that we could pull so much into a shared module.

@rochlefebvre rochlefebvre merged commit 1fd5157 into main Feb 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants