diff options
author | Dominik Schürmann <dominik@dominikschuermann.de> | 2015-07-08 03:12:24 +0200 |
---|---|---|
committer | Dominik Schürmann <dominik@dominikschuermann.de> | 2015-07-08 03:12:24 +0200 |
commit | 4837d4cc5c86a5f5f18cb86300f165cf1b37f4d2 (patch) | |
tree | feeaaa654f24df80453e69a43cff84770c95fd27 /OpenKeychain/src/main/java/org/sufficientlysecure/keychain/operations | |
parent | 15cee8e7e995afe1c435004c3abba521439e4e0b (diff) | |
parent | af546ae10190ac076cd7b091cd064fb8a5c03519 (diff) | |
download | open-keychain-4837d4cc5c86a5f5f18cb86300f165cf1b37f4d2.tar.gz open-keychain-4837d4cc5c86a5f5f18cb86300f165cf1b37f4d2.tar.bz2 open-keychain-4837d4cc5c86a5f5f18cb86300f165cf1b37f4d2.zip |
Merge branch 'master' of github.com:open-keychain/open-keychain
Diffstat (limited to 'OpenKeychain/src/main/java/org/sufficientlysecure/keychain/operations')
2 files changed, 14 insertions, 3 deletions
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/operations/CertifyOperation.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/operations/CertifyOperation.java index 318eee6ba..d0377cc24 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/operations/CertifyOperation.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/operations/CertifyOperation.java @@ -29,6 +29,7 @@ import org.sufficientlysecure.keychain.operations.results.SaveKeyringResult; import org.sufficientlysecure.keychain.pgp.CanonicalizedPublicKeyRing; import org.sufficientlysecure.keychain.pgp.CanonicalizedSecretKey; import org.sufficientlysecure.keychain.pgp.CanonicalizedSecretKeyRing; +import org.sufficientlysecure.keychain.pgp.PassphraseCacheInterface; import org.sufficientlysecure.keychain.pgp.PgpCertifyOperation; import org.sufficientlysecure.keychain.pgp.PgpCertifyOperation.PgpCertifyResult; import org.sufficientlysecure.keychain.pgp.Progressable; @@ -90,14 +91,21 @@ public class CertifyOperation extends BaseOperation<CertifyActionsParcel> { case PIN: case PATTERN: case PASSPHRASE: - if (!cryptoInput.hasPassphrase()) { + passphrase = cryptoInput.getPassphrase(); + if (passphrase == null) { + try { + passphrase = getCachedPassphrase(certificationKey.getKeyId(), certificationKey.getKeyId()); + } catch (PassphraseCacheInterface.NoSecretKeyException ignored) { + // treat as a cache miss for error handling purposes + } + } + + if (passphrase == null) { return new CertifyResult(log, RequiredInputParcel.createRequiredSignPassphrase( certificationKey.getKeyId(), certificationKey.getKeyId(), null) ); } - // certification is always with the master key id, so use that one - passphrase = cryptoInput.getPassphrase(); break; case PASSPHRASE_EMPTY: @@ -105,6 +113,7 @@ public class CertifyOperation extends BaseOperation<CertifyActionsParcel> { break; case DIVERT_TO_CARD: + // the unlock operation will succeed for passphrase == null in a divertToCard key passphrase = null; break; diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/operations/results/OperationResult.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/operations/results/OperationResult.java index 5ae068b35..9da3b94af 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/operations/results/OperationResult.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/operations/results/OperationResult.java @@ -482,6 +482,7 @@ public abstract class OperationResult implements Parcelable { // secret key modify MSG_MF (LogLevel.START, R.string.msg_mr), MSG_MF_DIVERT (LogLevel.DEBUG, R.string.msg_mf_divert), + MSG_MF_ERROR_DIVERT_NEWSUB (LogLevel.ERROR, R.string.msg_mf_error_divert_newsub), MSG_MF_ERROR_DIVERT_SERIAL (LogLevel.ERROR, R.string.msg_mf_error_divert_serial), MSG_MF_ERROR_ENCODE (LogLevel.ERROR, R.string.msg_mf_error_encode), MSG_MF_ERROR_FINGERPRINT (LogLevel.ERROR, R.string.msg_mf_error_fingerprint), @@ -499,6 +500,7 @@ public abstract class OperationResult implements Parcelable { MSG_MF_ERROR_RESTRICTED(LogLevel.ERROR, R.string.msg_mf_error_restricted), MSG_MF_ERROR_REVOKED_PRIMARY (LogLevel.ERROR, R.string.msg_mf_error_revoked_primary), MSG_MF_ERROR_SIG (LogLevel.ERROR, R.string.msg_mf_error_sig), + MSG_MF_ERROR_SUB_STRIPPED(LogLevel.ERROR, R.string.msg_mf_error_sub_stripped), MSG_MF_ERROR_SUBKEY_MISSING(LogLevel.ERROR, R.string.msg_mf_error_subkey_missing), MSG_MF_ERROR_CONFLICTING_NFC_COMMANDS(LogLevel.ERROR, R.string.msg_mf_error_conflicting_nfc_commands), MSG_MF_ERROR_DUPLICATE_KEYTOCARD_FOR_SLOT(LogLevel.ERROR, R.string.msg_mf_error_duplicate_keytocard_for_slot), |