mirror of
https://github.com/gogrlx/nats-server.git
synced 2026-04-02 03:38:42 -07:00
Merge pull request #1429 from kingkorf/master
First check bcrypt '$' prefix before performing rexeg on password
This commit is contained in:
@@ -741,7 +741,11 @@ var validBcryptPrefix = regexp.MustCompile(`^\$2[a,b,x,y]{1}\$\d{2}\$.*`)
|
||||
|
||||
// isBcrypt checks whether the given password or token is bcrypted.
|
||||
func isBcrypt(password string) bool {
|
||||
return validBcryptPrefix.MatchString(password)
|
||||
if strings.HasPrefix(password, "$") {
|
||||
return validBcryptPrefix.MatchString(password)
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
func comparePasswords(serverPassword, clientPassword string) bool {
|
||||
|
||||
Reference in New Issue
Block a user