mirror of
https://github.com/hashicorp/vault.git
synced 2026-05-05 12:26:34 +02:00
auth/userpass: update dummy string generation (#31318)
This commit is contained in:
parent
41d8301927
commit
9190485ef6
@ -89,7 +89,11 @@ func (b *backend) pathLogin(ctx context.Context, req *logical.Request, d *framew
|
||||
} else {
|
||||
// This is still acceptable as bcrypt will still make sure it takes
|
||||
// a long time, it's just nicer to be random if possible
|
||||
userPassword = []byte(strings.Repeat("dummy", 12))
|
||||
var err error
|
||||
userPassword, err = bcrypt.GenerateFromPassword([]byte("dummy"), bcrypt.DefaultCost)
|
||||
if err != nil {
|
||||
return logical.ErrorResponse("invalid username or password"), nil
|
||||
}
|
||||
}
|
||||
|
||||
// Check for a password match. Check for a hash collision for Vault 0.2+,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user