forked from TrueCloudLab/rclone
lib/http: Factor password hash salt into options with default
This commit is contained in:
parent
b1cb41f8da
commit
023e32de05
2 changed files with 10 additions and 4 deletions
|
@ -85,9 +85,9 @@ func HtPasswdAuth(path, realm string) httplib.Middleware {
|
|||
}
|
||||
|
||||
// SingleAuth instantiates middleware that authenticates for a single user
|
||||
func SingleAuth(user, pass, realm string) httplib.Middleware {
|
||||
func SingleAuth(user, pass, realm, salt string) httplib.Middleware {
|
||||
fs.Infof(nil, "Using --user %s --pass XXXX as authenticated user", user)
|
||||
pass = string(auth.MD5Crypt([]byte(pass), []byte("dlPL2MqE"), []byte("$1$")))
|
||||
pass = string(auth.MD5Crypt([]byte(pass), []byte(salt), []byte("$1$")))
|
||||
secretProvider := func(u, r string) string {
|
||||
if user == u {
|
||||
return pass
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue