1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-03 09:07:19 +00:00

Use base32 for 2FA scratch token (#18384)

* Use base32 for 2FA scratch token
* rename Secure* to Crypto*, add comments
This commit is contained in:
wxiaoguang
2022-01-26 12:10:10 +08:00
committed by GitHub
parent 4889ab52de
commit 49dd906753
11 changed files with 41 additions and 37 deletions

View File

@ -53,7 +53,7 @@ func addScratchHash(x *xorm.Engine) error {
for _, tfa := range tfas {
// generate salt
salt, err := util.RandomString(10)
salt, err := util.CryptoRandomString(10)
if err != nil {
return err
}

View File

@ -65,7 +65,7 @@ func hashAppToken(x *xorm.Engine) error {
for _, token := range tokens {
// generate salt
salt, err := util.RandomString(10)
salt, err := util.CryptoRandomString(10)
if err != nil {
return err
}