summaryrefslogtreecommitdiffstats
path: root/routers
diff options
context:
space:
mode:
authorClar Charr <clar@charr.xyz>2018-07-03 18:10:35 -0400
committertechknowlogick <techknowlogick@users.noreply.github.com>2018-07-03 18:10:35 -0400
commitc71ee33057436dc2be1f071f379e6341c382e0ec (patch)
tree3dfb5d2d20b18dab0d4c4694d0359fe26a2bc787 /routers
parent9d4c1ddfa14d33ce3b78c02421fb76a93e5ca2d6 (diff)
downloadgitea-c71ee33057436dc2be1f071f379e6341c382e0ec.tar.gz
gitea-c71ee33057436dc2be1f071f379e6341c382e0ec.zip
Increase default TOTP secret size to 320 bits (#4287)
Diffstat (limited to 'routers')
-rw-r--r--routers/user/setting/security_twofa.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/routers/user/setting/security_twofa.go b/routers/user/setting/security_twofa.go
index 55101ed1a4..cb61b9e270 100644
--- a/routers/user/setting/security_twofa.go
+++ b/routers/user/setting/security_twofa.go
@@ -76,6 +76,7 @@ func twofaGenerateSecretAndQr(ctx *context.Context) bool {
if otpKey == nil {
err = nil // clear the error, in case the URL was invalid
otpKey, err = totp.Generate(totp.GenerateOpts{
+ SecretSize: 40,
Issuer: setting.AppName + " (" + strings.TrimRight(setting.AppURL, "/") + ")",
AccountName: ctx.User.Name,
})