diff options
author | Dominik Schürmann <dominik@dominikschuermann.de> | 2014-10-26 00:38:31 +0200 |
---|---|---|
committer | Dominik Schürmann <dominik@dominikschuermann.de> | 2014-10-26 00:38:31 +0200 |
commit | 825baeee1bf137c40aa52e3a00115b951c0a6171 (patch) | |
tree | 6abda71cd5855a32aefa0a4994fc11be52be703d /OpenKeychain/src/main/java/org | |
parent | 8257e450f9c78cde1d12422f530e7bb59d3edf4d (diff) | |
parent | fb7264d7fdf10099ec74d9c4f3eddce043a421a2 (diff) | |
download | open-keychain-825baeee1bf137c40aa52e3a00115b951c0a6171.tar.gz open-keychain-825baeee1bf137c40aa52e3a00115b951c0a6171.tar.bz2 open-keychain-825baeee1bf137c40aa52e3a00115b951c0a6171.zip |
Merge branch 'development' of github.com:open-keychain/open-keychain into development
Diffstat (limited to 'OpenKeychain/src/main/java/org')
2 files changed, 17 insertions, 4 deletions
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 149640bcf..920c83ef7 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 @@ -351,6 +351,7 @@ public abstract class OperationResult implements Parcelable { MSG_IS_ERROR_IO_EXC(LogLevel.DEBUG, R.string.msg_is_error_io_exc), MSG_IS_MERGE_PUBLIC (LogLevel.DEBUG, R.string.msg_is_merge_public), MSG_IS_MERGE_SECRET (LogLevel.DEBUG, R.string.msg_is_merge_secret), + MSG_IS_MERGE_SPECIAL (LogLevel.DEBUG, R.string.msg_is_merge_special), MSG_IS_IMPORTING_SUBKEYS (LogLevel.DEBUG, R.string.msg_is_importing_subkeys), MSG_IS_PUBRING_GENERATE (LogLevel.DEBUG, R.string.msg_is_pubring_generate), MSG_IS_SUBKEY_NONEXISTENT (LogLevel.DEBUG, R.string.msg_is_subkey_nonexistent), diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/provider/ProviderHelper.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/provider/ProviderHelper.java index c28ebde8d..46f294866 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/provider/ProviderHelper.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/provider/ProviderHelper.java @@ -135,9 +135,7 @@ public class ProviderHelper { } public void clearLog() { - if (mLog != null) { - mLog.clear(); - } + mLog = new OperationLog(); } // If we ever switch to api level 11, we can ditch this whole mess! @@ -867,7 +865,21 @@ public class ProviderHelper { // This is a safe cast, because we made sure this is a secret ring above canSecretRing = (CanonicalizedSecretKeyRing) secretRing.canonicalize(mLog, mIndent); if (canSecretRing == null) { - return new SaveKeyringResult(SaveKeyringResult.RESULT_ERROR, mLog, null); + + // Special case: If keyring canonicalization failed, try again after adding + // all self-certificates from the public key. + try { + log(LogType.MSG_IS_MERGE_SPECIAL); + UncachedKeyRing oldPublicRing = getCanonicalizedPublicKeyRing(masterKeyId).getUncachedKeyRing(); + secretRing = secretRing.merge(oldPublicRing, mLog, mIndent); + canSecretRing = (CanonicalizedSecretKeyRing) secretRing.canonicalize(mLog, mIndent); + } catch (NotFoundException e2) { + // nothing, this is handled right in the next line + } + + if (canSecretRing == null) { + return new SaveKeyringResult(SaveKeyringResult.RESULT_ERROR, mLog, null); + } } } |