Really, clear the confirmation password

This commit is contained in:
Alexander Bakker 2017-11-27 21:47:13 +01:00
parent 9286196811
commit fb24867569
2 changed files with 7 additions and 2 deletions

View file

@ -22,6 +22,7 @@ import java.lang.reflect.UndeclaredThrowableException;
import javax.crypto.Cipher; import javax.crypto.Cipher;
import javax.crypto.SecretKey; import javax.crypto.SecretKey;
import me.impy.aegis.crypto.CryptoUtils;
import me.impy.aegis.crypto.KeyStoreHandle; import me.impy.aegis.crypto.KeyStoreHandle;
import me.impy.aegis.crypto.slots.Slot; import me.impy.aegis.crypto.slots.Slot;
import me.impy.aegis.finger.FingerprintUiHelper; import me.impy.aegis.finger.FingerprintUiHelper;
@ -58,7 +59,7 @@ public class CustomAuthenticatedSlide extends Fragment implements FingerprintUiH
} }
public char[] getPassword() { public char[] getPassword() {
AuthHelper.getPassword(_textPasswordConfirm, true); AuthHelper.clearPassword(_textPasswordConfirm);
return AuthHelper.getPassword(_textPassword, true); return AuthHelper.getPassword(_textPassword, true);
} }

View file

@ -14,11 +14,15 @@ public class AuthHelper {
public static char[] getPassword(EditText text, boolean clear) { public static char[] getPassword(EditText text, boolean clear) {
char[] password = getEditTextChars(text); char[] password = getEditTextChars(text);
if (clear) { if (clear) {
text.getText().clear(); clearPassword(text);
} }
return password; return password;
} }
public static void clearPassword(EditText text) {
text.getText().clear();
}
public static char[] getEditTextChars(EditText text) { public static char[] getEditTextChars(EditText text) {
Editable editable = text.getText(); Editable editable = text.getText();
char[] chars = new char[editable.length()]; char[] chars = new char[editable.length()];