mirror of
https://github.com/minio/minio.git
synced 2025-11-07 04:42:56 -05:00
normalize users with double // in accessKeys (#11143)
Bonus fix, use constant time compare for secret keys in web-handlers.go:SetAuth()
This commit is contained in:
@@ -18,6 +18,7 @@ package cmd
|
||||
|
||||
import (
|
||||
"context"
|
||||
"crypto/subtle"
|
||||
"encoding/json"
|
||||
"encoding/xml"
|
||||
"errors"
|
||||
@@ -1005,7 +1006,7 @@ func (web *webAPIHandlers) SetAuth(r *http.Request, args *SetAuthArgs, reply *Se
|
||||
}
|
||||
|
||||
// Throw error when wrong secret key is provided
|
||||
if prevCred.SecretKey != args.CurrentSecretKey {
|
||||
if subtle.ConstantTimeCompare([]byte(prevCred.SecretKey), []byte(args.CurrentSecretKey)) != 1 {
|
||||
return errIncorrectCreds
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user