summaryrefslogtreecommitdiffstats
path: root/models/twofactor.go
diff options
context:
space:
mode:
authorEthan Koenig <ethantkoenig@gmail.com>2017-11-28 01:43:51 -0800
committerLunny Xiao <xiaolunwen@gmail.com>2017-11-28 17:43:51 +0800
commitb7ebaf6d2078cbf4de00d0782be8bc1b1de644bb (patch)
tree5ad8ef6f9738883e89559112e965b9a0bf303476 /models/twofactor.go
parent6a58e3f9fcb8b9f30345e2f8a5812bda72c6baf5 (diff)
downloadgitea-b7ebaf6d2078cbf4de00d0782be8bc1b1de644bb.tar.gz
gitea-b7ebaf6d2078cbf4de00d0782be8bc1b1de644bb.zip
Various wiki bug fixes (#2996)
* Update macaron * Various wiki bug fixes
Diffstat (limited to 'models/twofactor.go')
-rw-r--r--models/twofactor.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/models/twofactor.go b/models/twofactor.go
index f54c8d1a22..86718b4cda 100644
--- a/models/twofactor.go
+++ b/models/twofactor.go
@@ -61,7 +61,7 @@ func (t *TwoFactor) getEncryptionKey() []byte {
// SetSecret sets the 2FA secret.
func (t *TwoFactor) SetSecret(secret string) error {
- secretBytes, err := com.AESEncrypt(t.getEncryptionKey(), []byte(secret))
+ secretBytes, err := com.AESGCMEncrypt(t.getEncryptionKey(), []byte(secret))
if err != nil {
return err
}
@@ -75,7 +75,7 @@ func (t *TwoFactor) ValidateTOTP(passcode string) (bool, error) {
if err != nil {
return false, err
}
- secret, err := com.AESDecrypt(t.getEncryptionKey(), decodedStoredSecret)
+ secret, err := com.AESGCMDecrypt(t.getEncryptionKey(), decodedStoredSecret)
if err != nil {
return false, err
}