aboutsummaryrefslogtreecommitdiffstats
path: root/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/remote/OpenPgpService.java
diff options
context:
space:
mode:
authorDominik Schürmann <dominik@dominikschuermann.de>2014-07-22 18:14:17 +0200
committerDominik Schürmann <dominik@dominikschuermann.de>2014-07-22 18:14:17 +0200
commite4e8bc5e0768a0d3390d28ee087ac48d934d359f (patch)
treed5fb9580485c74d604be3fe098658915b0aea5c3 /OpenKeychain/src/main/java/org/sufficientlysecure/keychain/remote/OpenPgpService.java
parent878b5eb5ad2e1e1ca64f8caf61522579f5156404 (diff)
downloadopen-keychain-e4e8bc5e0768a0d3390d28ee087ac48d934d359f.tar.gz
open-keychain-e4e8bc5e0768a0d3390d28ee087ac48d934d359f.tar.bz2
open-keychain-e4e8bc5e0768a0d3390d28ee087ac48d934d359f.zip
Cleanup
Diffstat (limited to 'OpenKeychain/src/main/java/org/sufficientlysecure/keychain/remote/OpenPgpService.java')
-rw-r--r--OpenKeychain/src/main/java/org/sufficientlysecure/keychain/remote/OpenPgpService.java19
1 files changed, 7 insertions, 12 deletions
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/remote/OpenPgpService.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/remote/OpenPgpService.java
index e18af2eda..e67bcc295 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/remote/OpenPgpService.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/remote/OpenPgpService.java
@@ -188,8 +188,7 @@ public class OpenPgpService extends RemoteService {
}
if (passphrase == null) {
// get PendingIntent for passphrase input, add it to given params and return to client
- Intent passphraseBundle = getPassphraseIntent(data, accSettings.getKeyId());
- return passphraseBundle;
+ return getPassphraseIntent(data, accSettings.getKeyId());
}
byte[] nfcSignedHash = data.getByteArrayExtra(OpenPgpApi.EXTRA_NFC_SIGNED_HASH);
@@ -231,9 +230,10 @@ public class OpenPgpService extends RemoteService {
throw new Exception(getString(R.string.error_no_signature_key));
} catch (PgpSignEncrypt.NeedNfcDataException e) {
// return PendingIntent to execute NFC activity
+ // pass through the signature creation timestamp to be used again on second execution
+ // of PgpSignEncrypt when we have the signed hash!
data.putExtra(OpenPgpApi.EXTRA_NFC_SIG_CREATION_TIMESTAMP, e.mCreationTimestamp.getTime());
- Intent nfcIntent = getNfcIntent(data, e.mHashToSign);
- return nfcIntent;
+ return getNfcIntent(data, e.mHashToSign);
}
} finally {
is.close();
@@ -315,8 +315,7 @@ public class OpenPgpService extends RemoteService {
}
if (passphrase == null) {
// get PendingIntent for passphrase input, add it to given params and return to client
- Intent passphraseBundle = getPassphraseIntent(data, accSettings.getKeyId());
- return passphraseBundle;
+ return getPassphraseIntent(data, accSettings.getKeyId());
}
// sign and encrypt
@@ -411,9 +410,7 @@ public class OpenPgpService extends RemoteService {
if (PgpDecryptVerifyResult.KEY_PASSHRASE_NEEDED == decryptVerifyResult.getStatus()) {
// get PendingIntent for passphrase input, add it to given params and return to client
- Intent passphraseBundle =
- getPassphraseIntent(data, decryptVerifyResult.getKeyIdPassphraseNeeded());
- return passphraseBundle;
+ return getPassphraseIntent(data, decryptVerifyResult.getKeyIdPassphraseNeeded());
} else if (PgpDecryptVerifyResult.SYMMETRIC_PASSHRASE_NEEDED ==
decryptVerifyResult.getStatus()) {
throw new PgpGeneralException("Decryption of symmetric content not supported by API!");
@@ -517,10 +514,8 @@ public class OpenPgpService extends RemoteService {
return result;
} else {
// get key ids based on given user ids
-
String[] userIds = data.getStringArrayExtra(OpenPgpApi.EXTRA_USER_IDS);
- Intent result = getKeyIdsFromEmails(data, userIds);
- return result;
+ return getKeyIdsFromEmails(data, userIds);
}
}