aboutsummaryrefslogtreecommitdiffstats
path: root/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpSignEncryptOperation.java
diff options
context:
space:
mode:
authorDominik Schürmann <dominik@dominikschuermann.de>2015-03-05 16:57:57 +0100
committerDominik Schürmann <dominik@dominikschuermann.de>2015-03-05 16:57:57 +0100
commite45f000cb458e8608ad851ce7ecca0045e5ac6b0 (patch)
treee6208f512239ad32fd9123c19781a1a3b3e70c58 /OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpSignEncryptOperation.java
parent8b7684baf78b01592777a1ccb29293a4b59bdf14 (diff)
downloadopen-keychain-e45f000cb458e8608ad851ce7ecca0045e5ac6b0.tar.gz
open-keychain-e45f000cb458e8608ad851ce7ecca0045e5ac6b0.tar.bz2
open-keychain-e45f000cb458e8608ad851ce7ecca0045e5ac6b0.zip
Remove advanced preferences, move compression as menu item in encrypt activites, select hash and encryption algo based on hardcoded preferred lists
Diffstat (limited to 'OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpSignEncryptOperation.java')
-rw-r--r--OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpSignEncryptOperation.java9
1 files changed, 5 insertions, 4 deletions
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpSignEncryptOperation.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpSignEncryptOperation.java
index d420ddb5a..7d0949c6c 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpSignEncryptOperation.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpSignEncryptOperation.java
@@ -208,9 +208,9 @@ public class PgpSignEncryptOperation extends BaseOperation {
// Use preferred hash algo
int requestedAlgorithm = input.getSignatureHashAlgorithm();
LinkedList<Integer> supported = signingKey.getSupportedHashAlgorithms();
- if (requestedAlgorithm == Constants.OpenKeychainHashAlgorithmTags.USE_PREFERRED) {
+ if (requestedAlgorithm == PgpConstants.OpenKeychainHashAlgorithmTags.USE_PREFERRED) {
// get most preferred
- input.setSignatureHashAlgorithm(supported.getLast());
+ input.setSignatureHashAlgorithm(supported.getFirst());
} else if (!supported.contains(requestedAlgorithm)) {
log.add(LogType.MSG_PSE_ERROR_HASH_ALGO, indent);
return new PgpSignEncryptResult(PgpSignEncryptResult.RESULT_ERROR, log);
@@ -224,9 +224,10 @@ public class PgpSignEncryptOperation extends BaseOperation {
// Use preferred encryption algo
int algo = input.getSymmetricEncryptionAlgorithm();
- if (algo == Constants.OpenKeychainSymmetricKeyAlgorithmTags.USE_PREFERRED) {
+ if (algo == PgpConstants.OpenKeychainSymmetricKeyAlgorithmTags.USE_PREFERRED) {
// get most preferred
- algo = CanonicalizedSecretKey.getSupportedEncryptionAlgorithms().getLast();
+ // TODO: get from recipients
+ algo = PgpConstants.PREFERRED_SYMMETRIC_ALGORITHMS[0];
}
// has Integrity packet enabled!
JcePGPDataEncryptorBuilder encryptorBuilder =