Skip to content

Commit

Permalink
fix: remove signing certificate output (#160)
Browse files Browse the repository at this point in the history
* remove signing certificate output

Signed-off-by: Asra Ali <asraa@google.com>
  • Loading branch information
asraa authored Jul 22, 2022
1 parent 562cb84 commit 8c4373c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 15 deletions.
9 changes: 1 addition & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,7 @@ $ go run . --help
```bash
$ go run . -artifact-path ~/Downloads/slsa-verifier-linux-amd64 -provenance ~/Downloads/slsa-verifier-linux-amd64.intoto.jsonl -source github.com/slsa-framework/slsa-verifier -tag v1.1.1
Verified signature against tlog entry index 2727751 at URL: https://rekor.sigstore.dev/api/v1/log/entries/8f3d898ef17d9c4c028fe3da09fb786c900bf786361e75432f325b4848fdba24
Signing certificate information:
{
"caller": "slsa-framework/slsa-verifier",
"commit": "5875b0a74f4c04e1f123a3ad81d6c7c5a86860ce",
"job_workflow_ref": "/slsa-framework/slsa-github-generator/.github/workflows/builder_go_slsa3.yml@refs/tags/v1.1.1",
"trigger": "push",
"issuer": "https://token.actions.githubusercontent.com"
}
Verified build using builder https://github.com/slsa-framework/slsa-github-generator/.github/workflows/builder_go_slsa3.yml@refs/tags/v1.1.0 at commit 76a59d8413f27259b97298da91bbb6511fc775d1
PASSED: Verified SLSA provenance
```

Expand Down
10 changes: 3 additions & 7 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"crypto/sha256"
"encoding/base64"
"encoding/hex"
"encoding/json"
"flag"
"fmt"
"io"
Expand Down Expand Up @@ -48,12 +47,6 @@ func verify(ctx context.Context,
return nil, err
}

b, err := json.MarshalIndent(workflowInfo, "", "\t")
if err != nil {
return nil, err
}
fmt.Fprintf(os.Stderr, "Signing certificate information:\n %s\n", b)

// Verify the workflow identity.
if err := pkg.VerifyWorkflowIdentity(workflowInfo, source); err != nil {
return nil, err
Expand All @@ -65,6 +58,9 @@ func verify(ctx context.Context,
return nil, err
}

fmt.Fprintf(os.Stderr, "Verified build using builder https://github.com%s at commit %s\n",
workflowInfo.JobWobWorkflowRef,
workflowInfo.CallerHash)
// Return verified provenance.
return base64.StdEncoding.DecodeString(env.Payload)
}
Expand Down
3 changes: 3 additions & 0 deletions pkg/rekor.go
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,9 @@ func extractCert(e *models.LogEntryAnon) (*x509.Certificate, error) {
}

func intotoEntry(certPem []byte, provenance []byte) (*intotod.V001Entry, error) {
if len(certPem) == 0 {
return nil, fmt.Errorf("no signing certificate found in intoto envelope")
}
cert := strfmt.Base64(certPem)
return &intotod.V001Entry{
IntotoObj: models.IntotoV001Schema{
Expand Down

0 comments on commit 8c4373c

Please sign in to comment.