Skip to content
Snippets Groups Projects
Unverified Commit 0cb3cdb5 authored by Bob Callaway's avatar Bob Callaway Committed by GitHub
Browse files

Add Log ID into SET verification step (#309)


* Add Log ID into SET verification step

This also causes the upload command to return a non-zero error code
because of a verification failure.

Fixes #308

Signed-off-by: default avatarBob Callaway <bob.callaway@gmail.com>

* since this is only done on upload, we can assume it is set

Signed-off-by: default avatarBob Callaway <bob.callaway@gmail.com>
parent 7e3d950f
No related branches found
No related tags found
No related merge requests found
......@@ -19,7 +19,6 @@ import (
"context"
"crypto/ecdsa"
"crypto/sha256"
"errors"
"fmt"
"os"
......@@ -28,6 +27,7 @@ import (
"github.com/spf13/cobra"
"github.com/spf13/viper"
"github.com/pkg/errors"
"github.com/sigstore/rekor/cmd/rekor-cli/app/format"
"github.com/sigstore/rekor/pkg/generated/client"
"github.com/sigstore/rekor/pkg/generated/client/entries"
......@@ -118,7 +118,7 @@ var uploadCmd = &cobra.Command{
// verify log entry
if verified, err := verifyLogEntry(ctx, rekorClient, logEntry); err != nil || !verified {
fmt.Fprintf(os.Stderr, "unable to verify entry was added to log: %v", err)
return nil, errors.Wrap(err, "unable to verify entry was added to log")
}
return &uploadCmdOutput{
......@@ -137,7 +137,9 @@ func verifyLogEntry(ctx context.Context, rekorClient *client.Rekor, logEntry mod
IntegratedTime: logEntry.IntegratedTime,
LogIndex: logEntry.LogIndex,
Body: logEntry.Body,
LogID: logEntry.LogID,
}
payload, err := le.MarshalBinary()
if err != nil {
return false, err
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment