1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

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>
This commit is contained in:
Sebastiaan van Stijn 2019-08-06 23:46:02 +02:00
parent 27916165b6
commit 4215492120
No known key found for this signature in database
GPG key ID: 76698F39D527CE8C

View file

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