Fix naming and message prompt for entering passwords
Change-Id: Ia3a15e9070ce3b284c84f2ac02a82e3c277dd5c3
This commit is contained in:
parent
0999d86991
commit
f6dd9ebe96
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user