Skip to content

Commit

Permalink
fix: create blob digest with crypto/sha256
Browse files Browse the repository at this point in the history
Rather than using crypto.SHA256.New(), use sha256.New() directly to
ensure the SHA256 algorithm is available.
  • Loading branch information
tri-adam committed Jul 14, 2023
1 parent 073f1ed commit 02ad885
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/sif/descriptor.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ package sif
import (
"bytes"
"crypto"
"crypto/sha256"
"encoding"
"encoding/binary"
"encoding/hex"
Expand Down Expand Up @@ -82,7 +83,7 @@ type ociBlob struct {
// written to the returned ociBlob prior to calling MarshalBinary.
func newOCIBlobDigest() *ociBlob {
return &ociBlob{
hasher: crypto.SHA256.New(),
hasher: sha256.New(),
digest: v1.Hash{
Algorithm: "sha256",
},
Expand Down

0 comments on commit 02ad885

Please sign in to comment.