aboutsummaryrefslogtreecommitdiffstats
path: root/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service
diff options
context:
space:
mode:
authorAdithya Abraham Philip <adithyaphilip@gmail.com>2015-07-10 02:02:27 +0530
committerAdithya Abraham Philip <adithyaphilip@gmail.com>2015-07-13 23:34:06 +0530
commitfaa66d6140e7f68d920e612c21fa01139b12170e (patch)
treeda213696336d0051a83e3e111576551ede613e0f /OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service
parentd1409fd5c89bc10dd0c39a228049e4c2f669c65a (diff)
downloadopen-keychain-faa66d6140e7f68d920e612c21fa01139b12170e.tar.gz
open-keychain-faa66d6140e7f68d920e612c21fa01139b12170e.tar.bz2
open-keychain-faa66d6140e7f68d920e612c21fa01139b12170e.zip
prevented passphrase caching on revocation
Diffstat (limited to 'OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service')
-rw-r--r--OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/input/CryptoInputParcel.java17
1 files changed, 16 insertions, 1 deletions
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/input/CryptoInputParcel.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/input/CryptoInputParcel.java
index d4cebe67c..9ba9601e5 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/input/CryptoInputParcel.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/input/CryptoInputParcel.java
@@ -34,12 +34,15 @@ import java.util.Map;
public class CryptoInputParcel implements Parcelable {
final Date mSignatureTime;
- final Passphrase mPassphrase;
+ public Passphrase mPassphrase;
// used to supply an explicit proxy to operations that require it
// this is not final so it can be added to an existing CryptoInputParcel
// (e.g) CertifyOperation with upload might require both passphrase and orbot to be enabled
private ParcelableProxy mParcelableProxy;
+ // specifies whether passphrases should be cached
+ public boolean mCachePassphrase = true;
+
// this map contains both decrypted session keys and signed hashes to be
// used in the crypto operation described by this parcel.
private HashMap<ByteBuffer, byte[]> mCryptoData = new HashMap<>();
@@ -47,21 +50,25 @@ public class CryptoInputParcel implements Parcelable {
public CryptoInputParcel() {
mSignatureTime = new Date();
mPassphrase = null;
+ mCachePassphrase = true;
}
public CryptoInputParcel(Date signatureTime, Passphrase passphrase) {
mSignatureTime = signatureTime == null ? new Date() : signatureTime;
mPassphrase = passphrase;
+ mCachePassphrase = true;
}
public CryptoInputParcel(Passphrase passphrase) {
mSignatureTime = new Date();
mPassphrase = passphrase;
+ mCachePassphrase = true;
}
public CryptoInputParcel(Date signatureTime) {
mSignatureTime = signatureTime == null ? new Date() : signatureTime;
mPassphrase = null;
+ mCachePassphrase = true;
}
public CryptoInputParcel(ParcelableProxy parcelableProxy) {
@@ -69,10 +76,17 @@ public class CryptoInputParcel implements Parcelable {
mParcelableProxy = parcelableProxy;
}
+ public CryptoInputParcel(boolean cachePassphrase) {
+ mSignatureTime = new Date();
+ mPassphrase = null;
+ mCachePassphrase = cachePassphrase;
+ }
+
protected CryptoInputParcel(Parcel source) {
mSignatureTime = new Date(source.readLong());
mPassphrase = source.readParcelable(getClass().getClassLoader());
mParcelableProxy = source.readParcelable(getClass().getClassLoader());
+ mCachePassphrase = source.readByte() != 0;
{
int count = source.readInt();
@@ -96,6 +110,7 @@ public class CryptoInputParcel implements Parcelable {
dest.writeLong(mSignatureTime.getTime());
dest.writeParcelable(mPassphrase, 0);
dest.writeParcelable(mParcelableProxy, 0);
+ dest.writeByte((byte) (mCachePassphrase ? 1 : 0));
dest.writeInt(mCryptoData.size());
for (HashMap.Entry<ByteBuffer, byte[]> entry : mCryptoData.entrySet()) {