mirror of
https://github.com/pagefaultgames/rogueserver.git
synced 2025-10-14 15:20:42 +08:00
Merge 41293d4fc592ef51f7b36f41827a3ba20c905727 into 992746d8ad4718f6ff9de0cd3f8ee47eabcd34b7
This commit is contained in:
commit
3cb7965bf2
@ -18,8 +18,8 @@
|
|||||||
package account
|
package account
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
|
||||||
"crypto/rand"
|
"crypto/rand"
|
||||||
|
"crypto/subtle"
|
||||||
"database/sql"
|
"database/sql"
|
||||||
"encoding/base64"
|
"encoding/base64"
|
||||||
"errors"
|
"errors"
|
||||||
@ -54,7 +54,7 @@ func Login[T LoginStore](store T, username, password string) (LoginResponse, err
|
|||||||
return response, err
|
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")
|
return response, fmt.Errorf("password doesn't match")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user