2FA secret now seeds random to dupes

This commit is contained in:
Marcel Schramm 2019-11-03 16:28:09 +01:00
parent 5ae7ab9317
commit 7b11eda3b4
No known key found for this signature in database
GPG Key ID: 05971054C70EEDC7
1 changed files with 2 additions and 0 deletions

View File

@ -6,6 +6,7 @@ import (
"math/rand"
"strconv"
"strings"
"time"
)
// ParseTFACodes takes an arbitrary string and checks whether it's a valid 6
@ -37,6 +38,7 @@ func GenerateBase32Key() string {
'2', '3', '4', '5', '6', '7',
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
}
rand.Seed(time.Now().Unix())
for i := 0; i < 16; i++ {
tfaSecretRaw[i] = availableCharacters[rand.Int31n(int32(len(availableCharacters)))]
}