diff options
author | Vincent Breitmoser <valodim@mugenguild.com> | 2015-03-30 16:40:41 +0200 |
---|---|---|
committer | Vincent Breitmoser <valodim@mugenguild.com> | 2015-03-30 16:40:41 +0200 |
commit | d7b79e55fba170a0fe691f00dbc943d8ecfff33e (patch) | |
tree | 229ddba3f98752b0c347ebb1960cadf646aae1e5 /OpenKeychain/src/main/java/org/sufficientlysecure/keychain/remote/OpenPgpService.java | |
parent | 2050be3995bde67541ceb78050b3c9143907444f (diff) | |
download | open-keychain-d7b79e55fba170a0fe691f00dbc943d8ecfff33e.tar.gz open-keychain-d7b79e55fba170a0fe691f00dbc943d8ecfff33e.tar.bz2 open-keychain-d7b79e55fba170a0fe691f00dbc943d8ecfff33e.zip |
pass CryptoInputParcel independently for SignEncryptOperation
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.java | 20 |
1 files changed, 10 insertions, 10 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 204af1b67..3575c3c18 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/remote/OpenPgpService.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/remote/OpenPgpService.java @@ -284,23 +284,21 @@ public class OpenPgpService extends RemoteService { long inputLength = is.available(); InputData inputData = new InputData(is, inputLength); - CryptoInputParcel cryptoInput = new CryptoInputParcel(nfcCreationDate); + CryptoInputParcel cryptoInput = new CryptoInputParcel(nfcCreationDate, passphrase); cryptoInput.addCryptoData(null, nfcSignedHash); // TODO fix // sign-only PgpSignEncryptInputParcel pseInput = new PgpSignEncryptInputParcel() - .setSignaturePassphrase(passphrase) .setEnableAsciiArmorOutput(asciiArmor) .setCleartextSignature(cleartextSign) .setDetachedSignature(!cleartextSign) .setVersionHeader(null) .setSignatureHashAlgorithm(PgpConstants.OpenKeychainHashAlgorithmTags.USE_PREFERRED) - .setSignatureMasterKeyId(signKeyId) - .setCryptoInput(cryptoInput); + .setSignatureMasterKeyId(signKeyId); // execute PGP operation! PgpSignEncryptOperation pse = new PgpSignEncryptOperation(this, new ProviderHelper(getContext()), null); - PgpSignEncryptResult pgpResult = pse.execute(pseInput, inputData, os); + PgpSignEncryptResult pgpResult = pse.execute(pseInput, cryptoInput, inputData, os); if (pgpResult.isPending()) { if ((pgpResult.getResult() & PgpSignEncryptResult.RESULT_PENDING_PASSPHRASE) == @@ -407,9 +405,10 @@ public class OpenPgpService extends RemoteService { long inputLength = is.available(); InputData inputData = new InputData(is, inputLength, originalFilename); + CryptoInputParcel cryptoInput; + PgpSignEncryptInputParcel pseInput = new PgpSignEncryptInputParcel(); - pseInput.setSignaturePassphrase(passphrase) - .setEnableAsciiArmorOutput(asciiArmor) + pseInput.setEnableAsciiArmorOutput(asciiArmor) .setVersionHeader(null) .setCompressionId(compressionId) .setSymmetricEncryptionAlgorithm(PgpConstants.OpenKeychainSymmetricKeyAlgorithmTags.USE_PREFERRED) @@ -439,20 +438,21 @@ public class OpenPgpService extends RemoteService { nfcCreationDate = new Date(); } - CryptoInputParcel cryptoInput = new CryptoInputParcel(nfcCreationDate); + cryptoInput = new CryptoInputParcel(nfcCreationDate, passphrase); cryptoInput.addCryptoData(null, nfcSignedHash); // TODO fix! // sign and encrypt pseInput.setSignatureHashAlgorithm(PgpConstants.OpenKeychainHashAlgorithmTags.USE_PREFERRED) .setSignatureMasterKeyId(signKeyId) - .setCryptoInput(cryptoInput) .setAdditionalEncryptId(signKeyId); // add sign key for encryption + } else { + cryptoInput = new CryptoInputParcel(); } PgpSignEncryptOperation op = new PgpSignEncryptOperation(this, new ProviderHelper(getContext()), null); // execute PGP operation! - PgpSignEncryptResult pgpResult = op.execute(pseInput, inputData, os); + PgpSignEncryptResult pgpResult = op.execute(pseInput, cryptoInput, inputData, os); if (pgpResult.isPending()) { if ((pgpResult.getResult() & PgpSignEncryptResult.RESULT_PENDING_PASSPHRASE) == |