diff options
author | ᴜɴᴋɴᴡᴏɴ <u@gogs.io> | 2020-02-22 20:46:16 +0800 |
---|---|---|
committer | ᴜɴᴋɴᴡᴏɴ <u@gogs.io> | 2020-02-22 20:46:16 +0800 |
commit | 286fbc07e985d960209e8443a57e7f95efe60efd (patch) | |
tree | dd3d0d38081fa258751004472695c8fdc6885e43 /internal/db | |
parent | a7e53b8134eefcbaa60a2755da8518dd08471a69 (diff) |
conf: overhaul security settings
Diffstat (limited to 'internal/db')
-rw-r--r-- | internal/db/two_factor.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/internal/db/two_factor.go b/internal/db/two_factor.go index ae17bef5..45b29705 100644 --- a/internal/db/two_factor.go +++ b/internal/db/two_factor.go @@ -15,8 +15,8 @@ import ( log "unknwon.dev/clog/v2" "xorm.io/xorm" - "gogs.io/gogs/internal/db/errors" "gogs.io/gogs/internal/conf" + "gogs.io/gogs/internal/db/errors" "gogs.io/gogs/internal/tool" ) @@ -47,7 +47,7 @@ func (t *TwoFactor) ValidateTOTP(passcode string) (bool, error) { if err != nil { return false, fmt.Errorf("DecodeString: %v", err) } - decryptSecret, err := com.AESGCMDecrypt(tool.MD5Bytes(conf.SecretKey), secret) + decryptSecret, err := com.AESGCMDecrypt(tool.MD5Bytes(conf.Security.SecretKey), secret) if err != nil { return false, fmt.Errorf("AESGCMDecrypt: %v", err) } @@ -85,7 +85,7 @@ func NewTwoFactor(userID int64, secret string) error { } // Encrypt secret - encryptSecret, err := com.AESGCMEncrypt(tool.MD5Bytes(conf.SecretKey), []byte(secret)) + encryptSecret, err := com.AESGCMEncrypt(tool.MD5Bytes(conf.Security.SecretKey), []byte(secret)) if err != nil { return fmt.Errorf("AESGCMEncrypt: %v", err) } |