mirror of
https://github.com/pagefaultgames/rogueserver.git
synced 2025-03-31 02:02:54 +08:00
Merge 41293d4fc592ef51f7b36f41827a3ba20c905727 into 4d6de1e2a80edfea95783fa9b09aaedf74dfe2c7
This commit is contained in:
commit
1c1d01cd4c
@ -18,8 +18,8 @@
|
||||
package account
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"crypto/rand"
|
||||
"crypto/subtle"
|
||||
"database/sql"
|
||||
"encoding/base64"
|
||||
"errors"
|
||||
@ -51,7 +51,7 @@ func Login(username, password string) (LoginResponse, error) {
|
||||
return response, err
|
||||
}
|
||||
|
||||
if !bytes.Equal(key, deriveArgon2IDKey([]byte(password), salt)) {
|
||||
if subtle.ConstantTimeCompare(key, deriveArgon2IDKey([]byte(password), salt)) == 0 {
|
||||
return response, fmt.Errorf("password doesn't match")
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user