1
0
Fork 0
mirror of https://github.com/syncthing/syncthing-android.git synced 2024-11-30 08:11:17 +00:00

BCrypt password hashing wasn't released, no need for migration

This commit is contained in:
Felix Ableitner 2017-09-04 12:56:22 +09:00
parent 679841a6ac
commit 2f195cec3b

View file

@ -157,14 +157,8 @@ public class ConfigXml {
} }
String apikey = getApiKey(); String apikey = getApiKey();
boolean passwordOk; boolean passwordOk;
// Version 0.9.12 used the default work factor of 10. If this is set, regenerate the
// password with the minimum factor of 4, to speed up loading.
String pw = password.getTextContent(); String pw = password.getTextContent();
if (TextUtils.isEmpty(pw) || pw.substring(4, 6).equals("10")) { passwordOk = !TextUtils.isEmpty(pw) && BCrypt.checkpw(apikey, pw);
passwordOk = false;
} else {
passwordOk = BCrypt.checkpw(apikey, pw);
}
if (!passwordOk) { if (!passwordOk) {
Log.i(TAG, "Updating password"); Log.i(TAG, "Updating password");
password.setTextContent(BCrypt.hashpw(apikey, BCrypt.gensalt(4))); password.setTextContent(BCrypt.hashpw(apikey, BCrypt.gensalt(4)));