From f510b6c718e6b84b2589793c00b0ff40e65fbf68 Mon Sep 17 00:00:00 2001 From: Tak Wai Wong <64229756+tak-hntlabs@users.noreply.github.com> Date: Thu, 9 Jun 2022 16:25:12 -0400 Subject: [PATCH] Use rand.Seed to seed the random function generator (#6) * Blacklist some sytest tests that are failing in our environment * Commenting out test that isn't reliably passing or failing, probably a race * refresh latest dendrite main * use rand.Seed to seed the random function Co-authored-by: Brian Meek Co-authored-by: Tak Wai Wong --- setup/config/config_publickey.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/setup/config/config_publickey.go b/setup/config/config_publickey.go index 5d67afd9c..9820a5969 100644 --- a/setup/config/config_publickey.go +++ b/setup/config/config_publickey.go @@ -2,6 +2,7 @@ package config import ( "math/rand" + "time" "github.com/matrix-org/dendrite/clientapi/auth/authtypes" ) @@ -72,6 +73,7 @@ const lettersAndNumbers = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0 func newNonce(n int) string { nonce := make([]byte, n) + rand.Seed(time.Now().UnixNano()) for i := range nonce { nonce[i] = lettersAndNumbers[rand.Int63()%int64(len(lettersAndNumbers))]