We haven't had cleartext passwords in the config for ages

This commit is contained in:
Jakob Borg 2015-11-04 20:14:28 +00:00
parent 686f91777c
commit 435c29755d

View File

@ -21,7 +21,6 @@ import (
"strings"
"github.com/syncthing/syncthing/lib/protocol"
"golang.org/x/crypto/bcrypt"
)
const (
@ -203,16 +202,6 @@ func (cfg *Configuration) prepare(myID protocol.DeviceID) {
convertV11V12(cfg)
}
// Hash old cleartext passwords
if len(cfg.GUI.Password) > 0 && cfg.GUI.Password[0] != '$' {
hash, err := bcrypt.GenerateFromPassword([]byte(cfg.GUI.Password), 0)
if err != nil {
l.Warnln("bcrypting password:", err)
} else {
cfg.GUI.Password = string(hash)
}
}
// Build a list of available devices
existingDevices := make(map[protocol.DeviceID]bool)
for _, device := range cfg.Devices {