Merge branch 'development' of github.com:open-keychain/open-keychain into development

This commit is contained in:
Dominik Schürmann 2014-10-25 02:57:42 +02:00
commit e11df08ea1
4 changed files with 17 additions and 4 deletions

View File

@ -306,6 +306,8 @@ public abstract class OperationResult implements Parcelable {
MSG_IP_MASTER_FLAGS_XXSX (LogLevel.DEBUG, R.string.msg_ip_master_flags_xxsx), MSG_IP_MASTER_FLAGS_XXSX (LogLevel.DEBUG, R.string.msg_ip_master_flags_xxsx),
MSG_IP_MASTER_FLAGS_XXXA (LogLevel.DEBUG, R.string.msg_ip_master_flags_xxxa), MSG_IP_MASTER_FLAGS_XXXA (LogLevel.DEBUG, R.string.msg_ip_master_flags_xxxa),
MSG_IP_MASTER_FLAGS_XXXX (LogLevel.DEBUG, R.string.msg_ip_master_flags_xxxx), MSG_IP_MASTER_FLAGS_XXXX (LogLevel.DEBUG, R.string.msg_ip_master_flags_xxxx),
MSG_IP_MERGE_PUBLIC (LogLevel.DEBUG, R.string.msg_ip_merge_public),
MSG_IP_MERGE_SECRET (LogLevel.DEBUG, R.string.msg_ip_merge_secret),
MSG_IP_SUBKEY (LogLevel.DEBUG, R.string.msg_ip_subkey), MSG_IP_SUBKEY (LogLevel.DEBUG, R.string.msg_ip_subkey),
MSG_IP_SUBKEY_EXPIRED (LogLevel.DEBUG, R.string.msg_ip_subkey_expired), MSG_IP_SUBKEY_EXPIRED (LogLevel.DEBUG, R.string.msg_ip_subkey_expired),
MSG_IP_SUBKEY_EXPIRES (LogLevel.DEBUG, R.string.msg_ip_subkey_expires), MSG_IP_SUBKEY_EXPIRES (LogLevel.DEBUG, R.string.msg_ip_subkey_expires),
@ -347,6 +349,8 @@ public abstract class OperationResult implements Parcelable {
MSG_IS_BAD_TYPE_PUBLIC (LogLevel.WARN, R.string.msg_is_bad_type_public), MSG_IS_BAD_TYPE_PUBLIC (LogLevel.WARN, R.string.msg_is_bad_type_public),
MSG_IS_DB_EXCEPTION (LogLevel.DEBUG, R.string.msg_is_db_exception), MSG_IS_DB_EXCEPTION (LogLevel.DEBUG, R.string.msg_is_db_exception),
MSG_IS_ERROR_IO_EXC(LogLevel.DEBUG, R.string.msg_is_error_io_exc), 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_IMPORTING_SUBKEYS (LogLevel.DEBUG, R.string.msg_is_importing_subkeys), 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_PUBRING_GENERATE (LogLevel.DEBUG, R.string.msg_is_pubring_generate),
MSG_IS_SUBKEY_NONEXISTENT (LogLevel.DEBUG, R.string.msg_is_subkey_nonexistent), MSG_IS_SUBKEY_NONEXISTENT (LogLevel.DEBUG, R.string.msg_is_subkey_nonexistent),

View File

@ -787,8 +787,9 @@ public class UncachedKeyRing {
*/ */
public UncachedKeyRing merge(UncachedKeyRing other, OperationLog log, int indent) { public UncachedKeyRing merge(UncachedKeyRing other, OperationLog log, int indent) {
log.add(isSecret() ? LogType.MSG_MG_SECRET : LogType.MSG_MG_PUBLIC, // This is logged in the calling method to provide more meta info
indent, KeyFormattingUtils.convertKeyIdToHex(getMasterKeyId())); // log.add(isSecret() ? LogType.MSG_MG_SECRET : LogType.MSG_MG_PUBLIC,
// indent, KeyFormattingUtils.convertKeyIdToHex(getMasterKeyId()));
indent += 1; indent += 1;
long masterKeyId = other.getMasterKeyId(); long masterKeyId = other.getMasterKeyId();

View File

@ -744,6 +744,7 @@ public class ProviderHelper {
UncachedKeyRing oldPublicRing = getCanonicalizedPublicKeyRing(masterKeyId).getUncachedKeyRing(); UncachedKeyRing oldPublicRing = getCanonicalizedPublicKeyRing(masterKeyId).getUncachedKeyRing();
// Merge data from new public ring into the old one // Merge data from new public ring into the old one
log(LogType.MSG_IP_MERGE_PUBLIC);
publicRing = oldPublicRing.merge(publicRing, mLog, mIndent); publicRing = oldPublicRing.merge(publicRing, mLog, mIndent);
// If this is null, there is an error in the log so we can just return // If this is null, there is an error in the log so we can just return
@ -780,6 +781,7 @@ public class ProviderHelper {
UncachedKeyRing secretRing = getCanonicalizedSecretKeyRing(publicRing.getMasterKeyId()).getUncachedKeyRing(); UncachedKeyRing secretRing = getCanonicalizedSecretKeyRing(publicRing.getMasterKeyId()).getUncachedKeyRing();
// Merge data from new public ring into secret one // Merge data from new public ring into secret one
log(LogType.MSG_IP_MERGE_SECRET);
secretRing = secretRing.merge(publicRing, mLog, mIndent); secretRing = secretRing.merge(publicRing, mLog, mIndent);
if (secretRing == null) { if (secretRing == null) {
return new SaveKeyringResult(SaveKeyringResult.RESULT_ERROR, mLog, null); return new SaveKeyringResult(SaveKeyringResult.RESULT_ERROR, mLog, null);
@ -836,6 +838,7 @@ public class ProviderHelper {
UncachedKeyRing oldSecretRing = getCanonicalizedSecretKeyRing(masterKeyId).getUncachedKeyRing(); UncachedKeyRing oldSecretRing = getCanonicalizedSecretKeyRing(masterKeyId).getUncachedKeyRing();
// Merge data from new secret ring into old one // Merge data from new secret ring into old one
log(LogType.MSG_IS_MERGE_SECRET);
secretRing = secretRing.merge(oldSecretRing, mLog, mIndent); secretRing = secretRing.merge(oldSecretRing, mLog, mIndent);
// If this is null, there is an error in the log so we can just return // If this is null, there is an error in the log so we can just return
@ -875,6 +878,7 @@ public class ProviderHelper {
UncachedKeyRing oldPublicRing = getCanonicalizedPublicKeyRing(masterKeyId).getUncachedKeyRing(); UncachedKeyRing oldPublicRing = getCanonicalizedPublicKeyRing(masterKeyId).getUncachedKeyRing();
// Merge data from new secret ring into public one // Merge data from new secret ring into public one
log(LogType.MSG_IS_MERGE_PUBLIC);
publicRing = oldPublicRing.merge(secretRing, mLog, mIndent); publicRing = oldPublicRing.merge(secretRing, mLog, mIndent);
if (publicRing == null) { if (publicRing == null) {
return new SaveKeyringResult(SaveKeyringResult.RESULT_ERROR, mLog, null); return new SaveKeyringResult(SaveKeyringResult.RESULT_ERROR, mLog, null);

View File

@ -638,6 +638,8 @@
<string name="msg_ip_master_flags_xxsx">"Master flags: sign"</string> <string name="msg_ip_master_flags_xxsx">"Master flags: sign"</string>
<string name="msg_ip_master_flags_xxxa">"Master flags: authenticate"</string> <string name="msg_ip_master_flags_xxxa">"Master flags: authenticate"</string>
<string name="msg_ip_master_flags_xxxx">"Master flags: none"</string> <string name="msg_ip_master_flags_xxxx">"Master flags: none"</string>
<string name="msg_ip_merge_public">"Merging new data into public keyring"</string>
<string name="msg_ip_merge_secret">"Merging new data into secret keyring"</string>
<string name="msg_ip_subkey">"Processing subkey %s"</string> <string name="msg_ip_subkey">"Processing subkey %s"</string>
<string name="msg_ip_subkey_expired">"Subkey expired on %s"</string> <string name="msg_ip_subkey_expired">"Subkey expired on %s"</string>
<string name="msg_ip_subkey_expires">"Subkey expires on %s"</string> <string name="msg_ip_subkey_expires">"Subkey expires on %s"</string>
@ -688,6 +690,8 @@
<string name="msg_is_db_exception">"Database error!"</string> <string name="msg_is_db_exception">"Database error!"</string>
<string name="msg_is_importing_subkeys">"Processing secret subkeys"</string> <string name="msg_is_importing_subkeys">"Processing secret subkeys"</string>
<string name="msg_is_error_io_exc">"Error encoding keyring"</string> <string name="msg_is_error_io_exc">"Error encoding keyring"</string>
<string name="msg_is_merge_public">"Merging new data into public keyring"</string>
<string name="msg_is_merge_secret">"Merging new data into secret keyring"</string>
<string name="msg_is_pubring_generate">"Generating public keyring from secret keyring"</string> <string name="msg_is_pubring_generate">"Generating public keyring from secret keyring"</string>
<string name="msg_is_subkey_nonexistent">"Subkey %s unavailable in secret key"</string> <string name="msg_is_subkey_nonexistent">"Subkey %s unavailable in secret key"</string>
<string name="msg_is_subkey_ok">"Marked secret subkey %s as available"</string> <string name="msg_is_subkey_ok">"Marked secret subkey %s as available"</string>
@ -762,7 +766,7 @@
<string name="msg_mg_secret">"Merging into secret keyring %s"</string> <string name="msg_mg_secret">"Merging into secret keyring %s"</string>
<string name="msg_mg_new_subkey">"Adding new subkey %s"</string> <string name="msg_mg_new_subkey">"Adding new subkey %s"</string>
<string name="msg_mg_found_new">"Found %s new certificates in keyring"</string> <string name="msg_mg_found_new">"Found %s new certificates in keyring"</string>
<string name="msg_mg_unchanged">"No new certificates"</string> <string name="msg_mg_unchanged">"Nothing to merge"</string>
<!-- createSecretKeyRing --> <!-- createSecretKeyRing -->
<string name="msg_cr">"Generating new master key"</string> <string name="msg_cr">"Generating new master key"</string>
@ -950,7 +954,7 @@
<string name="msg_import_keyserver">"Using keyserver %s"</string> <string name="msg_import_keyserver">"Using keyserver %s"</string>
<string name="msg_import_fingerprint_error">"Fingerprint of fetched key didn't match expected!"</string> <string name="msg_import_fingerprint_error">"Fingerprint of fetched key didn't match expected!"</string>
<string name="msg_import_fingerprint_ok">"Fingerprint check OK"</string> <string name="msg_import_fingerprint_ok">"Fingerprint check OK"</string>
<string name="msg_import_merge">"Merging keys…"</string> <string name="msg_import_merge">"Merging retrieved data"</string>
<string name="msg_import_error">"Import operation failed!"</string> <string name="msg_import_error">"Import operation failed!"</string>
<string name="msg_import_partial">"Import operation successful, with errors!"</string> <string name="msg_import_partial">"Import operation successful, with errors!"</string>
<string name="msg_import_success">"Import operation successful"</string> <string name="msg_import_success">"Import operation successful"</string>