-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: laurentsimon <[email protected]>
- Loading branch information
1 parent
8c0030a
commit 5e75163
Showing
3 changed files
with
15 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,7 +46,8 @@ type Npm struct { | |
publishAttestation *attestation | ||
} | ||
|
||
var builderGitHubRunnerID = "https://github.com/actions/runner" | ||
// TODO(#494): update the builder name. | ||
var builderGitHubRunnerID = "https://github.com/actions/[email protected]" | ||
|
||
func (n *Npm) ProvenanceEnvelope() *dsse.Envelope { | ||
return n.verifiedProvenanceAtt.Envelope | ||
|
@@ -72,6 +73,7 @@ func NpmNew(ctx context.Context, root *TrustedRoot, attestationBytes []byte) (*N | |
attestations[0].PredicateType, slsaprovenance.ProvenanceV02Type) | ||
} | ||
|
||
// Provenance type verification. | ||
if !strings.HasPrefix(attestations[1].PredicateType, publishAttestationV01) { | ||
return nil, fmt.Errorf("%w: invalid predicate type: %v. Expected %v", errrorInvalidAttestations, | ||
attestations[1].PredicateType, publishAttestationV01) | ||
|
@@ -86,7 +88,7 @@ func NpmNew(ctx context.Context, root *TrustedRoot, attestationBytes []byte) (*N | |
} | ||
|
||
func (n *Npm) verifyProvenanceAttestationSignature() error { | ||
// We jut re-use the standard bundle verification. | ||
// Re-use the standard bundle verification. | ||
signedProvenance, err := VerifyProvenanceBundle(n.ctx, n.provenanceAttestation.BundleBytes, n.root) | ||
if err != nil { | ||
return err | ||
|
@@ -102,7 +104,7 @@ func (n *Npm) verifyPublishAttesttationSignature() error { | |
return err | ||
} | ||
|
||
// Second, we verify the signature, which ues a static key. | ||
// Second, we verify the signature, which uses a static key. | ||
// Extract payload. | ||
env := signedPublish.Envelope | ||
payload, err := utils.PayloadFromEnvelope(env) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters