aboutsummaryrefslogtreecommitdiffstats
path: root/OpenKeychain/src
diff options
context:
space:
mode:
authorDominik Schürmann <dominik@dominikschuermann.de>2014-04-11 19:23:29 +0200
committerDominik Schürmann <dominik@dominikschuermann.de>2014-04-11 19:23:29 +0200
commit9b15482c4146e407c642822f2a65e41c28b3a730 (patch)
treeb5bbcb1a62366067305d9ebbe713739033b47197 /OpenKeychain/src
parentbd6aeea6db7d5af5b3751453db95b6c968d54100 (diff)
downloadopen-keychain-9b15482c4146e407c642822f2a65e41c28b3a730.tar.gz
open-keychain-9b15482c4146e407c642822f2a65e41c28b3a730.tar.bz2
open-keychain-9b15482c4146e407c642822f2a65e41c28b3a730.zip
put signatureType where it belongs
Diffstat (limited to 'OpenKeychain/src')
-rw-r--r--OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpSignEncrypt.java16
1 files changed, 8 insertions, 8 deletions
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpSignEncrypt.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpSignEncrypt.java
index 589b06274..e370f5cf6 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpSignEncrypt.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpSignEncrypt.java
@@ -276,14 +276,6 @@ public class PgpSignEncrypt {
mEncryptionMasterKeyIds[mEncryptionMasterKeyIds.length - 1] = mSignatureMasterKeyId;
}
- int signatureType;
- if (mEnableAsciiArmorOutput && enableSignature && !enableEncryption && !enableCompression) {
- // for sign-only ascii text
- signatureType = PGPSignature.CANONICAL_TEXT_DOCUMENT;
- } else {
- signatureType = PGPSignature.BINARY_DOCUMENT;
- }
-
ArmoredOutputStream armorOut = null;
OutputStream out;
if (mEnableAsciiArmorOutput) {
@@ -377,6 +369,14 @@ public class PgpSignEncrypt {
signingKey.getPublicKey().getAlgorithm(), mSignatureHashAlgorithm)
.setProvider(Constants.BOUNCY_CASTLE_PROVIDER_NAME);
+ int signatureType;
+ if (mEnableAsciiArmorOutput && !enableEncryption) {
+ // for sign-only ascii text and sign-only binary input (files)
+ signatureType = PGPSignature.CANONICAL_TEXT_DOCUMENT;
+ } else {
+ signatureType = PGPSignature.BINARY_DOCUMENT;
+ }
+
if (mSignatureForceV3) {
signatureV3Generator = new PGPV3SignatureGenerator(contentSignerBuilder);
signatureV3Generator.init(signatureType, signaturePrivateKey);