Skip to content

feat: add more logging around echo tar #10731

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Nov 16, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Use sha256 instead of md5
  • Loading branch information
mtojek committed Nov 16, 2023
commit dc800092ebe1d83801ac7feb758dd71c3546f38a
5 changes: 2 additions & 3 deletions provisionersdk/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"archive/tar"
"bytes"
"context"
"crypto/md5"
"crypto/sha256"
"fmt"
"io"
"os"
Expand Down Expand Up @@ -260,8 +260,7 @@ func (s *Session) extractArchive() error {
return xerrors.Errorf("create file %q (mode %s): %w", headerPath, mode, err)
}

//nolint:gosec // Calculate the file checksum for debugging purposes if the file is corrupted
hash := md5.New()
hash := sha256.New()
hashReader := io.TeeReader(reader, hash)
// Max file size of 10MiB.
size, err := io.CopyN(file, hashReader, 10<<20)
Expand Down