Skip to content

"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files

proxy: reduce the internal bcrypt strength to fix race tests

Nick Craig-Wood911575267953
diff --git a/cmd/serve/proxy/proxy.go b/cmd/serve/proxy/proxy.go
index 83a37bca2..1c55588e7 100644
--- a/cmd/serve/proxy/proxy.go
+++ b/cmd/serve/proxy/proxy.go
@@ -208,7 +208,10 @@ func (p *Proxy) call(user, pass string, passwordBytes []byte) (value interface{}
if err != nil {
return nil, false, err
}
- pwHash, err := bcrypt.GenerateFromPassword(passwordBytes, bcrypt.DefaultCost)
+ // The bcrypt cost is a compromise between security and speed. The password is looked up on every
+ // transaction for WebDAV so we store it lightly hashed. An attacker would find it easier to go after
+ // the unencrypted password in memory most likely.
+ pwHash, err := bcrypt.GenerateFromPassword(passwordBytes, bcrypt.MinCost)
if err != nil {
return nil, false, err
}