fix saving new key (tmp)

This commit is contained in:
Ashley Hughes 2014-03-06 13:00:17 +00:00
parent 8662ca2928
commit 01951810ae
3 changed files with 13 additions and 3 deletions

View File

@ -361,8 +361,10 @@ public class PgpKeyOperation {
newPassPhrase = "";
}
if (mKR == null)
if (mKR == null) {
buildNewSecretKey(userIds, keys, keysExpiryDates, keysUsages, newPassPhrase, oldPassPhrase); //new Keyring
return;
}
/*
IDs -

View File

@ -550,8 +550,13 @@ public class KeychainIntentService extends IntentService implements ProgressDial
ArrayList<String> deleted_ids = data.getStringArrayList(SAVE_KEYRING_DELETED_IDS);
boolean[] modded_keys = data.getBooleanArray(SAVE_KEYRING_MODDED_KEYS);
boolean[] new_keys = data.getBooleanArray(SAVE_KEYRING_NEW_KEYS);
ArrayList<PGPSecretKey> deletedKeys = PgpConversionHelper.BytesToPGPSecretKeyList(data
byte[] tmp = data.getByteArray(SAVE_KEYRING_DELETED_KEYS);
ArrayList<PGPSecretKey> deletedKeys;
if (tmp != null)
deletedKeys = PgpConversionHelper.BytesToPGPSecretKeyList(data
.getByteArray(SAVE_KEYRING_DELETED_KEYS));
else
deletedKeys = new ArrayList<PGPSecretKey>();
boolean primaryChanged = data.getBoolean(SAVE_KEYRING_PRIMARY_ID_CHANGED);
long masterKeyId = data.getLong(SAVE_KEYRING_MASTER_KEY_ID);

View File

@ -581,8 +581,11 @@ public class EditKeyActivity extends ActionBarActivity implements EditorListener
data.putByteArray(KeychainIntentService.SAVE_KEYRING_KEYS,
PgpConversionHelper.PGPSecretKeyArrayListToBytes(keys));
ArrayList<PGPSecretKey> dKeys = mKeysView.getDeletedKeys();
byte[] tmp = null;
if (dKeys.size() != 0)
tmp = PgpConversionHelper.PGPSecretKeyArrayListToBytes(dKeys);
data.putByteArray(KeychainIntentService.SAVE_KEYRING_DELETED_KEYS,
PgpConversionHelper.PGPSecretKeyArrayListToBytes(dKeys));
tmp);
data.putIntegerArrayList(KeychainIntentService.SAVE_KEYRING_KEYS_USAGES,
getKeysUsages(mKeysView));
data.putSerializable(KeychainIntentService.SAVE_KEYRING_KEYS_EXPIRY_DATES,