diff --git a/pkg/authentication/scramcredentials/scram_credentials.go b/pkg/authentication/scramcredentials/scram_credentials.go index c15dacac1..7d286ba61 100644 --- a/pkg/authentication/scramcredentials/scram_credentials.go +++ b/pkg/authentication/scramcredentials/scram_credentials.go @@ -80,9 +80,7 @@ func hmacIteration(hashConstructor func() hash.Hash, input, salt []byte, iterati intermediateDigest := hmacHash.Sum(nil) - for i := 0; i < len(intermediateDigest); i++ { - result[i] = intermediateDigest[i] - } + copy(result, intermediateDigest) for i := 1; i < iterationCount; i++ { hmacHash.Reset()