Security Updates
This commit is contained in:
@@ -62,6 +62,13 @@ func passwordMatches(password, salt, expectedHash string) bool {
|
||||
return subtle.ConstantTimeCompare([]byte(computed), []byte(expectedHash)) == 1
|
||||
}
|
||||
|
||||
func secureTokenMatches(expected, provided string) bool {
|
||||
if expected == "" || provided == "" || len(expected) != len(provided) {
|
||||
return false
|
||||
}
|
||||
return subtle.ConstantTimeCompare([]byte(expected), []byte(provided)) == 1
|
||||
}
|
||||
|
||||
func nowUTC() time.Time {
|
||||
return time.Now().UTC()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user