Dont import more than 100 User IDs (OKC-01-002)
This commit is contained in:
@@ -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),
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user