password cache introduced, not cleared yet.

This commit is contained in:
Thialfihar
2010-05-15 15:19:56 +00:00
parent cab78bf4c1
commit 363dcb62b8
10 changed files with 129 additions and 49 deletions

View File

@@ -298,12 +298,17 @@ public class SectionView extends LinearLayout implements OnClickListener, Editor
String error = null;
try {
PGPSecretKey masterKey = null;
String passPhrase;
if (mEditors.getChildCount() > 0) {
masterKey = ((KeyEditor) mEditors.getChildAt(0)).getValue();
passPhrase = Apg.getCachedPassPhrase(masterKey.getKeyID());
} else {
passPhrase = "";
}
mNewKey = Apg.createKey(getContext(),
mNewKeyAlgorithmChoice.getId(),
mNewKeySize, Apg.getPassPhrase(), masterKey);
mNewKeySize, passPhrase,
masterKey);
} catch (NoSuchProviderException e) {
error = e.getMessage();
} catch (NoSuchAlgorithmException e) {