diff options
author | Vincent Breitmoser <valodim@mugenguild.com> | 2015-09-11 01:57:17 +0200 |
---|---|---|
committer | Vincent Breitmoser <valodim@mugenguild.com> | 2015-09-11 01:57:17 +0200 |
commit | 9d97d37c06f22354c124bd6cedd989d9ca4ff53e (patch) | |
tree | 5090cf0d0a18dcbb28a319ac559b224af0c6bf80 /OpenKeychain/src/main/java/org/sufficientlysecure/keychain/operations | |
parent | 950409ce55f2df1aecdb61a7fecfc599b541d89c (diff) | |
download | open-keychain-9d97d37c06f22354c124bd6cedd989d9ca4ff53e.tar.gz open-keychain-9d97d37c06f22354c124bd6cedd989d9ca4ff53e.tar.bz2 open-keychain-9d97d37c06f22354c124bd6cedd989d9ca4ff53e.zip |
perform fingerprint check after canonicalization (OKC-01-009)
Diffstat (limited to 'OpenKeychain/src/main/java/org/sufficientlysecure/keychain/operations')
2 files changed, 3 insertions, 14 deletions
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/operations/ImportOperation.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/operations/ImportOperation.java index 7b224fe8e..29264b5a2 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/operations/ImportOperation.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/operations/ImportOperation.java @@ -254,17 +254,6 @@ public class ImportOperation extends BaseOperation<ImportKeyringParcel> { continue; } - // If we have an expected fingerprint, make sure it matches - if (entry.mExpectedFingerprint != null) { - if (!key.containsSubkey(entry.mExpectedFingerprint)) { - log.add(LogType.MSG_IMPORT_FINGERPRINT_ERROR, 2); - badKeys += 1; - continue; - } else { - log.add(LogType.MSG_IMPORT_FINGERPRINT_OK, 2); - } - } - // Another check if we have been cancelled if (checkCancelled()) { cancelled = true; @@ -283,7 +272,7 @@ public class ImportOperation extends BaseOperation<ImportKeyringParcel> { } else { result = mProviderHelper.savePublicKeyRing(key, new ProgressScaler(progressable, (int) (position * progSteps), - (int) ((position + 1) * progSteps), 100)); + (int) ((position + 1) * progSteps), 100), entry.mExpectedFingerprint); } } if (!result.success()) { 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 46852d783..4e528f73e 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 @@ -289,6 +289,8 @@ public abstract class OperationResult implements Parcelable { MSG_IP_ERROR_IO_EXC (LogLevel.ERROR, R.string.msg_ip_error_io_exc), MSG_IP_ERROR_OP_EXC (LogLevel.ERROR, R.string.msg_ip_error_op_exc), MSG_IP_ERROR_REMOTE_EX (LogLevel.ERROR, R.string.msg_ip_error_remote_ex), + MSG_IP_FINGERPRINT_ERROR (LogLevel.ERROR, R.string.msg_ip_fingerprint_error), + MSG_IP_FINGERPRINT_OK (LogLevel.INFO, R.string.msg_ip_fingerprint_ok), MSG_IP_INSERT_KEYRING (LogLevel.DEBUG, R.string.msg_ip_insert_keyring), MSG_IP_INSERT_SUBKEYS (LogLevel.DEBUG, R.string.msg_ip_insert_keys), MSG_IP_PREPARE (LogLevel.DEBUG, R.string.msg_ip_prepare), @@ -712,8 +714,6 @@ public abstract class OperationResult implements Parcelable { MSG_IMPORT_KEYSERVER (LogLevel.DEBUG, R.string.msg_import_keyserver), MSG_IMPORT_MERGE (LogLevel.DEBUG, R.string.msg_import_merge), MSG_IMPORT_MERGE_ERROR (LogLevel.ERROR, R.string.msg_import_merge_error), - MSG_IMPORT_FINGERPRINT_ERROR (LogLevel.ERROR, R.string.msg_import_fingerprint_error), - MSG_IMPORT_FINGERPRINT_OK (LogLevel.DEBUG, R.string.msg_import_fingerprint_ok), MSG_IMPORT_ERROR (LogLevel.ERROR, R.string.msg_import_error), MSG_IMPORT_ERROR_IO (LogLevel.ERROR, R.string.msg_import_error_io), MSG_IMPORT_PARTIAL (LogLevel.ERROR, R.string.msg_import_partial), |