Преглед на файлове

pkg/ioutils use sha256 instead of sha1 in tests

Not really important as it's just test-code, but prevents
gosec linting from producing warnings

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Sebastiaan van Stijn преди 6 години
родител
ревизия
4215492120
променени са 1 файла, в които са добавени 2 реда и са изтрити 2 реда
  1. 2 2
      pkg/ioutils/bytespipe_test.go

+ 2 - 2
pkg/ioutils/bytespipe_test.go

@@ -1,7 +1,7 @@
 package ioutils // import "github.com/docker/docker/pkg/ioutils"
 package ioutils // import "github.com/docker/docker/pkg/ioutils"
 
 
 import (
 import (
-	"crypto/sha1"
+	"crypto/sha256"
 	"encoding/hex"
 	"encoding/hex"
 	"math/rand"
 	"math/rand"
 	"testing"
 	"testing"
@@ -77,7 +77,7 @@ func TestBytesPipeWriteRandomChunks(t *testing.T) {
 
 
 	for _, c := range cases {
 	for _, c := range cases {
 		// first pass: write directly to hash
 		// first pass: write directly to hash
-		hash := sha1.New()
+		hash := sha256.New()
 		for i := 0; i < c.iterations*c.writesPerLoop; i++ {
 		for i := 0; i < c.iterations*c.writesPerLoop; i++ {
 			if _, err := hash.Write(testMessage[:writeChunks[i%len(writeChunks)]]); err != nil {
 			if _, err := hash.Write(testMessage[:writeChunks[i%len(writeChunks)]]); err != nil {
 				t.Fatal(err)
 				t.Fatal(err)