diff options
author | Dominik Schürmann <dominik@dominikschuermann.de> | 2015-09-25 01:38:43 +0200 |
---|---|---|
committer | Dominik Schürmann <dominik@dominikschuermann.de> | 2015-09-25 01:38:43 +0200 |
commit | 29e9b2fa1eb5cfcd1539027e54025120d5af6a3e (patch) | |
tree | 96ea2a98f7d9929049c00c169fffc813dccf3102 /OpenKeychain/src | |
parent | b10b14d9bc737edc56af0eec3a14bed5ebf3ea39 (diff) | |
download | open-keychain-29e9b2fa1eb5cfcd1539027e54025120d5af6a3e.tar.gz open-keychain-29e9b2fa1eb5cfcd1539027e54025120d5af6a3e.tar.bz2 open-keychain-29e9b2fa1eb5cfcd1539027e54025120d5af6a3e.zip |
Dont import more than 100 User IDs (OKC-01-002)
Diffstat (limited to 'OpenKeychain/src')
3 files changed, 8 insertions, 2 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 a03658808..65816e5f2 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 @@ -474,6 +474,7 @@ public abstract class OperationResult implements Parcelable { MSG_KC_UID_BAD (LogLevel.WARN, R.string.msg_kc_uid_bad), MSG_KC_UID_CERT_DUP (LogLevel.DEBUG, R.string.msg_kc_uid_cert_dup), MSG_KC_UID_DUP (LogLevel.DEBUG, R.string.msg_kc_uid_dup), + MSG_KC_UID_TOO_MANY (LogLevel.DEBUG, R.string.msg_kc_uid_too_many), MSG_KC_UID_FOREIGN (LogLevel.DEBUG, R.string.msg_kc_uid_foreign), MSG_KC_UID_NO_CERT (LogLevel.DEBUG, R.string.msg_kc_uid_no_cert), MSG_KC_UID_REVOKE_DUP (LogLevel.DEBUG, R.string.msg_kc_uid_revoke_dup), diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/UncachedKeyRing.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/UncachedKeyRing.java index ca98882d8..87e7ec461 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/UncachedKeyRing.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/UncachedKeyRing.java @@ -457,11 +457,15 @@ public class UncachedKeyRing implements Serializable { // check for duplicate user ids if (processedUserIds.contains(userId)) { - log.add(LogType.MSG_KC_UID_DUP, - indent, userId); + log.add(LogType.MSG_KC_UID_DUP, indent, userId); // strip out the first found user id with this name modified = PGPPublicKey.removeCertification(modified, rawUserId); } + if (processedUserIds.size() > 100) { + log.add(LogType.MSG_KC_UID_TOO_MANY, indent, userId); + // strip out the user id + modified = PGPPublicKey.removeCertification(modified, rawUserId); + } processedUserIds.add(userId); PGPSignature selfCert = null; diff --git a/OpenKeychain/src/main/res/values/strings.xml b/OpenKeychain/src/main/res/values/strings.xml index 53483c390..b0e0f5734 100644 --- a/OpenKeychain/src/main/res/values/strings.xml +++ b/OpenKeychain/src/main/res/values/strings.xml @@ -995,6 +995,7 @@ <string name="msg_kc_uid_no_cert">"No valid self-certificate found for user ID '%s', removing from ring"</string> <string name="msg_kc_uid_remove">"Removing invalid user ID '%s'"</string> <string name="msg_kc_uid_dup">"Removing duplicate user ID '%s'. The keyring contained two of them. This may result in missing certificates!"</string> + <string name="msg_kc_uid_too_many">"Removing user ID '%s'. More than 100 User IDs are not imported!"</string> <string name="msg_kc_uid_warn_encoding">"User ID does not verify as UTF-8!"</string> <string name="msg_kc_uat_jpeg">"Processing user attribute of type JPEG"</string> <string name="msg_kc_uat_unknown">"Processing user attribute of unknown type"</string> |