diff options
author | Vincent Breitmoser <valodim@mugenguild.com> | 2015-09-11 02:05:17 +0200 |
---|---|---|
committer | Vincent Breitmoser <valodim@mugenguild.com> | 2015-09-11 02:05:17 +0200 |
commit | b76aa7fe11f953d10688fbc01daa65676448c78a (patch) | |
tree | a84591dd4a96f3da40cb77cc5dddf985f829a693 /OpenKeychain/src/main/java/org/sufficientlysecure/keychain/operations/ImportOperation.java | |
parent | 9d97d37c06f22354c124bd6cedd989d9ca4ff53e (diff) | |
download | open-keychain-b76aa7fe11f953d10688fbc01daa65676448c78a.tar.gz open-keychain-b76aa7fe11f953d10688fbc01daa65676448c78a.tar.bz2 open-keychain-b76aa7fe11f953d10688fbc01daa65676448c78a.zip |
never import secret keys from keyserver (OKC-01-001)
Diffstat (limited to 'OpenKeychain/src/main/java/org/sufficientlysecure/keychain/operations/ImportOperation.java')
-rw-r--r-- | OpenKeychain/src/main/java/org/sufficientlysecure/keychain/operations/ImportOperation.java | 11 |
1 files changed, 9 insertions, 2 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 29264b5a2..89575338f 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/operations/ImportOperation.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/operations/ImportOperation.java @@ -211,7 +211,7 @@ public class ImportOperation extends BaseOperation<ImportKeyringParcel> { } } catch (Keyserver.QueryFailedException e) { Log.d(Constants.TAG, "query failed", e); - log.add(LogType.MSG_IMPORT_FETCH_KEYSERVER_ERROR, 3, e.getMessage()); + log.add(LogType.MSG_IMPORT_FETCH_ERROR_KEYSERVER, 3, e.getMessage()); } } @@ -243,7 +243,7 @@ public class ImportOperation extends BaseOperation<ImportKeyringParcel> { } catch (Keyserver.QueryFailedException e) { // download failed, too bad. just proceed Log.e(Constants.TAG, "query failed", e); - log.add(LogType.MSG_IMPORT_FETCH_KEYSERVER_ERROR, 3, e.getMessage()); + log.add(LogType.MSG_IMPORT_FETCH_ERROR_KEYSERVER, 3, e.getMessage()); } } } @@ -254,6 +254,13 @@ public class ImportOperation extends BaseOperation<ImportKeyringParcel> { continue; } + // never import secret keys from keyserver! + if (entry.mBytes == null && key.isSecret()) { + log.add(LogType.MSG_IMPORT_FETCH_ERROR_KEYSERVER_SECRET, 2); + badKeys += 1; + continue; + } + // Another check if we have been cancelled if (checkCancelled()) { cancelled = true; |