diff options
author | Vincent Breitmoser <valodim@mugenguild.com> | 2015-04-09 13:57:56 +0200 |
---|---|---|
committer | Vincent Breitmoser <valodim@mugenguild.com> | 2015-04-09 13:57:56 +0200 |
commit | a4b7daf266b037c6a39cef0586aadedf32861ad5 (patch) | |
tree | 8446f6aae86530a8546caa99af6f9bac4f095370 /OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpSignEncryptOperation.java | |
parent | d27925ad19b6800658a69670ceaed261776ba6d3 (diff) | |
parent | dcaac4f85f07efff2fdfd8a2eec9ba8ee758659c (diff) | |
download | open-keychain-a4b7daf266b037c6a39cef0586aadedf32861ad5.tar.gz open-keychain-a4b7daf266b037c6a39cef0586aadedf32861ad5.tar.bz2 open-keychain-a4b7daf266b037c6a39cef0586aadedf32861ad5.zip |
Merge branch 'development' into linked-identities
Conflicts:
OpenKeychain/build.gradle
OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/KeyListFragment.java
OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyActivity.java
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.java | 16 |
1 files changed, 11 insertions, 5 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 bd3c31d3a..16a09e77b 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpSignEncryptOperation.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpSignEncryptOperation.java @@ -62,19 +62,19 @@ import java.util.Arrays; import java.util.Date; import java.util.concurrent.atomic.AtomicBoolean; -/** This class supports a single, low-level, sign/encrypt operation. - * +/** + * This class supports a single, low-level, sign/encrypt operation. + * <p/> * The operation of this class takes an Input- and OutputStream plus a * PgpSignEncryptInput, and signs and/or encrypts the stream as * parametrized in the PgpSignEncryptInput object. It returns its status * and a possible detached signature as a SignEncryptResult. - * + * <p/> * For a high-level operation based on URIs, see SignEncryptOperation. * * @see org.sufficientlysecure.keychain.pgp.PgpSignEncryptInput * @see org.sufficientlysecure.keychain.operations.results.PgpSignEncryptResult * @see org.sufficientlysecure.keychain.operations.SignEncryptOperation - * */ public class PgpSignEncryptOperation extends BaseOperation { @@ -100,7 +100,7 @@ public class PgpSignEncryptOperation extends BaseOperation { * Signs and/or encrypts data based on parameters of class */ public PgpSignEncryptResult execute(PgpSignEncryptInput input, - InputData inputData, OutputStream outputStream) { + InputData inputData, OutputStream outputStream) { int indent = 0; OperationLog log = new OperationLog(); @@ -487,6 +487,12 @@ public class PgpSignEncryptOperation extends BaseOperation { log.add(LogType.MSG_PSE_PENDING_NFC, indent); PgpSignEncryptResult result = new PgpSignEncryptResult(PgpSignEncryptResult.RESULT_PENDING_NFC, log); + + // SignatureSubKeyId can be null. + if (input.getSignatureSubKeyId() == null) { + return new PgpSignEncryptResult(PgpSignEncryptResult.RESULT_ERROR, log); + } + // Note that the checked key here is the master key, not the signing key // (although these are always the same on Yubikeys) result.setNfcData(input.getSignatureSubKeyId(), e.hashToSign, e.hashAlgo, e.creationTimestamp, input.getSignaturePassphrase()); |