Skip to content

Commit

Permalink
Update cmd/timestamp-cli/app/verify.go
Browse files Browse the repository at this point in the history
Co-authored-by: Bob Callaway <bobcallaway@users.noreply.github.com>
Signed-off-by: Hector Fernandez <hector@chainguard.dev>
  • Loading branch information
hectorj2f and bobcallaway committed Nov 4, 2022
1 parent dd8b5da commit b143398
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions cmd/timestamp-cli/app/verify.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,18 +136,8 @@ func verifyArtifactWithTSR(ts *timestamp.Timestamp) error {

func verifyHashedMessages(hashAlg hash.Hash, hashedMessage []byte, artifactReader io.Reader) error {
h := hashAlg

b := make([]byte, h.Size())
for {
n, err := artifactReader.Read(b)
if err == io.EOF {
break
}

_, err = h.Write(b[:n])
if err != nil {
return fmt.Errorf("failed to create hash %w", err)
}
if _, err := io.Copy(h, artifactReader); err != nil {
return fmt.Errorf("failed to create hash %w", err)
}
localHashedMsg := h.Sum(nil)

Expand Down

0 comments on commit b143398

Please sign in to comment.