Fix naming and message prompt for entering passwords

Change-Id: Ia3a15e9070ce3b284c84f2ac02a82e3c277dd5c3
This commit is contained in:
Luca Milanesio 2017-01-11 14:46:17 +00:00
parent 0999d86991
commit f6dd9ebe96
1 changed files with 5 additions and 5 deletions

View File

@ -171,20 +171,20 @@ public class Section {
return nv;
}
public String passwordForKey(String key, String password) {
String ov = getSecure(password);
public String passwordForKey(String prompt, String passwordKey) {
String ov = getSecure(passwordKey);
if (ov != null) {
// If the password is already stored, try to reuse it
// rather than prompting for a whole new one.
//
if (ui.isBatch() || !ui.yesno(false, "Change %s", key)) {
if (ui.isBatch() || !ui.yesno(false, "Change %s", passwordKey)) {
return ov;
}
}
final String nv = ui.password("%s", key);
final String nv = ui.password("%s", prompt);
if (!eq(ov, nv)) {
setSecure(password, nv);
setSecure(passwordKey, nv);
}
return nv;
}