Skip to content

Commit

Permalink
fix: use crypto/rand instead of math/rand
Browse files Browse the repository at this point in the history
  • Loading branch information
damdo committed Oct 6, 2023
1 parent 66f7626 commit 02dd5d8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions pkg/cloud/services/secretsmanager/secret_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ limitations under the License.
package secretsmanager

import (
"math/rand"
crand "crypto/rand"
"sort"
"testing"

Expand All @@ -43,7 +43,7 @@ func TestServiceCreate(t *testing.T) {

generateBytes := func(g *WithT, count int64) []byte {
token := make([]byte, count)
_, err := rand.Read(token)
_, err := crand.Read(token)
g.Expect(err).NotTo(HaveOccurred())
return token
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/cloud/services/ssm/secret_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ limitations under the License.
package ssm

import (
"math/rand"
crand "crypto/rand"
"sort"
"strings"
"testing"
Expand Down Expand Up @@ -45,7 +45,7 @@ func TestServiceCreate(t *testing.T) {

generateBytes := func(count int64) []byte {
token := make([]byte, count)
_, err := rand.Read(token)
_, err := crand.Read(token)
if err != nil {
t.Fatalf("error while creating data: %v", err)
}
Expand Down

0 comments on commit 02dd5d8

Please sign in to comment.