1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-16 07:18:37 +00:00

Various wiki bug fixes (#2996)

* Update macaron

* Various wiki bug fixes
This commit is contained in:
Ethan Koenig
2017-11-28 01:43:51 -08:00
committed by Lunny Xiao
parent 6a58e3f9fc
commit b7ebaf6d20
40 changed files with 1087 additions and 381 deletions

View File

@@ -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
}